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...


Part (1) Define a class as follow:<br>a. create a class called Student that has four instance variables - a (String) name, a (long)<br>StudentID, a (String) College, and a (double) GPA.<br>b. A constructor that takes student name, StudentID, College and GPA. The constructor<br>sets the class variables to these values .<br>c. Make the instance variable GPA private and provide a mutator method (set) and an<br>accessor method (get) to access this variable. In set method if the GPA negative or<br>grater than 4.00 print an invalid message and do not change the instance variable GPA.<br>d. A method Student_Status () that check the GPA if it is less than 2, display the warning<br>message, otherwise display Normal student.<br>e. A method Print() that displays the name, StudentiD, College and GPA of the student as<br>shown below:<br>Sample output:<br>Enter the Student name:<br>ALİ Ahmed<br>Enter the Student ID:<br>20180011<br>Enter the College:<br>Information Technology<br>Enter the GPA:<br>3.2<br>Normal student<br>Name: Ali Ahmed<br>Student ID: 2018ee11<br>College: Information Technology<br>GPA: 3.2<br>

Extracted text: 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: ALİ Ahmed Enter the Student ID: 20180011 Enter the College: Information Technology Enter the GPA: 3.2 Normal student Name: Ali Ahmed Student ID: 2018ee11 College: Information Technology GPA: 3.2

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here