Define an array that can store a maximum of 50 integer


Question: Define an array that can store a maximum of 50 integer values entered at the keyboard. Enter a series of 1s, 2s, 3s, and 4s into the array to represent people at a local school function; 1 represents an infant, 2 represents a child, 3 represents a teenager, and 4 represents an adult.

No other integer value should be accepted as valid input, and data entry should stop when a negative value is entered. Your program should count the number of each 1, 2, 3, and 4 in the array and display a list of how many infants, children, teenagers, and adults were at the school function.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Define an array that can store a maximum of 50 integer
Reference No:- TGS02503460

Now Priced at $15 (50% Discount)

Recommended (98%)

Rated (4.3/5)