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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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