Question: CSE II0: Principles of Programming Languages Assignment 3 Overview In this assignment you will write a program that will accept numerical inputs from the user





CSE II0: Principles of Programming Languages Assignment 3 Overview In this assignment you will write a program that will accept numerical inputs from the user until they enter a zero. The program will track some information about the numbers the user inputs and will display these after the user has finished entering new values. It will also perform some basic statistics on the inputs and display those as well. Requirements Your program must do the following in order to receive full credit on this assignment. 1. Create an int variable that will track the number of inputs, a double value that will store the sum of the inputs, and a double that will hold the user's last input Print a message informing the user to type in double values and to enter 0 when they are finished. Create a loop that will run until the user types in a zero. 2. 3. a. Print a message asking the user to type in a number b. Accept a double value from the user c. Each input is added to the sum i. Even if it's negative! d. Track the total number of inputs. Track the highest and lowest value you see. e. i. These can be the same (for example if the user only typed in a single number). f The zero to end the input is not counted in any of these. Note: While your loop must do all of these things, you may want to do them in a difTerent order. Be careful about where you set your variables and to not lose any of the user inputs. g. 4. Verify that the user typed at least one value in and print a message if they did not. a. That is, did they immediately type a zero and no other inputs? 5. Otherwise, print the following a. b. c. The sum of all the inputs. The total number of inputs. The average of the inputs. i. Remember that the average is the sum over the total number of inputs The highest number input. d. e. The lowest number input. Example Inputs Below are five example runs of the program with the inputs and outputs. Remember, the graders will be testing your program against these as well as their own, so make sure you test these and come up with your own before submitting your program #1 Please type in a number. Type 0 to quit. You didn't type anything in. #2 Please type in a number. Type 0 to quit. Please type in a number. Type 0 to quit. -2 Please type in a number. Type -3 to quit. Please type in a number. Type 0 to quit. The sum of your inputs is: -6.0 The total number of inputs you provided was3 The average of your inputs is: -2.0 The highest number you input was: -1.0 The lowest number you input was: -3.0 #3 Please type in a number. Type 0 to quit. Please type in a number. Type 0 to quit. 2 Please type in a number. Type 0 to quit. 3 Please type in a number. Type 0 to quit. 4 Please type in a number. Type 0 to quit. Please type in a number. Type 0 to quit. Please type in a number. Type 0 to quit. 7 Please type in a number. Type 0 to quit. Please type in a number. Type 0 to quit Please type in a number. Type 0 to quit. 10 Please type in a number. Type 0 to quit. The sum of your inputs is: 55.0 The total number of inputs you provided was10 The average of your inputs is: 5.5 The highest number you input was: 10.0 The lowest number you input was: 1.0 #4 Please type in a number. Type 0 to quit. 42 Please type in a number. Type 0 to quit. -42 Please type in a number. Type 0 to quit. The sum of your inputs is: 0.0 The total number of inputs you provided was2 The average of your inputs is: 0.0 The highest number you input was: 42.0 The lowest number you input was: -42.8 Please type in a number. Type 0 to quit. 5.5 Please type in a number. Type 8 to quit. -9.3 Please type in a number. Type 0 to quit. 3.14159 Please type in a number. Type 0 to quit. The sum of your inputs is: -0.6584100000000008 The total number of inputs you provided was3 The average of your inputs is: -0.21947000000000828 The highest number you input was: 5.5 The lowest number you input was: -9.3 Submission Please submit your Assignment3 java file to the Assignment 3 link on Blackboard under the Assignments tab. You may submit as many times as you want prior to the due date, in case you later find and fix an error, but only the last one is graded
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
