Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

2. List the advantages of listening well

Answered: 1 week ago