SBM4103 - Applied Project 1: Student Grade Calculation in Java

Verified

Added on  2022/10/15

|10
|1153
|103
Project
AI Summary
This document presents a Java program designed to calculate student grades based on weighted assessments: Quiz, Mid-Semester, Applied Project, and Final Test. The program takes input for each assessment, validates the input to ensure it is within the range of 0-100, and then calculates the final mark using a predefined formula. The final mark is then used to assign a letter grade according to a specified grading scheme (A, B, C, D, or F). The program utilizes the BlueJ platform and includes a detailed discussion of the algorithm, code logic, and expected outputs. The assignment also includes an algorithm for the code and sample outputs to demonstrate the program's functionality and correct execution. The document concludes with a brief conclusion and references used. This is a solution to the Applied Project 1 assignment for the SBM4103 course at Asia Pacific International College.
Document Page
Running head: ASSESSMENT 2: APPLIED PROJECT- 1
ASSESSMENT 2: APPLIED PROJECT- 1
Name of Student:
Name of 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
1ASSESSMENT 2: APPLIED PROJECT- 1
Table of Contents
Introduction:...............................................................................................................................3
Question:................................................................................................................................3
Discussion:.................................................................................................................................4
Algorithm for the code:..........................................................................................................5
Output 1:.................................................................................................................................7
Output 2:.................................................................................................................................8
Output 3:.................................................................................................................................8
Conclusion:................................................................................................................................9
Document Page
2ASSESSMENT 2: APPLIED PROJECT- 1
Introduction:
Blue J platform has been used to write this java program, which is a free development
java platform which is best for java programming for academic purpose and to build small
scale software.
Question:
Write a Java program that accept N student’s marks: Quiz(Q) test, Mid-Semester (MS),
Applied Project (AP) and Final test (FT). The weight for each assessment is shown in Table
(1) as follows:
Table 1: Assessment Overview
The final mark can be calculated as:
Final Mark (FM)=0.1*(Q)+0.2*(MS)+0.4*(AP)+0.3*(FT)
Document Page
3ASSESSMENT 2: APPLIED PROJECT- 1
The program should calculate final marks and display the letter grade that is assigned for the
final mark. Use the grading scheme in Table 2.
Final Mark (FM) Letter Grade 90-100 A 80-89 B 70-79 C 60-69 D Below 60 F Table 2:
Grading Scheme
Your program should also be able to check the sanity of inputs e.g. values in Q, MS, AP, and
FT have to be between 0 and 100. If any one of them fails this criteria, the program should
display an error message on the screen.
Discussion:
The program requires to accept ‘n’ number of students in mentioned four subjects
hence, a loop has been generated to accept ‘n’ number of students after initializing the
variables. Moreover, to scan the taken inputs Scanner class object has been created,
‘sc.nextDouble()’ which will scan every input.
Then input for every subject has been taken for which scanning the values is required.
Most importantly, for every variable declared type is ‘Double’ for making it accept any float
value.
The percentage of weight for every subject has to be determined according to the
question. For Quiz it is 10%, for the Mid Semester test it is 20%, for Applied Project it is
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
4ASSESSMENT 2: APPLIED PROJECT- 1
40% and for the Final test, it is 30%. The variables that have been declared for Quiz , Mid
Semester Test, Applied Project and Final Test are Q,MS, AP, FT respectively in which the
values for respect subject will be assigned according to the user. And for Final Marks, FM is
used which will be calculated.
Hence, the formula that has been applied is (0.1*Q) to calculate the percentage of the
quiz part, the value for the applied formula has been assigned to the variable ‘wq’. Similarly,
the percentages of the other subjects have been assigned to different variables. For the
percentage of Mid Semester Test (0.2*MS) is applied that has been assigned to ‘wms’.
Formula, ‘wap=(0.4*AP)’ is for the percentage of Applied Project and for final test the
formula is ‘wft=(0.3*FT)’ .
There is a particular condition for the Number range i.e. 0-100 for accepting marks. If
the marks for the subjects provided by the user is below 0 or above 100 then error will
interrupt and have to re-enter the marks of correct range.
Then the final marks of the student are calculated by adding the weightage of the
respective four subjects. Then student’s grade system has been designed according to the
marks. If the final marks is between 90 to 100 then it will print grade ‘A’, if it is between 80
to 89 then it will print grade ‘B’, if it is between 79 to 70 then it will print grade ‘C’, if it is
between 69 to 60 then it will print grade ‘D’ and if it is below 60 then it will print grade ‘F’
that means Fail.
Algorithm for the code:
Step1: Start
Step2: Declare variables Q, MS, AP, FT, FM=0.
Step3: Read the values of ‘int numStu’ for the number of students.
Document Page
5ASSESSMENT 2: APPLIED PROJECT- 1
Step4: define for loop, for(int i = 0; i <= numStu; i++).
Step5: Read the marks for the subjects Q, MS, AP, FT.
Step6: While condition for each statement of accepting marks as, while(Q< 0 || Q>100) to
check the number range is between 0-100.
Step7: Calculate the percentage for each variable i.e. Q, MS, AP, FT.
Step8: Percentage, wq=0.1*(Q),
Wms=0.2*(MS),
Wap=0.4*(AP),
Wft=0.3*(FT).
Step9: Final Marks, FM=WQ+WMS+WAP+WFT.
Step10: if(FM>=90 && FM<=100)
Print grade A.
else if(FM>=80 && FM<=89)
Print grade B.
else if(FM<=79 && FM>=70)
Print grade C.
else if(FM<=69 && FM>=60)
Print grade D.
else if(FM<60)
Print grade F.
Document Page
6ASSESSMENT 2: APPLIED PROJECT- 1
Step11: Display weightage for each variable Q, MS, AP, FT, Final marks and Grade.
Step 12: Stop.
Output 1:
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
7ASSESSMENT 2: APPLIED PROJECT- 1
Output 2:
Output 3:
Document Page
8ASSESSMENT 2: APPLIED PROJECT- 1
Conclusion:
The code has been implemented efficiently according to the mentioned criteria. With
the proper formulas essential parts of the code has been calculated hence, giving correct
output as shown above. The code has been compiled with no syntax errors by running with
two three test cases. And every test cases have passed with proper condition checking if the
number is out of range. Required print statements has been used for proper output
accordingly.
Document Page
9ASSESSMENT 2: APPLIED PROJECT- 1
References:
Bloch, J., 2016. Effective java. Pearson Education India.
McFadyen, R., 2016. Java with BlueJ. Ron McFadyen, University of Winnipeg.
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]