Plz rearrange the code so that it works Step 1 We will solve the given problem in Java language. arrow_forward Step 2 CODE (Student.java) public class Student { private int studentNumber; private int test; private int assignment; private int exam; public Student(int studentNumber, int test, int assignment, int exam) { this.studentNumber = studentNumber; this.test = test; this.assignment = assignment; this.exam = exam; } public int getStudentNumber() { return this.studentNumber; } public void setStudentNumber(int studentNumber) { this.studentNumber = studentNumber; } public int getTest() { return this.test; } public void setTest(int test) { this.test = test; } public int getAssignment() { return this.assignment; } public void setAssignment(int assignment) { this.assignment = assignment; } public int getExam() { return this.exam; } public void setExam(int exam) { this.exam = exam; } } arrow_forward Step 3 CODE (Student_Report.java) public class Student_Report extends Student{ public Student_Report(int studentNumber, int test, int assignment, int exam) { super(studentNumber, test, assignment, exam); } public void print_report(){ System.out.println("\nResult of student number "+getStudentNumber()+" is \n"); double testFinal = getTest() * 0.25; double assignmentFinal = getAssignment() * 0.25; double examFinal = getExam() * 0.5; System.out.println("Assessment\tWeighting"); System.out.println("Test\t\t25% = "+testFinal); System.out.println("Assignment\t25% = "+assignmentFinal); System.out.println("Exam\t\t50% = "+examFinal); System.out.println("Final Result = "+(testFinal+assignmentFinal+examFinal)); } @Override public int getStudentNumber() { return super.getStudentNumber(); } @Override public void setStudentNumber(int studentNumber) { super.setStudentNumber(studentNumber); } @Override public int getTest() { return super.getTest(); } @Override public void setTest(int test) { super.setTest(test); } @Override public int getAssignment() { return super.getAssignment(); } @Override public void setAssignment(int assignment) { super.setAssignment(assignment); } @Override public int getExam() { return super.getExam(); } @Override public void setExam(int exam) { super.setExam(exam); } } arrow_forward Step 4 CODE (Main.java) public class Main { public static void main(String[] args) { Student_Report student1 = new Student_Report(121,100,100,100); student1.print_report(); Student_Report student2 = new Student_Report(122,98,67,78); student2.print_report();
Plz rearrange the code so that it works Step 1 We will solve the given problem in Java language. arrow_forward Step 2 CODE (Student.java) public class Student { private int studentNumber; private int test; private int assignment; private int exam; public Student(int studentNumber, int test, int assignment, int exam) { this.studentNumber = studentNumber; this.test = test; this.assignment = assignment; this.exam = exam; } public int getStudentNumber() { return this.studentNumber; } public void setStudentNumber(int studentNumber) { this.studentNumber = studentNumber; } public int getTest() { return this.test; } public void setTest(int test) { this.test = test; } public int getAssignment() { return this.assignment; } public void setAssignment(int assignment) { this.assignment = assignment; } public int getExam() { return this.exam; } public void setExam(int exam) { this.exam = exam; } } arrow_forward Step 3 CODE (Student_Report.java) public class Student_Report extends Student{ public Student_Report(int studentNumber, int test, int assignment, int exam) { super(studentNumber, test, assignment, exam); } public void print_report(){ System.out.println("\nResult of student number "+getStudentNumber()+" is \n"); double testFinal = getTest() * 0.25; double assignmentFinal = getAssignment() * 0.25; double examFinal = getExam() * 0.5; System.out.println("Assessment\tWeighting"); System.out.println("Test\t\t25% = "+testFinal); System.out.println("Assignment\t25% = "+assignmentFinal); System.out.println("Exam\t\t50% = "+examFinal); System.out.println("Final Result = "+(testFinal+assignmentFinal+examFinal)); } @Override public int getStudentNumber() { return super.getStudentNumber(); } @Override public void setStudentNumber(int studentNumber) { super.setStudentNumber(studentNumber); } @Override public int getTest() { return super.getTest(); } @Override public void setTest(int test) { super.setTest(test); } @Override public int getAssignment() { return super.getAssignment(); } @Override public void setAssignment(int assignment) { super.setAssignment(assignment); } @Override public int getExam() { return super.getExam(); } @Override public void setExam(int exam) { super.setExam(exam); } } arrow_forward Step 4 CODE (Main.java) public class Main { public static void main(String[] args) { Student_Report student1 = new Student_Report(121,100,100,100); student1.print_report(); Student_Report student2 = new Student_Report(122,98,67,78); student2.print_report();
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Plz rearrange the code so that it works
Step 1
We will solve the given problem in Java language.
arrow_forward
public class Student {
private int studentNumber;
private int test;
private int assignment;
private int exam;
public Student(int studentNumber, int test, int assignment, int exam) {
this.studentNumber = studentNumber;
this.test = test;
this.assignment = assignment;
this.exam = exam;
}
public int getStudentNumber() {
return this.studentNumber;
}
public void setStudentNumber(int studentNumber) {
this.studentNumber = studentNumber;
}
public int getTest() {
return this.test;
}
public void setTest(int test) {
this.test = test;
}
public int getAssignment() {
return this.assignment;
}
public void setAssignment(int assignment) {
this.assignment = assignment;
}
public int getExam() {
return this.exam;
}
public void setExam(int exam) {
this.exam = exam;
}
}
Step 2
CODE (Student.java)
public class Student {
private int studentNumber;
private int test;
private int assignment;
private int exam;
public Student(int studentNumber, int test, int assignment, int exam) {
this.studentNumber = studentNumber;
this.test = test;
this.assignment = assignment;
this.exam = exam;
}
public int getStudentNumber() {
return this.studentNumber;
}
public void setStudentNumber(int studentNumber) {
this.studentNumber = studentNumber;
}
public int getTest() {
return this.test;
}
public void setTest(int test) {
this.test = test;
}
public int getAssignment() {
return this.assignment;
}
public void setAssignment(int assignment) {
this.assignment = assignment;
}
public int getExam() {
return this.exam;
}
public void setExam(int exam) {
this.exam = exam;
}
}
arrow_forward
public class Student_Report extends Student{
public Student_Report(int studentNumber, int test, int assignment, int exam) {
super(studentNumber, test, assignment, exam);
}
public void print_report(){
System.out.println("\nResult of student number "+getStudentNumber()+" is \n");
double testFinal = getTest() * 0.25;
double assignmentFinal = getAssignment() * 0.25;
double examFinal = getExam() * 0.5;
System.out.println("Assessment\tWeighting");
System.out.println("Test\t\t25% = "+testFinal);
System.out.println("Assignment\t25% = "+assignmentFinal);
System.out.println("Exam\t\t50% = "+examFinal);
System.out.println("Final Result = "+(testFinal+assignmentFinal+examFinal));
}
@Override
public int getStudentNumber() {
return super.getStudentNumber();
}
@Override
public void setStudentNumber(int studentNumber) {
super.setStudentNumber(studentNumber);
}
@Override
public int getTest() {
return super.getTest();
}
@Override
public void setTest(int test) {
super.setTest(test);
}
@Override
public int getAssignment() {
return super.getAssignment();
}
@Override
public void setAssignment(int assignment) {
super.setAssignment(assignment);
}
@Override
public int getExam() {
return super.getExam();
}
@Override
public void setExam(int exam) {
super.setExam(exam);
}
}
Step 3
CODE (Student_Report.java)
public class Student_Report extends Student{
public Student_Report(int studentNumber, int test, int assignment, int exam) {
super(studentNumber, test, assignment, exam);
}
public void print_report(){
System.out.println("\nResult of student number "+getStudentNumber()+" is \n");
double testFinal = getTest() * 0.25;
double assignmentFinal = getAssignment() * 0.25;
double examFinal = getExam() * 0.5;
System.out.println("Assessment\tWeighting");
System.out.println("Test\t\t25% = "+testFinal);
System.out.println("Assignment\t25% = "+assignmentFinal);
System.out.println("Exam\t\t50% = "+examFinal);
System.out.println("Final Result = "+(testFinal+assignmentFinal+examFinal));
}
@Override
public int getStudentNumber() {
return super.getStudentNumber();
}
@Override
public void setStudentNumber(int studentNumber) {
super.setStudentNumber(studentNumber);
}
@Override
public int getTest() {
return super.getTest();
}
@Override
public void setTest(int test) {
super.setTest(test);
}
@Override
public int getAssignment() {
return super.getAssignment();
}
@Override
public void setAssignment(int assignment) {
super.setAssignment(assignment);
}
@Override
public int getExam() {
return super.getExam();
}
@Override
public void setExam(int exam) {
super.setExam(exam);
}
}
arrow_forward
public class Main {
public static void main(String[] args) {
Student_Report student1 = new Student_Report(121,100,100,100);
student1.print_report();
Student_Report student2 = new Student_Report(122,98,67,78);
student2.print_report();
}
}
Step 4
CODE (Main.java)
public class Main {
public static void main(String[] args) {
Student_Report student1 = new Student_Report(121,100,100,100);
student1.print_report();
Student_Report student2 = new Student_Report(122,98,67,78);
student2.print_report();
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
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
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education