Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In java please, Write a program called Survey that tallies the results for a beverage survey. The program should prompt the user to enter the
In java please,
Write a program called Survey that tallies the results for a beverage survey. The program should prompt the user to enter the beverage number chosen by a survey participant until the user enters alue -1. Once that value has been entered, display the survey results (i.e., the number of times each beverage was chosen). You can assume users enter a valid choice when prompted You will need to create several variables to keep track of the number of times each beverage is chosen. Your output should look similar to the example below. Note: feel free to use beverages of your own choosing. Example 1: 1.Coffee 2.Milk 3.Red Bull 4.Water Please enter the person's choice: 1 1.Coffee 2.Milk 3.Red Bull 4.Water Please enter the person's choice: 3 1.Coffee 2.Milk 3.Red Bull 4. Water Please enter the person's choice: 1 1.Coffee 2.Milk 3.Red Bull 4.Water Please enter the person's choice: 4 1.Coffee 2.Milk 3.Red Bul1 4.Water Please enter the person's choice: -1 Survey Results Coffee 2 Milk 0 Red Bull1 Water 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started