Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Create an object-oriented program that tracks your progress as a student in this class using 2 sources down below.The program should keep track of your name and your scores on graded activities in...

1 answer below »
Create an object-oriented program that tracks your progress as a student in this class using 2 sources
down below.The program should keep track of your name and your scores on graded activities in this
class. The scores on each test, each homework, and each final should be stored separately. The program
should allow a student to enter his or her name, a test score, a final exam score, and a homework
assignment score. Scores for tests and finals can range from 0 to 20 and homework scores can
ange from 0 to 2. Any time a user enters an invalid value that value will be ignored and will not
e saved.
Since this program is object-oriented it must be developed first as a class called Student. This
class should store name and the student scores as instance variables. There should be one
instance variable for each of the following: name, concept test 1, programming test 1, concept
test 2, programming test 2, homework 1, homework 2, homework 3, homework 4, homework 5,
homework 6, homework 7, homework 8, homework 9, homework 10, concept final, and
programming final. These instance variables should be made private to prevent invalid values
from being stored in them, but there should be ways to access and mutate these instance
variables using public methods. This class should also have a default constructor (no
parameters) setting the name to blank and making each of the other scores of the student set to 0.
The second part of this program should be developed in a class called StudentDemo. This class
will have a main method inside of it where an object of the Student class will be created. Then
the user will be given options to update their name or any of their scores. There should be an
option for each test, final, and homework. Finally there should an option to look at all the
information about the student. This main method should also have a loop to allow this program
to continue running until the user chooses the last option which is to exit the program. If the use
chooses an invalid option then an e
or message should be printed and the program should
continue running until the user chooses to exit the program.
Source 1:
import java.util.Scanner;
public class StudentDemo {
public static void main(String[] args) {
TODO Auto-generated method stu
Scanner keyboard = new Scanner(System.in);
Student me = new Student();
int option;
do {
System.out.println("Press 0 to change the name of the student");
System.out.println("Press 1 to change the score of Homework 1");
System.out.println("Press 2 to change the score of Homework 2");
System.out.println("Press 3 to change the score of Homework 3");
System.out.println("Press 4 to change the score of Homework 4");
System.out.println("Press 5 to change the score of Homework 5");
System.out.println("Press 6 to change the score of Homework 6");
System.out.println("Press 7 to change the score of Homework 7");
System.out.println("Press 8 to change the score of Homework 8");
System.out.println("Press 9 to change the score of Homework 9");
System.out.println("Press 10 to change the score of Homework
10");
System.out.println("Press 11 to change the score of Concept Test
1");
System.out.println("Press 12 to change the score of Programming
Test 1");
System.out.println("Press 13 to change the score of Concept Test
2");
System.out.println("Press 14 to change the score of Programming
Test 2");
System.out.println("Press 15 to change the score of Concept
Final");
System.out.println("Press 16 to change the score of Programming
Final");
System.out.println("Press 17 to look at of the student's
information");
System.out.println("Press 18 to end the program");
option = keyboard.nextInt();
keyboard.nextLine();
if(option == 0) {
System.out.println("Enter the name of the student");
String newName = keyboard.nextLine();
me.setName(newName);
}
else if(option == 1) {
System.out.println("Enter the score of Homework 1");
double newHomework1 = keyboard.nextDouble();
me.setHomework1(newHomework1);
}
else if(option == 2) {
System.out.println("Enter the score of Homework 2");
double newHomework2 = keyboard.nextDouble();
me.setHomework2(newHomework2);
}
else if(option == 3) {
System.out.println("Enter the score of Homework 3");
double newHomework3 = keyboard.nextDouble();
me.setHomework3(newHomework3);
}
else if(option == 4) {
System.out.println("Enter the score of Homework 4");
double newHomework4 = keyboard.nextDouble();
me.setHomework4(newHomework4);
}
else if(option == 5) {
System.out.println("Enter the score of Homework 5");
double newHomework5 = keyboard.nextDouble();
me.setHomework5(newHomework5);
}
else if(option == 6) {
System.out.println("Enter the score of Homework 6");
double newHomework6 = keyboard.nextDouble();
me.setHomework6(newHomework6);
}
else if(option == 7) {
System.out.println("Enter the score of Homework 7");
double newHomework7 = keyboard.nextDouble();
me.setHomework7(newHomework7);
}
else if(option == 8) {
System.out.println("Enter the score of Homework 8");
double newHomework8 = keyboard.nextDouble();
me.setHomework8(newHomework8);
}
else if(option == 9) {
System.out.println("Enter the score of Homework 9");
double newHomework9 = keyboard.nextDouble();
me.setHomework9(newHomework9);
}
else if(option == 10) {
System.out.println("Enter the score of Homework 10");
double newHomework10 = keyboard.nextDouble();
me.setHomework10(newHomework10);
}
else if(option == 11) {
System.out.println("Enter the score of Concept Test 1");
int newConceptTest1 = keyboard.nextInt();
me.setConceptTest1(newConceptTest1);
}
else if(option == 12) {
System.out.println("Enter the score of Programming Test
1");
int newProgrammingTest1 = keyboard.nextInt();
me.setProgrammingTest1(newProgrammingTest1);
}
else if(option == 13) {
System.out.println("Enter the score of Concept Test 2");
int newConceptTest2 = keyboard.nextInt();
me.setConceptTest2(newConceptTest2);
}
else if(option == 14) {
System.out.println("Enter the score of Programming Test
2");
int newProgrammingTest2 = keyboard.nextInt();
me.setProgrammingTest2(newProgrammingTest2);
}
else if(option == 15) {
System.out.println("Enter the score of Concept Final");
int newConceptFinal = keyboard.nextInt();
me.setConceptFinal(newConceptFinal);
}
else if(option == 16) {
System.out.println("Enter the score of Programming Final");
int newProgrammingFinal = keyboard.nextInt();
me.setProgrammingFinal(newProgrammingFinal);
}
else if(option == 17) {
System.out.println("The student's name is: " +
me.getName());
System.out.println("The student's homework 1 score is: " +
me.getHomework1());
System.out.println("The student's homework 2 score is: " +
me.getHomework2());
System.out.println("The student's homework 3 score is: " +
me.getHomework3());
System.out.println("The student's homework 4 score is: " +
me.getHomework4());
System.out.println("The student's homework 5 score is: " +
me.getHomework5());
System.out.println("The student's homework 6 score is: " +
me.getHomework6());
System.out.println("The student's homework 7 score is: " +
me.getHomework7());
System.out.println("The student's homework 8 score is: " +
me.getHomework8());
System.out.println("The student's homework 9 score is: " +
me.getHomework9());
System.out.println("The student's homework 10 score is: " +
me.getHomework10());
System.out.println("The student's concept test 1 score is:
" + me.getConceptTest1());
System.out.println("The student's programming test 1 score
is: " + me.getProgrammingTest1());
System.out.println("The student's concept test 2 score is:
" + me.getConceptTest2());
System.out.println("The student's programming test 2 score
is: " + me.getProgrammingTest2());
System.out.println("The student's concept final score is: "
+ me.getConceptFinal());
System.out.println("The student's programming final score
is: " + me.getProgrammingFinal());
}
else if(option == 18) {
System.out.println("Thank you for using this program");
}
else {
System.out.println("Invalid option.");
}
}while(option != 18);
}
}
Source 2:
public class Student {
instance variables
private String name;
private double homework1;
private double homework2;
private double homework3;
private double homework4;
private double homework5;
private double homework6;
private double homework7;
private double homework8;
private double homework9;
private double homework10;
private int conceptTest1;
private int conceptTest2;
private int conceptFinal;
private int programmingTest1;
private int programmingTest2;
private int programmingFinal;
default constructo
public Student() {
name = "";
homework1 = 0.0;
homework2 = 0.0;
homework3 = 0.0;
homework4 = 0.0;
homework5 = 0.0;
homework6 = 0.0;
homework7 = 0.0;
homework8 = 0.0;
homework9 = 0.0;
homework10 = 0.0;
conceptTest1 = 0;
conceptTest2 = 0;
conceptFinal = 0;
programmingTest1 = 0;
programmingTest2 = 0;
programmingFinal = 0;
}
non-static methods
public String getName() {
eturn name;
}
public void setName(String newName) {
name = newName;
}
public double getHomework1() {
eturn homework1;
}
public void setHomework1(double newHomework1) {
if(newHomework1 >= 0.0 && newHomework1 <= 2.0) {
homework1 = newHomework1;
}
}
public double getHomework2() {
eturn homework2;
}
public void setHomework2(double newHomework2) {
if(newHomework2 >= 0.0 && newHomework2 <= 2.0) {
homework2 = newHomework2;
}
}
public double getHomework3() {
eturn homework3;
}
public void setHomework3(double newHomework3) {
if(newHomework3 >= 0.0 && newHomework3 <= 2.0) {
homework3 = newHomework3;
}
}
public double getHomework4() {
eturn homework4;
}
public void setHomework4(double newHomework4) {
if(newHomework4 >= 0.0 && newHomework4 <= 2.0) {
homework4 = newHomework4;
}
}
public double getHomework5() {
eturn homework5;
}
public void setHomework5(double newHomework5) {
if(newHomework5 >= 0.0 && newHomework5 <= 2.0) {
homework5 = newHomework5;
}
}
public double getHomework6() {
eturn homework6;
}
public void setHomework6(double newHomework6) {
if(newHomework6 >= 0.0 && newHomework6 <= 2.0) {
homework6 = newHomework6;
}
}
public double getHomework7() {
eturn homework7;
}
public void setHomework7(double newHomework7) {
if(newHomework7 >= 0.0 && newHomework7 <= 2.0) {
homework7 = newHomework7;
}
}
public double getHomework8() {
eturn homework8;
}
public void setHomework8(double newHomework8) {
if(newHomework8 >= 0.0 && newHomework8 <= 2.0) {
homework8 = newHomework8;
}
}
public double getHomework9() {
eturn homework9;
}
public void setHomework9(double newHomework9) {
if(newHomework9 >= 0.0 && newHomework9 <= 2.0) {
homework9 = newHomework9;
}
}
public double getHomework10() {
eturn homework10;
}
public void setHomework10(double newHomework10) {
if(newHomework10 >= 0.0 && newHomework10 <= 2.0) {
homework10 = newHomework10;
}
}
public int getConceptTest1() {
eturn conceptTest1;
}
public void setConceptTest1(int newConceptTest1) {
if(newConceptTest1 >= 0 && newConceptTest1 <= 20)
conceptTest1 = newConceptTest1;
}
public int getProgrammingTest1() {
eturn programmingTest1;
}
public void setProgrammingTest1(int newProgrammingTest1) {
if(newProgrammingTest1 >= 0 && newProgrammingTest1 <= 20)
programmingTest1 = newProgrammingTest1;
}
public int getConceptTest2() {
eturn conceptTest2;
}
public void setConceptTest2(int newConceptTest2) {
if(newConceptTest2 >= 0 && newConceptTest2 <= 20)
conceptTest2 = newConceptTest2;
}
public int getProgrammingTest2() {
eturn programmingTest2;
}
public void setProgrammingTest2(int newProgrammingTest2) {
if(newProgrammingTest2 >= 0 && newProgrammingTest2 <= 20)
programmingTest2 = newProgrammingTest2;
}
public int getConceptFinal() {
eturn conceptFinal;
}
public void setConceptFinal(int newConceptFinal) {
if(newConceptFinal >= 0 && newConceptFinal <= 20)
conceptFinal = newConceptFinal;
}
public int getProgrammingFinal() {
eturn programmingFinal;
}
public void setProgrammingFinal(int newProgrammingFinal) {
if(newProgrammingFinal >= 0 && newProgrammingFinal <= 20)
programmingFinal = newProgrammingFinal;
}
}

Programming Test 1
Instructions
Students are allowed to use their ZyBook and the notes posted on Canvas as well as an IDE
(Integrated Development Environment) to complete this test. Students are not allowed to use any other
esources except those mentioned above. Students should also not communicate with any other person
about this test either before, during, or after taking the test. This test does not have a time limit, but it
does need to be turned by the deadline posted on Canvas. Tests that are not turned in by the deadline
are subject to the late penalty described in the syllabus.
Please make sure to only implement what is asked for. You may not add any instance variables
to any class, though you may create local variables inside of a method to accomplish its task. No other
methods should be created other than the ones listed here. You will lose points if you do not follow
these directions. The grading criteria is listed at end of the document.
Requirements Analysis
Create an object-oriented program that allows a user to keep track of the book they are cu
ently
eading. The program should allow the user to change the name of the book, change the number of
pages in the book, and the cu
ent page they are cu
ently on in the book. The number of pages in a
ook must be greater than 0 and also greater than or equal to the cu
ent page the reader is cu
ently on.
The cu
ent page must be greater than 0 and also less than or equal to number of pages in the book.
Any time a user enters an invalid value that value will be ignored and will not be saved.
Since this program is object-oriented it must be developed as a class called Book. This class
should store name of the book, the number of pages, and cu
ent page as instance variables. There
should be an instance variable for each these. These instance variables should be made private to
prevent invalid values from being stored in them, but there should be ways to access and mutate these
instance variables using public non-static methods. There should be a separate method to access each
instance variable. There should be a separate method to mutate each instance variable. This class
should also have a default constructor which sets name instance variable to No Name Yet and sets
number of pages instance variable to 0 and sets cu
ent page instance variable to 0.
The second part of this program should be developed in a class called BookDemo. This class
will have a main method inside of it where an object of the Book class will be created. Then the user
will be given options to update the name, number of pages, and the cu
ent page. There should be an
option for each of these. Finally, there should be an option to look at all the information about the
ook. This main method should also have a loop to allow this program to continue running until the
user chooses the last option which is to exit the program. If the user chooses an invalid option then an
e
or message should be printed to the screen. The program should continue executing until the user
chooses to exit the program.
Grading Criteria
The following is table for the point distribution for each of the two classes:
Book.java
Section Points
Constructor 1 point
Each instance variable
Answered Same Day Mar 21, 2023

Solution

Vikas answered on Mar 22 2023
32 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here