DA09A - ENGINEERING H192 DAILY ASSIGNMENT A09 As you've...

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

View Full Document Right Arrow Icon
ENGINEERING H192 DAILY ASSIGNMENT A09 As you’ve seen, the switch statement can be used to implement menu-like transfers. In addition, the switch selection structure in C/C++ can be used as a convenient way to count the occurrences of integral data values. In this assignment you are to write a complete C/C++ program, a09.cpp , that uses a while loop, a for loop, and a switch structure to generate and count a user specified number of random integers between 0 and 9 inclusive. The while loop will control the overall execution of the program, the for loop will be “nested” inside the while loop and will be used to generate and count the random integers, while the switch structure , which will be nested inside the for loop, will do the actual counting. Your program must: (1) Execute indefinitely until the users decides to quit (2) Prompt the user for the number of random integers to generate, with “0” indicating “quit” (3) Inform the user when an entry is invalid (less than zero) and ignore that entry
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/05/2011 for the course H 192 taught by Professor Glimcher during the Winter '08 term at Ohio State.

Ask a homework question - tutors are online