Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I. Description In this assignment, you will create a Java program to create an array of students to search. The program must implement a student

image text in transcribed
I. Description In this assignment, you will create a Java program to create an array of students to search. The program must implement a student class as specified in the following UML diagram. Student -name: String -id: int -pa: float > +Student(String, int, float) +pring Student():void +getIDO:int 1. The program will first ask the user to input the number of students to be created. The number should be from 1 to 10. Otherwise, the program prints "I cannot create xx students!" where xx is the input number 2. The program then prompts the user to input details of each student including name, id, and gpa. 3. You must create an array of Student in the main method. The size of the array is decided by the number of students the user gives. Each element of the array will refer to a Student object. 4. The main method will prompt user for each student. It then uses Student's constructor to create a Student object and assign it to an array element. 5. The Student class should have a constructor that takes a name, an id, and a gpa, to create a Student object. 6. The Student class should have a method printStudent that prints the student's name, id, and gpa, one per line. 7. After the creation of the Student objects, the program will then search the student array. It keeps asking the user for a student ID. If the student ID is 0, the program will print "Goodbye!" and exit. Otherwise, the program will search the student array for the given student ID. If a match is found, the program will call printStudent) to print the student information. If no match is found, the program prints "Student ID xxxx not found." 8. Since the student array may not be sorted, you should use linear search. 9. A sample run will look like this where the green texts are user inputs: How many students do you have(1-10): 4 Student 1 name: Anna Stomp Student 1 ID:1002 Student 1 GPA:2.3 Student 2 name: Elsa Ice Student 2 ID: 1084 Student 2 GPA: 3.2

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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

Gather internal and external data and prepare financial statements.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago