Create a java class called Student to represent a Student exam grades. The class has four instance variables: A String variable for the name, and three double variables to store three exams grades for the student. Write a mutator method that takes four parameters—A String and three doubles. Use these parameters to initialize the instance variables declared earlier. Write a getAverage method that calculates and returns the average of the three exam grades. Write a separate program that creates 2 Student objects to hold the following data. First Name Exam#1 Exam#2 Exam#3 Ahmed 83.0 95.5 90.0 Kareema 75.25 83.0 89.0 Output the name and average grade for each of the above students.
Create a java class called Student to represent a Student exam grades. The class has four instance variables: A String variable for the name, and three double variables to store three exams grades for the student. Write a mutator method that takes four parameters—A String and three doubles. Use these parameters to initialize the instance variables declared earlier. Write a getAverage method that calculates and returns the average of the three exam grades. Write a separate program that creates 2 Student objects to hold the following data. First Name Exam#1 Exam#2 Exam#3 Ahmed 83.0 95.5 90.0 Kareema 75.25 83.0 89.0 Output the name and average grade for each of the above students.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 9E
Related questions
Question
Create a java class called Student to represent a Student exam grades. The class has four instance variables: A String variable for the name, and three double variables to store three exams grades for the student.
- Write a mutator method that takes four parameters—A String and three doubles. Use these parameters to initialize the instance variables declared earlier.
- Write a getAverage method that calculates and returns the average of the three exam grades.
- Write a separate program that creates 2 Student objects to hold the following data.
First Name |
Exam#1 |
Exam#2 |
Exam#3 |
Ahmed |
83.0 |
95.5 |
90.0 |
Kareema |
75.25 |
83.0 |
89.0 |
|
|
|
|
Output the name and average grade for each of the above students.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT