logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write java program that reads a number of students and then let the user enter their names and ages and count them.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assignment 3 Loops

 

Ex1:

Write java program that reads a number of students and then let the user enter their names and ages and count them. The program should check if the age of the student is below 20 years old, otherwise, the student will not be counted.

Your program should display the total number of students under the age of 20.

 

Sample run:

Enter the number of students: 25 Enter the student's name: Khaled Ali Enter the student's age: 23

….

Total number of students under age 20:

 

 

Ex2:

Write a Java program that reads an unlimited number of items and their prices until the user enters "Exit", after that the program should print out the total bill.

 

Sample run:

Enter item: pen 5 Enter item: book 26

..

..

Enter item: Exit Total bill:

 

Ex3:

Write a Java program that reads 10 integers and then displays the maximum, minimum, and average numbers.

 

Sample run:

Please input 10 integers: 10 20  30 40 50  -10 -20 -30  -40 -50

Max: 50

Min: -50

Average: 0.0

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

624 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

928 Answers

Hire Me
expert
Husnain SaeedComputer science

563 Answers

Hire Me
expert
Atharva PatilComputer science

898 Answers

Hire Me

Get Free Quote!

341 Experts Online