Question: Select a favorite topic. Write a program that asks for names and some attribute of the item (see below). Use a WHILE loop to continue

Select a favorite topic. Write a program that asks for names and some attribute of the item (see below). Use a WHILE loop to continue to get input. When the user is finished entering information, display some arithmetic information about what they entered. Enter a fruit: apple What color is it (R)ed, (Y)ellow, (O)ther? R Do you want to add more (Y/N)? Y Enter a fruit: banana What color is it (R)ed, (Y)ellow, (O)ther? Y Do you want to add more (Y/N)? Y Enter a fruit: cherry What color is it (R)ed, (Y)ellow, (O)ther? R Do you want to add more (Y/N)? Y Enter a fruit: grape What color is it (R)ed, (Y)ellow, (O)ther? O Do you want to add more (Y/N)? N You entered 4 altogether. There were 2 red fruits. There were 1 yellow fruits. There were 1 fruits that were neither red nor yellow. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!