MINDTAPV2.0 JAVA PROGRAMMING 2021, 1TERM
MINDTAPV2.0 JAVA PROGRAMMING 2021, 1TERM
9th Edition
ISBN: 9780357505526
Author: FARRELL
Publisher: CENGAGE L
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 3, Problem 12PE

Explanation of Solution

a.

Program code:

Student.java

//define a class Student

class Student

{

//declare the class members

private String ID;

private int numberOfCredits;

private int points;

private double gradePoint;

//define the constructor

public Student()

{}

//define the constructor

public Student(String aID, int aNumberOfCredits, int aPoints)

{

//initialize the class members

super();

ID = aID;

numberOfCredits = aNumberOfCredits;

points = aPoints;

//call the method calculateGradePoint()

calculateGradePoint();

}

//define the method getID()

public String getID()

{

//return the value of ID

return ID;

}

//define the method setID()

public void setID(String aID)

{

//set the value of ID

ID = aID;

}

//define the method getNumberOfCredits()

public int getNumberOfCredits()

{

//return the value of numberOfCredits

return numberOfCredits;

}

//define the method setNumberOfCredits()

public void setNumberOfCredits(int aNumberOfCredits)

{

//set the value of numberOfCredits

numberOfCredits = aNumberOfCredits;

}

//define the method getPoints()

public int getPoints()

{

//return the value of points

return points;

}

//define the method setPoints()

public void setPoints(int aPoints)

{

//set the value of points

points = aPoints;

}

//define the method toString()

public String toString()

{

//return the value

return "ID : " + ID + " NumberOfCredits : " + numberOfCredits + " Points : " + points+" Grade Point : "+gradePoint;

}

//define the method calculateGradePoint()

public void calculateGradePoint()

{

//calculate the value of gradePoint

gradePoint=points/(double)numberOfCredits;

}

}

Explanation:

The above snippet of code is used create a class “Student”. The class contain different static methods for store the details of a student. In the code,

  • Define a class “Student”
    • Define the constructor “Student ()” method.
    • Define the constructor “Student ()” method.
      • Initialize the class members.
      • Call the method “calculateGradePoint()”.
    • Define the “getID()” method.
      • Return the value of the variable “ID”.
    • Define the “setID()” method.
      • Set the value of the variable “ID”.
    • Define the “getNumberOfCredits()” method.
      • Return the value of the variable “NumberOfCredits”...

Blurred answer
Students have asked these similar questions
This is a question that I have and would like someone who has experiences with scene graphs and entity component systems to answer.For context, I am currently implementing a game engine and currently I am debating on our current design.Our current design is we have a singular game component class that every component inherits from. Where we have components like SpriteRendererComponent, Mehs Component, etc. They inherit from this GameComponent class. The point of this is being able to have O(1) access to the scene to being able to modify components to attach more components with the idea of accessing those components to specific scene objects in a scene.Now, my question is what kinds of caveauts can this cause in terms of cache coherence? I am well aware that yes its O(1) and that is great but cache coherence is going to be really bad, but would like to know more explicit details and real-life examples such as write in RAM examples on how this is bad. A follow-up question that is part…
Q4: Consider the following MAILORDER relational schema describing the data for a mail order company. (Choose five only). PARTS(Pno, Pname, Qoh, Price, Olevel) CUSTOMERS(Cno, Cname, Street, Zip, Phone) EMPLOYEES(Eno, Ename, Zip, Hdate) ZIP CODES(Zip, City) ORDERS(Ono, Cno, Eno, Received, Shipped) ODETAILS(Ono, Pno, Qty) (10 Marks) I want a detailed explanation to understand the mechanism how it is Qoh stands for quantity on hand: the other attribute names are self-explanatory. Specify and execute the following queries using the RA interpreter on the MAILORDER database schema. a. Retrieve the names of parts that cost less than $20.00. b. Retrieve the names and cities of employees who have taken orders for parts costing more than $50.00. c. Retrieve the pairs of customer number values of customers who live in the same ZIP Code. d. Retrieve the names of customers who have ordered parts from employees living in Wichita. e. Retrieve the names of customers who have ordered parts costing less…
Q4: Consider the following MAILORDER relational schema describing the data for a mail order company. (Choose five only). (10 Marks) PARTS(Pno, Pname, Qoh, Price, Olevel) CUSTOMERS(Cno, Cname, Street, Zip, Phone) EMPLOYEES(Eno, Ename, Zip, Hdate) ZIP CODES(Zip, City) ORDERS(Ono, Cno, Eno, Received, Shipped) ODETAILS(Ono, Pno, Qty) Qoh stands for quantity on hand: the other attribute names are self-explanatory. Specify and execute the following queries using the RA interpreter on the MAILORDER database schema. a. Retrieve the names of parts that cost less than $20.00. b. Retrieve the names and cities of employees who have taken orders for parts costing more than $50.00. c. Retrieve the pairs of customer number values of customers who live in the same ZIP Code. d. Retrieve the names of customers who have ordered parts from employees living in Wichita. e. Retrieve the names of customers who have ordered parts costing less than$20.00. f. Retrieve the names of customers who have not placed…
Knowledge Booster
Background pattern image
Computer Science
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
  • Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY