Create a student class to hold student data

Assignment Help Computer Engineering
Reference no: EM132155926

1. For this exercise, you will create a Student class to hold student data. In previous exercises, we had a requirement that you name your class Main. In this exercise, you must name your class Student.

Your Student class should include the following information: first name, last name, grade level, GPA, and a student id. Grade level is an integer value ranging from 0 to 12, with 0 representing kindergarten. GPA is a decimal value ranging from 0 to 4.5. Student id is an integer value.

The first student id is 1, the second student id is 2, the next is 3, and so on. When a new Student is created, your code should automatically initialize student id to the next integer value. For example, if the last created Student's student id is 17, the next student id generated should be 18.

Your student class should include the following methods:

Student() - Constructs a new student with first name and last name set to "None", grade level set to 0 and GPA set to 0.0. The student id should automatically be set to the next integer.

Student(String firstName, String lastName, int gradeLevel, double gpa) - Constructs a new student with variables initialized to the values specified.

The grade level should only be allowed to range between 0 and 12 inclusive, 0 represents kindergarten. Otherwise, set the grade level to 0. The GPA should only be allowed to range from 0.0 to 4.5, inclusive. Otherwise, set the GPA to 0.0. The student id should automatically be set to the next integer.

String toString() - Returns the student information as a String in the following format (notice line breaks after the first name and GPA):

Dovi, Mrs GPA: 4.0 Grade Level: 7 id # 4

To test your code prior to submission, download the runner class student_runner_Student.java to the same folder that holds your Student.java implementation. Run student_runner_Student.main class and verify that the output matches the sample run below. Please feel free to change the runner to test different values to make sure your program fits the requirements. We will use a similar runner class to grade the program.

Sample Run

None, None GPA: 0.0 Grade Level: 0 id # 1 None, None GPA: 0.0 Grade Level: 0 id # 2 None, None GPA: 0.0 Grade Level: 0 id # 3 Dovi, Mrs. GPA: 3.4 Grade Level: 7 id # 4

When you are done coding and testing, copy and paste your entire Student class into the Code Runner and press "Run" to submit the exercise. Use the "Check Answer" button to get additional feedback on your work.

Reference no: EM132155926

Questions Cloud

Use diagonalization to prove that the set consisting : Use diagonalization to prove that the set consisting of all infinite-length binary strings is uncountable.
Effectiveness of two pain relief medicines for headaches : Researchers are testing the effectiveness of two pain relief medicines for headaches.
Is there currently a deadlock condition : Suppose you have two processes, P1 and P2, and below are there current allocation (C) and request matrices .
Could colonial adventure tours upgrade to the dbms : Use computer magazines and/or the internet to investigate one of these DBMSs: DB2, SQL Server, MySQL, Oracle, or Sybase.
Create a student class to hold student data : Create a Student class to hold student data. In previous exercises, we had a requirement that you name your class Main.
Repeated measures or matched pairs : State the degrees of freedom and the type of test (repeated measures or matched pairs) for the following examples of measures for a related samples t test:
Confidence interval for the population proportion : In a survey of 3135 adults, 1438 say they have started paying bills online in the last year.
Determine the optimal product mix for a package : The liver flavored biscuits contain 1 unit of nutrient A and 2 units of nutrient B; the chicken flavored biscuits contain 1 unit of nutrient
Mean residual life of a continuous survival time : Suppose that the mean residual life of a continuous survival time X is given by MRL(x) = x + 10.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Why is it significant to define the primary keys of a file

your supervisor has approved your normalized versions of the database. your team members were given copies. one of the

  What are your impressions of the noun technique

Create a UML class diagram using the classes you have identified and add names to the associations and multiplicity constraints. What are your impressions of the noun technique?

  Calculate the average waiting time for each algorithm

FCFS, nonpreemptive SJF, nonpreemptive priority and calculate the average waiting time for each algorithm.

  What can be done to minimize the errors

Where are the majority of defects found in a final program introduced? What can be completed to minimize these errors.

  Write a one-liner that prints all lines of a file

Write a one-liner that prints all lines of a file, preceded by its line number and with the tab as delimiter.

  Write down a c program that has a declaration in main()

Modify this restaurant() function to alter the address in message. usage the expression *menu rather than *(menu + i) to retrieve the correct element.

  What is the global cpi of each implementation

Which implementation of P1 and P2 is faster? What is the global CPI of each implementation?

  Difference between packet-filter firewalls and proxy filters

Explain at least two (2) differences between packet-filter firewalls and proxy filters. Provide one (1) example of a situation where you might.

  How can we determine a maximal spanning tree in a network

The topological sorting functions as presented in the text are deficient in error checking. How can we determine a maximal spanning tree in a network?

  Develop the fully developed mean velocity profile

Using the methodology developed in the text for a circular pipe, develop the fully developed mean velocity profile and fully developed friction coefficient.

  What are the disadvantages of shared hosting

What are the disadvantages of shared hosting? What is the difference between collocated hosting and dedicated hosting? How many sites can be hosted on the same server?

  Implement a prototype

KIT205 Data Structures and Algorithms - Assignment 1: Data Structures Implement basic program functionality for a console driven application - Implement and test a linked list to store years

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd