Java Programming Assignment - University Name: Exam Class Analysis

Verified

Added on  2023/04/22

|3
|289
|374
Homework Assignment
AI Summary
This Java programming assignment solution focuses on the design and implementation of an Exam class. The program utilizes a 2D array to store student marks for different tasks, employing nested loops to process the data. It reads data for the fourth subject, calculates the total marks for each student, and computes the average marks for each task. The solution includes conditional statements to validate user input, ensuring the marks fall within the specified range. The document provides initial data, expected outputs, and actual outputs, demonstrating the program's functionality. The program's design is centered around a main() method within the Exam class, effectively managing the program's logic and data processing. The testing section includes expected and actual outputs, which validates the correctness of the program's calculations and the implementation of the Exam class.
Document Page
Running head: JAVA PROGRAMMING
Java Programming
Name of the student:
Name of the University:
Author note:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
JAVA PROGRAMMING
Design
The program has been designed using a single class by the name of Exam. The class
has a main() method that beholds the complete logic of the program. The program loads in all
the necessary data into a 2-D Array. The rows in the 2-d array represents the data for each
student, whereas the columns are the tasks. Each cell holds the marks for the respective
student and the task.
The program iterates over the matrix using a nested for loop structure. Using this
technique the program has been modified to read in the data for the 4th subject, then calculate
the total for each student and then the average marks obtained by various students in each
task. The program has also been modified using conditional statements to check if the value
entered by the user is invalid based on the maximum and minimum mark range.
Testing
Initial data loaded:
Student 1: 9.5 18.0 25.5
Student 2: 9.0 19.0 20.0
Student 3: 5.0 12.5 18.0
Student 4: 8.5 16.0 22.0
Student 5: 7.0 11.0 25.0
Marks entered for task-4: 35 25 26 34 26
Expected Total of each student:
Student 1: 88.00
Student 2: 73.00
Document Page
2
JAVA PROGRAMMING
Student 3: 61.50
Student 4: 80.50
Student 5: 69.00
Actual Output:
Expected Average of each task:
Average task 1: 7.80
Average task 2: 15.30
Average task 3: 22.10
Average task 4: 29.20
Actual Output:
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]