Can anyone explain how rust works, in 4th grade language?
147407
Rusting is a chemical process that, can take place in metals exposed to the atmosphere. Not all metals however rust. Rusting is common with the metal, iron. Certain conditions in the air around a metal have to be present for iron to rust. Iron rust which, generally appears brown, is itself a chemical compound quite different from the iron itself. The rusting of iron can be prevented. In towns and large cities where iron sheets are used for roofing houses, rusting can also take place if the iron sheets are not protected from rusting. \n\nRust is the common name for a very common compound, iron oxide. Iron oxide, the chemical Fe2O3, is common because iron combines very readily with oxygen -- so readily, in fact, that pure iron is only rarely found in nature. Iron (or steel) rusting is an example of corrosion -- an electrochemical process involving an anode (a piece of metal that readily gives up electrons), an electrolyte (a liquid that helps electrons move) and a cathode (a piece of metal that readily accepts electrons). When a piece of metal corrodes, the electrolyte helps provide oxygen to the anode. As oxygen combines with the metal, electrons are liberated. When they flow through the electrolyte to the cathode, the metal of the anode disappears, swept away by the electrical flow or converted into metal cations in a form such as rust.\n\nFor iron to become iron oxide, three things are required: iron, water and oxygen. Here's what happens when the three get together:\n\nWhen a drop of water hits an iron object, two things begin to happen almost immediately. First, the water, a good electrolyte, combines with carbon dioxide in the air to form a weak carbonic acid, an even better electrolyte. As the acid is formed and the iron dissolved, some of the water will begin to break down into its component pieces -- hydrogen and oxygen. The free oxygen and dissolved iron bond into iron oxide, in the process freeing electrons. The electrons liberated from the anode portion of the iron flow to the cathode, which may be a piece of a metal less electrically reactive than iron, or another point on the piece of iron itself.\n\nThe chemical compounds found in liquids like acid rain, seawater and the salt-loaded spray from snow-belt roads make them better electrolytes than pure water, allowing their presence to speed the process of rusting on iron and other forms of corrosion on other metals.
805034
#include<iostream.h>\nvoid main()\n{int a,b,c,d,e;\ncout<<"Enter any two numbers&#92;n";\ncin>>a>>b;\nc=a+b;\nd=a*b;\ne=a/b;\ncout<<"&#92;nThe sum of <<a<<|" and "<<b<<" is:"<<c;\ncout<<"&#92;nThe product of <<a<<|" and "<<b<<" is:"<<d;\ncout<<"&#92;nThe qoutient of <<a<<|" and "<<b<<" is:"<<e;\ngetch();\n}
1119693
I think you might need to elucidate more on that question.\n\nPerhaps you mean how do you store multiple values in a data structure.\n\nPerhaps you mean how do you modify a "final" variable. In other languages this is called a constant. The point of this is that it cannot be changed at runtime.
314789
How to work it? It's not very difficult. You just need to write your code and compile it.\n\nUnfortunately I can't send you anything, but you can check out my first source for more information.
837695
Before I offer an answer, I would like to make a couple of comments.\n\nFirst, seeing how you are using Java, I'm assuming this is an introductory programming course. One thing I HIGHLY recommend you do in the future is COMMENT, COMMENT, COMMENT! Get in the habit of doing it now. It didn't make a huge difference for this particular piece of code, but if you want others to help you debug your code, they need to be able to understand your code.\n\nSecond, I would like to make a remark about n2thepower's answer. I agree that Java will probably be dead a few years down the road, but the fact is that most languages will end up dying at some point or another. More than likely, the class teaches principles of object-oriented programming and not Java, per se. These you can take with you anywhere, no matter what particular programming language you end up using, but if you fail to master these fundamental underpinnings, good luck. The reason for Java's widespread use in beginning programming classes is its relative "friendliness" to budding programmers. (I've heard the analogy of C++ to Java as a scalpel to kiddy scissors.)\n\nAs for my answer, I could follow your code up until the last for loop. It seems to me that the upper bound for your loop should be i <= max (instead of max + 1), otherwise you end up one index beyond the last assigned value for your integer array a[].
550059
Rust is the substance formed when iron compounds corrode in the presence of oxygen and water. It is a mixture of iron oxides and hydroxides. Rusting is a common term for corrosion, and usually corrosion of steel.\n\nIron is found naturally in the ore haematite as iron oxide, and metallic iron tends to return to a similar state when exposed to air, (hydrogen, oxygen, nitrogen, etc.) and water. This corrosion is due to the oxidation reaction when iron metal returns to an energetically favourable state. Energy is given off when rust forms. The process of rusting can be summarized as three basic stages: The formation of iron(II) ions from the metal; the formation of hydroxide ions; and their reaction together, with the addition of oxygen, to create rust.\n\nIron is the main component of steel and the corrosion of steel is observed more frequently, since iron is rarely used without alloying in the present day.\n\nWhen steel contacts water, an electrochemical process starts. On the surface of the metal, iron is oxidized to iron(II):\n\n    Fe → Fe2+ + 2e−\n\nThe electrons released travel to the edges of the water droplet, where there is plenty of dissolved oxygen. They reduce the oxygen and water to hydroxide ions:\n\n    4e− + O2 + 2H2O → 4OH−\n\nThe hydroxide ions react with the iron(II) ions and more dissolved oxygen to form iron oxide. The hydration is variable, however in its most general form:\n\n    Fe2+ + 2OH− → Fe(OH)2\n    4Fe(OH)2 + O2 → 2(Fe2O3.xH2O) + 2H2O\n\nHence, rust is hydrated iron(III) oxide. Corrosion tends to progress faster in seawater than fresh water due to higher concentration of sodium chloride ions, making the solution more conductive. Rusting is also accelerated in the presence of acids, but inhibited by alkalis. Rust can often be removed through electrolysis, however the base metal object can not be restored through this method.
253055
Off the top of my head, don't hate me if there are errors...\n\nclass MyVar\n{\npublic:\n  int a;\n  MyVar ( MyVar& src )\n  { a = src.a; }\n}\n\n...\nMyVar p;\np.a = 5;\nMyVar q(p);\n// q.a==5 is true
659274
Tutorials are okay for learning the basics, but I suggest learning what each tool does and how it manipulates pixels. I find that tutorials cannot prepare you for questions in the classroom or projects on the job. Find some textures (i.e. concret, wood, granite, carpet, etc.) and see if you can recreate them yourself. \n\nOne of the things I used to do was ask a potential hire to make rust using Photoshop. I wasn't really interested in if they could make realistic rust or not, but I wanted to see what tools they used and if they were familiar enough with the program to at least attempt making rust.
1011128
Please post the snippet of code that does not work. In general, you need to check an array's length before yo uaccess its elements - it's called defensive programming, and good programmers should employ it.
94728
well, you didn't specify a language so here's korn shell:\n\n#! /bin/ksh\nread c\nTEMP=1\nwhile [ $TEMP -lt $c ]; do\n  echo "**********************************" | cut -c1-$TEMP\n  let "c += 1"\ndone\n\nmy c++ is a bit rusty, but the loop would look like this:\n\nwhile ( c = 1; c <= count ; c++ )\n{\n  while ( d = 1; d <= c; d++ )\n  {\n    cout << "*";\n  }\n  cout << endl;\n}\n\nhope this helps :-)
232131
#include<iostream.h>\nint main() \n{ \n   int stop=false;    \nchar pl='X';    \nchar p; //is used for checking when a game is won  \n  \nint v; //value    \nchar list[]="123456789&#92;0"; //create our array that holds all the values \n\n   do { //start our while loop        //INPUT \n       cin >> v;        //MARKING \n       if (list[v-1]!='X' and list[v-1]!='O')\n {       \n    list[v-1]=pl;       \n }        \nelse\n {  \n     cout << "That place is already taken.&#92;n";   \n      goto skip; //if its already taken skip the turn switch             \n}  \n    if (pl=='X')\n {  \n          pl='O';  \n   }\n   else\n { \n \n          pl='X';  \n      }        skip:;        //win checks   \n     for (int w=0; w<2; w++)\n{    \n        if (w==0)\n{       \n        p='X';   \n         } \n           else{ \n                p='O'; \n           }\n     for (int z=0; z<9; z=z+3)\n {\n     if (list[z]==p and list[z+1]==p and list[z+2]==p) {                 \n  stop=true; \n        goto GAME_END;    \n            } \n           }\n            for (int z=0; z<3; z++) { \n        if (list[z]==p and list[z+3]==p and list[z+6]==p) {\n                   stop=true;            \n       goto GAME_END;        \n        }  \n          }        \n    if (list[0]==p and list[4]==p and list[8]==p or list[2]==p and list[4]==p and list[6]==p)\n{     \n          goto GAME_END;   \n         }   \n     } \n       //PRINTING OF THE VALUES       \n for (int x=0; x<9; x++) {  \n           cout << list[x];   \n          if (x==2 or x==5 or x==8) {  \n              cout << "&#92;n";    \n         }    \n    }   \n     //END PRINTING OF THE VALUES \n       //system("PAUSE");   \n }\n while (stop==false); \n//End the while loop    \nGAME_END:;      \n  cout << p << " wins!&#92;n";      \n  system("PAUSE");\n}
561896
Hi,\n\nYou can start reading the basic section in C++, they teach you on what are variables, what are datatypes, and what are loops.\n\nThey will teach you how to use arrays and loops and conditionals.\n\nThat is your best bet...\n\nPick up any standard C++ book and read he intro to programming!
930756
#include<iostream>\nusing namespace::std\n\nvoid main(){\ncout<<"Plz enter a number"<<endl;\nint x;\ncin>>x;\nif(x!=4)\n{\ncout<<"Well Done"<<endl;\n}\nelse {\ncout<<"The Number You Entered is 4"<<endl;\n}\n\n};\n\nI GUESS THIS IS WHAT YOU MEAN. YOU DONT NEED A BOOLEAN OPERATOR IN THIS CASE.
751489
I don't see how you could access elements in an array past MAXINT. (Using array syntax.)\n\nSo the practical answer is MAXINT.
1113194
try this\n\nhttp://en.wikipedia.org/wiki/Java_programming_language
197553
I looked through it pretty carefully, and I believe\nit is correct.  I would, however, like to make a\ncouple of comments.\n\nFirst, this code makes no attempt at balancing the\ntrees, so you can easily end up with a linked list\nrather than a binary tree.  Consider if you created\nthe tree by passing in a set of sorted values.\n\nSecond, from the perspective of understanding the\nflow, it's a little harder when a routine has so\nmany distinct return points.  I'm not sure if it is\nbetter, but at least consider the following code\nwhich is semantically identical:\n\nTreeNode* InsertTree( TreeNode* tnPtr, const TreeItemType& item)\n{\n    // Inserting an item\n    if(tnPtr == NULL)\n        tnPtr = new TreeNode(item);\n\n    if(item < tnPtr->item_)\n        tnPtr->left_ = InsertTree(tnPtr->left_, item);\n    else if(item > tnPtr->item_)\n        tnPtr->right_ = InsertTree(tnPtr->right_, item);\n\n    return tnPtr;\n}
813680
i'll give you the basic syntax..fill in the rest yourself\n\n#include<iostream.h>\n#include<conio.h>\n#include<stdio.h>\n\nvoid main()\n{\n  clrscr();\n   cout<<"&#92;t&#92;t Currency converter "<<endl;\n  cout<<"&#92;n 1) US dollars to peso "<<endl;\n  cout<<"&#92;n 2) US dollars to Euros "<<endl;\n  cout<<"&#92;n 3.........  "<<endl;\n  cout<<"&#92;n 4 ..... "<<endl;\n .....................................\n........................................\ncout<<"&#92;n enter your choice ";\ncin>>choice;\n\nswitch(choice)\n  {\n     case 1:\n       clrscr();\n        cout<<"&#92;n enter the amount in US dollars you want to convert to pesos ";\n      cin>>amount;\n      cout<<"&#92;n&#92;n "<<amount<<" dollars are equal to "<<amount*9.32 <<" pesos "<<endl;\n     break;\n     case 2 :\n        clrscr();\n        cout<<"&#92;n enter the amount in US dollars you want to convert to Euros ";\n....................................\n ...........................\n   case 3:\n ...................................\n...\n\ndefault :\n   cout<<"&#92;n invalid choice...";\n   exit(0);\n   }\n\ngetch();\n   \n\n}