Question: Write a program in JAVA to prompt for inputting an integer N, then enter N real numbers (a loop is needed), print the numbers user
Write a program in JAVA to prompt for inputting an integer N, then enter N real numbers (a loop is needed), print the numbers user entered, and the sum of all the positive numbers.
(1) Prompt for the user to input an integer and output the integer.
Enter an integer: You entered: 4
(2) Prompt for the user to input N real number, output the numbers entered and sum of all positive numbers
Enter an integer: You entered: 5 Enter 5 real numbers: You entered: 4.5 -3.0 -67.3 85.2 56.8 The sum of all positive numbers is 146.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
