.QUESTION
Java using Eclipse IDE for Java developers
Assignment 3
Before attempting this project, be sure you have completed all of the reading assignments, non-graded exercises, discussions, and assignments to date.
Write a Java program to calculate student’s final course grade. The program should:
(1) Prompt and read user’s input for the student’s name, assignment 1 grade (A1), assignment 2 grade (A2), exam grade (EX), and participation grade (P). User Scanner to read input.
(2) Each grade input should be 0-100 and the final grade should be calculated as follows: A1*0.25+A2*0.25+EX*0.4+P*0.1
(3) Output the student’s information and the calculated course grade
(4) prompt user whether they want to calculate grade for another student and repeat the input/output processing
(5) Allow user to exit program without inputting student’s data
Test program:
A minimum of 3 test cases should be supplied in the form of table with columns indicating the input values, expected output, actual output and if the test case passed or failed. This table should contain 4 columns with appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record.
The three minimum test cases should include:
(1) Run for one student’s data
(2) Run for 2 students’ data
(3) Start program but select to exit without inputting student’s data
Make sure your Java program is using the recommended style such as:
• Javadoc comment up front with your name as author, date, and brief purpose of the program
• Comments for variables and blocks of code to describe major functionality
• Meaningful variable names and prompts
• Identifiers are written in upper CamelCase
• Class name starts with upper case letter and variables in lower case letter
• Constants are written in All Capitals
• Use proper spacing and empty lines to make code human readable
Capture execution:
You should capture and label screen captures associated with compiling your code, and running each of your 3 test cases.
Here are a couple sample runs:
RUN1:
Welcome to the grade calculation program
Do you want to enter student’s data? Yes/No => Yes
Enter student’s name => Alicja Jones
Enter student’s grades separated by space: A1 A2 Ex P => 80 95 90 88
Student Name: Alicja Jones A1=80 A2=95 Exam=90 Participation=88
Final course grade=88.55
Do you want to enter another student’s data? Yes/No => Yes
Enter student’s name => John Paul
Enter student’s grades separated by space: A1 A2 Ex P => 75 70 80 85
Student Name: John Paul A1=75 A2=70 Exam=80 Participation=85
Final course grade=76.75
Do you want to enter another student’s data? Yes/No => No
Thank you for using the grade calculation program
RUN2:
Welcome to the grade calculation program
Do you want to enter student’s data? Yes/No => No
Thank you for using the grade calculation program
Example test cases: Input Expected Output Actual Output Pass?
Name=Alicja Jones
A1=80 A2=95 Ex=90 P=88
Name=John Paul
A1=75 A2=70 Ex=80 P=85 Student Name: Alicja Jones A1=80 A2=95 Exam=90 Participation=88
Final course grade=88.55
Student Name: John Paul A1=75 A2=70 Exam=80 Participation=85
Final course grade=76.75 Student Name: Alicja Jones A1=80 A2=95 Exam=90 Participation=88
Final course grade=88.55
Student Name: John Paul A1=75 A2=70 Exam=80 Participation=85
Final course grade=76.75 Yes
Test Case 2
Test Case 3
Subject | Computer Science | Pages | 3 | Style | APA |
---|---|---|---|---|---|
s |
Answer
Test Cases
Input |
Expected Output |
Actual Output |
Pass? |
Name=Steve Thompson A1=65 A2=88 Ex=76 P=80
|
Student Name: Steve Thompson A1=65 A2=88 Exam=80 Participation=88 Final course grade=76.65 |
Student Name: Steve Thompson A1=65 A2=88 Exam=76 Participation=80 Final course grade = 76.65
|
|
Name=Alex C A1=60 A2=75 Ex=80 P=98
Name=Phil Williams A1=90 A2=80 Ex=70 P=78 |
Student Name: Alex Cd A1=60 A2=75 Exam=80 Participation=98 Final course grade=75.55
Student Name: Phil Williams A1=90 A2=80 Exam=70 Participation=78 Final course grade=78.3 |
Student Name: Alex C A1=60 A2=75 Exam=80 Participation=98 Final course grade = 75.55
Student Name: Phil Williams A1=90 A2=80 Exam=70 Participation=78 Final course grade = 78.3
|
Yes
Yes |
Run the program and Select “No” |
Welcome to the grade calculation program Do you want to enter student’s data? Yes/No => No
Thank you for using the grade calculation program |
Welcome to the grade calculation program Do you want to enter student’s data? Yes/No =>No
Thank you for using the grade calculation program |
Yes |
Name=Michael Joseph A1=102 A2=34 Ex=67 P=800 |
grades can only range from 0-100 |
grades can only range from 0-100 |
Yes |
Name=Alicia Jones A1=56 A2=-10 Ex=-6 P=50 |
grades can only range from 0-100 |
grades can only range from 0-100 |
Yes |
Figure 1Test Case1: Calculate grade for one student
Figure 2Test Case 2: Calculating grades for multiple student one after another
Figure 3Test Case 3: User runs the program and exit without inputting student’s data
Figure 4Test Case 4:user enters grades greater than 100
Figure 5Test Case 5:user enters some grades less than zero
References
Related Samples
How to Conquer Your Exams: Effective Study Strategies for All Learners
Introduction Imagine...
Overcoming Writer’s Block: Strategies to Get Your Essays Flowing
Introduction The...
Optimizing Your Online Learning Experience: Tips and Tricks for Success
The world of education...
How to Conquer Your Exams: Effective Study Strategies for All Learners
Introduction Ever...
Developing Strong Research Skills: A Guide for Students
Introduction Ever feel...