Question
Basically I have to Write a class called Student. the class must have the following data members: **Number of Students **First Name ** Last Name
Basically I have to Write a class called Student. the class must have the following data members: **Number of Students **First Name ** Last Name **College ID ** GPA **Venus Login ID Remember to name them appropriately and use lower camel case. eg. First Name = firstName. b) Write a constructor for your class that accepts all the values listed above and initialize your object appropriately. Your constructor needs to increment the static value Number of Students each time an instantiation occurred so that you can keep track of the students at any given time. c) Write a static method that will return the number of students. d) Write a method called getGPA that will return the students GPA. e) Write a Boolean method called isValidVenusLogin to check that what they entered is actually a valid Venus login. As you recall, the Venus login has to be in this format: lafi1234 (First two characters of your last name, first two characters of your first name and your last 4 digits of your College ID). Hint: Use the Java String API to achieve this. f) Write a print method called displayAttributes that will output all non-static attribute values. So, for example, you should have something like this: System.out.println(Student Name: + First Name + + Last Name); System.out.println(GPA: + GPA); g) Create an array of type Student with n objects inside your main. (Use JOptionPane to ask user to tell you how many Student objects you need to instantiate.) h) Iterate through the array and use proper constructor to instantiate and populate values for each of your student. i) Use Math.random() to select from a list of predetermined array values dynamically to select a name for each student. For example, you would have an array called firstNames that has the values {Bob, Mary, Peter} and lastNames = {Peterson, Reich, Jackson} etc. Randomly select the first name and last names for each student during your instantiation as well as for your GPA, College ID, and Venus Login. j) Iterate through the array of objects and call the isValidVenusLogin method to display whether each students Venus Login is valid using this format: Student
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started