Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part (1) Define a class as follow: a. create a class called Student that has four instance variables - a (String) name, a (long) StudentID,

image text in transcribed
Part (1) Define a class as follow: a. create a class called Student that has four instance variables - a (String) name, a (long) StudentID, a (String) College, and a double) GPA. b. A constructor that takes student name, StudentID, College and GPA. The constructor sets the class variables to these values. C. Make the instance variable GPA private and provide a mutator method (set) and an accessor method (get) to access this variable. In set method if the GPA negative or grater than 4.00 print an invalid message and do not change the instance variable GPA. d. A method Student_Status () that check the GPA if it is less than 2, display the warning message, otherwise display Normal student. e. A method Print() that displays the name, StudentID, College and GPA of the student as shown below: Sample output: Enter the Student name: Ali Ahmed Enter the Student ID: 20180011 Enter the College: Information Technology Enter the GPA: 3.2 Normal student Name: Ali Ahmed Student ID: 20180011 College: Information Technology GPA: 3.2 Part (2) Write a java application that asks the user to enter the Student name, StudentID, College and GPA. Create an object of type Student class you defined in part (1) and set its parameters according to the input data from the user, check the Student_Status then print all the Student information

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

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions