demo-dowhile - // Demo program for do...while // This...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Demo program for do...while // This program allows the user to view the weights for any number // of components of the CMPSC 201 grade. #include <iostream> using namespace std; int main() { int choice; do { // for cin, cout, endl // so std:: isn't needed // user's menu input: 1-6 // run menu system continuosly cout << "Choose a component of your CMPSC 201 course grade\n" << "to find out its weight: \n" << "\t1. Quizzes\n" << "\t2. Labs\n" << "\t3. Projects\n" << "\t4. Exams\n" << "\t5. Final exam\n" << "\t6. Quit\n" << "Enter the number of your choice: "; cin >> choice; switch(choice) { case 1: cout << break; case 2: cout << break; case 3: cout << break; case 4: cout << break; case 5: cout << break; case 6: cout << break; default: cout << } // output %age desired // quizzes "Quizzes count for 5%" << endl; // labs "Labs count for 20%" << endl; // projects "Projects count for 25%" << endl; // exams "Exams count for 30%" << endl; // final exam "Final counts for 20%" << endl; // quit "Thanks for using this program!" << endl; // error handling "Please choose an option from 1-6 next time." << endl; // space between runs cout << endl << endl; } while(choice != 6); } return 0; ...
View Full Document

Ask a homework question - tutors are online