Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a java program that asks the user how many students they have in a classroom. Then, using a while loop, which asks the user

Create a java program that asks the user how many students they have in a classroom. Then, using a while loop, which asks the user to enter the grades (out of 100) for all students in the classroom, one at a time. Finally, the program should calculate the sum and average of the grades and print it out.

Sample Run1

Enter number of students: 3

Enter mark for student 1: 56

Enter mark for student 2: 45

Enter mark for student 3: 66

Output1: Sum = 167 and Average = 55.67

Sample Run2

Enter number of students: 6

Enter mark for student 1: 86

Enter mark for student 2: 15

Enter mark for student 3: 69

Enter mark for student 4: 77

Enter mark for student 5: 45

Enter mark for student 6: 90

Output2: Sum = 382 and Average = 63.67

P.S: Solutions for Both sample run in one Program.

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

Compare and contrast verbal and nonverbal codes

Answered: 1 week ago

Question

Define and discuss the nature of ethnocentrism and racism

Answered: 1 week ago

Question

Define and discuss racial and ethnic stereotypes across cultures

Answered: 1 week ago