if_statement - } else if (menuChoice == 2) { cout...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> #include <cmath> using namespace std int main() { int menuChoice = 0 int numBooks = 0 int numMovies = 0 double numPdsPeanuts = 0.0 cout << "1 books" << endl cout << "2 movies" << endl cout << "3 peanuts" << endl cout << "Enter your choice: " cin >> menuChoice if (menuChoice == 1) { cout << "You owe $9 for 1 book" << endl
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } else if (menuChoice == 2) { cout &lt;&lt; &quot;You owe $14.99 for 1 movie&quot; &lt;&lt; endl } else if (menuChoice == 3) { cout &lt;&lt; &quot;You owe $1.30 for 1 lb of peanuts&quot; &lt;&lt; endl } else { cout &lt;&lt; &quot;Contact the programmer at 1-800-who-cares&quot; &lt;&lt; endl } return 0 }// end of main...
View Full Document

Ask a homework question - tutors are online