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:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
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
Transcribed Image 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
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage