CSC 101 - cout << inches_square...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// Program Area calculates the area of a square. // The user is prompted to enter the number of // inches on each side. / #include <iostream> #include <string> #include <math.h> # using namespace std; u int main () { //double inches, inches_square, meters_square; int hours, wages; double PAY = 24.75; string MyName1; string MyName2; /* cout << "This program will help you find the inches square and convert from squares inches to meters square." << endl; cout << "Have fun :-)" << endl; c cout << "\nEnter the number of inches on a side."<< endl; cout << "Press the return key:"; cin >> inches; inches_square = inches*inches; cout << "The area is " << inches_square << " square inches." << endl; cout << "Conversion from inches square to meters squares ." << endl; meters_square = inches_square * 0.00064516;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout &lt;&lt; inches_square &lt;&lt; &quot; = &quot; &lt;&lt; meters_square &lt;&lt;&quot; meters square.&quot;; cin &gt;&gt; numbers; */ cout &lt;&lt; &quot;\n\t\t -=-=-=-=-=- Enter your name -=-=-=-=-=- &quot; &lt;&lt;endl; cout &lt;&lt; &quot;\nEnter your first name: &quot;; cin &gt;&gt; MyName1; cout &lt;&lt; &quot;Enter your last name: &quot;; cin &gt;&gt; MyName2; cout &lt;&lt; &quot;Enter your hour of work: &quot;; cin &gt;&gt; hours; if (hours&lt;=40.0){ wages = hours*PAY; cout &lt;&lt; &quot;\n &quot; &lt;&lt;endl; cout &lt;&lt; MyName1 &lt;&lt; &quot; &quot; &lt;&lt; MyName2 &lt;&lt; &quot; &quot; &lt;&lt; &quot;Your wages this month is: $&quot; &lt;&lt; wages &lt;&lt;endl; } else if (hours&gt;40.0){ wages = (hours*PAY)+(hours-40.0*1.5*PAY); cout &lt;&lt; &quot;\n &quot; &lt;&lt; MyName1 &lt;&lt; &quot; &quot; &lt;&lt; MyName2 &lt;&lt; &quot; ,&quot; &lt;&lt; &quot;your wage this month is: $&quot; &lt;&lt; wages &lt;&lt;endl; } else { cout &lt;&lt; &quot;Wrong hours entered.&quot;&lt;&lt; endl; } return 0; }...
View Full Document

This note was uploaded on 02/08/2011 for the course CSC 101 taught by Professor Joedzuback during the Spring '11 term at Union County.

Ask a homework question - tutors are online