1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GuDViN [60]
3 years ago
11

Create a class named student. a student has fields for an id number, number of credit hours earned, and number of points earned.

(for example, many schools compute grade point averages based on a scale of 4, so a three-credit-hour class in which a student earns an a is worth 12 points.) include methods to assign values to all fields. a student also has a field for grade point average. include a method to compute the grade point average field by dividing points by credit hours earned. write methods to display the values in each student field. save this class as student.java.
Computers and Technology
1 answer:
PIT_PIT [208]3 years ago
5 0

/****************

* Student.java *

****************/

public class Student

{

   int sid;

   int credithours;

   int points;

   double averagegrade;

 // constructor to assign initial values

   public Student() {

       this.sid = 9999;

       this.credithours = 3;

       this.points = 12;

   }

 // methods to assign values to all fields.

   public void setCredithours(int credithours) {

       this.credithours = credithours;

   }

   public void setPoints(int points) {

       this.points = points;

   }

   public void setSid(int sid) {

       this.sid = sid;

   }

 // method to compute the grade point average field by dividing points by credit hours earned.

   public void computeAveragegrade()

   {

       this.averagegrade = this.points / this.credithours;

   }

 // methods to display the values in each Student field

   public void showSid(){

       System.out.println("Student id is : " + this.sid);

   }

   public void showPoints(){

       System.out.println("Number of points earned : " + this.points);

   }

   public void showCredithours(){

       System.out.println("Number of credit hours earned : " + this.credithours);

   }

   public void showAveragegrade(){

       System.out.println("Average grade point is : " + this.averagegrade);

   }

}

You might be interested in
using a timer to generate a random number, develop a program that displays random numbers between 1 and 47 (or whatever) for you
mestny [16]

Answer:

Explanation:

The following code is written in Python. It creates a variable that detects the current time. Then it loops through a range of numbers and chooses the last random number after 2 seconds. Finally, it prints that number to the screen. This function can be called countless times depending on the number of state lottery numbers needed.

import random

import time

start_time = time.time()

while time.time() - start_time < 2:

   lottery_number = random.randint(0, 48)

print(lottery_number)

3 0
3 years ago
Keep true , never be ashamed of doing right decide on what you think is right and stick to it.
Doss [256]
This is the quote of T.S. Eilot
5 0
4 years ago
HELP URGENTLY!!!!!
Ganezh [65]
Which field TCP header is not typically used in modern networks
5 0
3 years ago
Besides the decimal number system that is most common (base 10), two other number systems that can be used in c++ programs are _
Paha777 [63]

Answer:

Binary number system

ASCII number system

Explanation:

C++ uses binary number system to define machine level language of the code written in high level languages and ASCII system to define the characters on key board for background low level coding an thus each character on the keyboard has a number associated with it to define it uniquely.

7 0
3 years ago
The process by which the kernel temporarily moves data from memory to a storage device is known as what?
Alona [7]

Answer: Swapping

Explanation:

Swapping is referred to as the process by which the kernel temporarily moves data from memory to a storage device.

Swapping is simply a memory management scheme whereby the process can be swapped temporarily from the main memory to the secondary memory in order for the main memory to be available for other processes. Swapping is used for memory utilization.

8 0
3 years ago
Other questions:
  • How many rows and columns does ms-excel 2007 have???
    10·1 answer
  • In a system using the relocatable dynamic partitions scheme, given the following situation (and using decimal form): Job Q is lo
    5·1 answer
  • 01010010 01100101 01100001 01101100 00100000 01101101 01110101 01110011 01101001 01100011 00100000 01110100 01101001 01101100 01
    5·2 answers
  • 8.5 question 2 edhesive
    11·1 answer
  • Create the tables and appropriate constraints based on the following ER diagram. Use appropriate data types. Note that the size
    7·1 answer
  • python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
    7·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    13·1 answer
  • Dynamic programming does not work if the subproblems: ___________
    5·1 answer
  • Explain the term information security?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!