Question: CSCI 1301: Introduction to Computing and Programming Project 2: Grade Calculator Introduction This project will allow you to apply your knowledge of decision statements, variables,

 CSCI 1301: Introduction to Computing and Programming Project 2: Grade CalculatorIntroduction This project will allow you to apply your knowledge of decisionstatements, variables, assignments, string manipulation expressions, inputs, outputs, algorithm design, compiling, testing,and debugging source code. After completing this project, you'll have your ownprogram that may aid you in calculating your grade. You will writea Java application called GradeCalculator in a file called GradeCalculator.java. This applicationwill aid students in calculating their current grade in a course aswell as finding the average score they will need to achieve acertain letter grade. The following scale is used to compute the final

CSCI 1301: Introduction to Computing and Programming Project 2: Grade Calculator Introduction This project will allow you to apply your knowledge of decision statements, variables, assignments, string manipulation expressions, inputs, outputs, algorithm design, compiling, testing, and debugging source code. After completing this project, you'll have your own program that may aid you in calculating your grade. You will write a Java application called GradeCalculator in a file called GradeCalculator.java. This application will aid students in calculating their current grade in a course as well as finding the average score they will need to achieve a certain letter grade. The following scale is used to compute the final letter grade in the course (we have omitted +/- letter grades for simplicity): Letter Grade Point Range Meaning A 90-100 Greater than or equal to 90 and less than or equal to 100 B 80-89 Greater than or equal to 80 and less than 90 C 70-79 Greater than or equal to 70 and less than 80 D 60-69 Greater than or equal to 60 and less than 70 F Below 60 Less than 60 The final grade for a course will be based on the student's performance in Exam 1, Exam 2, Final Exam, Labs, Quizzes, Projects, and Participation. Your program should prompt the users for the final letter grades they wants to obtain for the course. Then, the program should prompt the user to enter the weight each grading item carries. Afterwards, the program prompts the users if they know the score for each grading item in the course. If the user enters "y" or "yes"(ignoring capitalization), the program asks the user the score for that grading item. Any other response is treated as a "no". The scores for each grading item are out of 100. When prompting the user for the exam scores, the program should not prompt the user for exam 2 or the final exam if the user does not know the score for exam 1. Similarly, if exam 2 is not known then the program does not prompt for the final exam score. Once the user has entered the user's desired final letter grade, the weights of all grading items and the user's known scores, the program calculates and displays the current grade based on the current scores only using the following formula: currentScore = weightgi * scoregi totalKnownGradeWeight where. weight: the weight of grading item gi scoregi: the score achieved in the grading item gi . totalKnown Grade Weight: sum of weights of the grading items of known scores For example, suppose that the user wants to get an A for the course and the user only knows the user's score scores for Exam 1 and Exam 2, which are 92 and 85 respectively. Moreover, Exam 1 carries 15% weight and Exam 2 carries 20% weight. So the user's current score is calculated as: currentScore = weightExam1 * scoreExam1 + weightExam2 * scoreExamz weightExami + weightExamz Replacing the scores and percent weights by the user's scores and percent weight in the previous formula, the user's current score is: 15 * 92 + 20 * 85 currentScore = = 88 (15 + 20) *Hint: Dividing integers may give us unexpected results. Then, the user's current letter grade is determined by checking the range the user's current score falls in the course's grade scale above. The program will display the current score and grade letter for the user. Moreover, if the user has entered a score for all the course grading items, the program should indicate in the message that score and letter grade corresponds to the user's final score and final letter. In the example above, the user's current letter grade is a 'B' according to the course's grading scale. The formula to calculate the grade average to obtain a final overall score is as follows: 100 * finalOverallScore - Z weightgi * scoregi avgToFinalLetterGrade = 100 - totalKnownGradeWeight . finalOverallScore: minimum score in the range of the letter grade the user wants to achieve in the course. weightgi: the weight of the grading item gi. . scoregi: the score achieved in the grading item gi. totalKnown Grade Weight: sum of weights of grading items with known scores. Note: if this value is 100 then all grades are known and you should not do the calculation (as it results in a divide by zero). The desired letter grade is achievable if the average score for the remaining grading items is not greater than a 100. If the user's desired letter grade is achievable in this semester for the student. the program prints, as shown the examples, the average score for the student to get that final letter grade. Otherwise, it prints, as shown in the examples, that the user cannot achieve that letter grade for the course. In our example, the user would like to obtain an A. Therefore, according to the previous formula, the user then needs to score a grade average greater than or equal to 91.07692 for the CSCI 1301: Project 2 Page 2labs, quizzes, projects, participation, and final exam to obtain an A for the course. Your program must display the grade average or any averages with two decimal places as shown in the examples. Requirements 1. The name of the class in your Java program must be GradeCalculator. Therefore, the Java source code file must be called GradeCalculator.java. 2. Your input and output must match our examples exactly (except for inputs that are highlighted), and this includes the verbiage, order, and the formatting. Failure to match the input and output shown in the examples may result in a failing grade on this assignment. This is NOT a minor detail since it is incredibly important to follow I/O specifications when writing software. 3. The desired final letter grade entered by the user should be either A, B, C, D or F (upper or lower case). Otherwise, the program will display an error message and terminate immediately. Throwing an exception is not an acceptable error message. 4. If the weights entered for the course grading items do not add up to a 100, your program should display what is shown in an example and exit immediately. 5. Your program should be able to process the answers to yeso questions regardless of the case. Moreover, if the user does not input yes, y, no or n to a yeso question, the program assumes that the answer is no (as shown in the examples). 6. If the user enters a score for all values then you know the final grade. In this case, you should indicate whether or not they received the grade they wanted (as shown in the examples). 7. You can safely assume the user will always enter a grade score as an integer between 0 and 100. 8. You can safely assume the user will always enter a non-negative percent weight as an integer between 0 and 100. 9. The current user's score as well as the average score to obtain the user's desired final letter grade must be displayed with at most two decimal places. 10. Think about what it means if the avgToFinalLetterGrade is a negative value. Handle this case with an appropriate output (it's not an error). 11. You must include the Statement of Academic Honesty comment at the top of the program's source file. Copy and agree to the entirety of the text contained in the file StatementOfAcademicHonesty.txt on the Labs and Projects webpage, and fill in the class name of your . java file, your name, submission date, and the program's purpose. In the future, every Java source file of every project you submit must have a comment such as this at the top of every source file. Otherwise, points will be deducted from your project. Project Submission . Submit the file GradeCalculator.java and only that file via eLC. Project Grading CSCI 1301: Project 2 Page 3All projects are graded out of a possible 100 points. Make certain your program compiles before submitting, and thoroughly test your program with different inputs to verify that it is working correctly. All instructions must be followed in order to receive full credit. Read on for a list of additional requirements. Additional Requirements These are things that make the graders lives easier, and ultimately, you will see in the real world as well. Remember the teaching staff does not want to touch your code after they gave you requirements; they want to see the perfect results they asked for! Here is a checklist of things you can lose points for: (-10 points) If the source file(s)/class(es) are named incorrectly (case matters!) (-10 points) If your source file(s) have a package declaration at the top . (-10 points) If any source file you submit is missing your Statement of Academic Honesty at the top of the source file. All submitted source code files must contain your Statement of Academic Honesty at the top of each file. (-10 points) If you have more than one instance of Scanner in your program. Your program should only have one instance of Scanner. (-15 points) Inconsistent I/O (input/output) that does not match our instructions or examples exactly (unless otherwise stated in an assignment's instructions). Your program's I/O (order, wording, formatting, etc.) must match our examples and instructions. (-100 points) If the source file(s) are not submitted before the specified deadline's late period ends (48 hours after the deadline) or if they do not compile. (-10%) Late penalties will be deducted for 1-24 hours late submission and (-25%) if submitted 24-48 hours late), as per the course syllabus. . If your (-10 points) comments or (-10 points) variables are "lacking" o Here, "lacking" means that you or a TA can find any lines of code or variables that take more than 10 seconds to understand, and there is no comment, or the variable name does not make sense (variable names like b, bb, bbb, etc. will almost never be acceptable) . (-10 points) Indentation is not consistent throughout your source code o Refresh your memory of indentation patterns in chapter 2 in the course textbook o Be careful of a combination of tabs and spaces in your files (use one or the other)! If any of the above do not make sense to you, talk to a TA or ask your lab instructor. CSCI 1301: Project 2 Page 4Examples Your program should work correctly, and your program must follow the input and output in examples below exactly as shown except for the highlighted inputs. In the first two examples, the highlighted text is user input. Students should read over the first two examples to understand the inputs for the rest of the examples. Each example is a separate run of a correctly working program. Do not assume that these examples exhaust all test cases. Students are responsible for spending a significant amount of time creating test cases and testing that their program works correctly for any sequence of valid inputs. Example 1: weights don't add up Grading Scale: A 90 - 100 B 80 - 89 70 - 79 Ton 60 - 69 below 60 What letter grade do you want to achieve for the course?A Enter percentage weights below. Exam 1: 15 Exam 2: 15 Final Exam: 20 Labs : 15 Projects : 20 Participation: W Quizzes : Weights don't add up to 100, program exiting . . . Example 2: user has all scores Grading Scale: A 90 - 100 80 89 70 - 79 60 - 69 below 60 What letter grade do you want to achieve for the course?A Enter percentage weights below. Exam 1: 15 Exam 2: 20 Final Exam: 20 Labs : 15 Projects : 20 Participation: Quizzes Do you know your exam 1 score?y Score received on exam 1:92 Do you know your exam 2 score?YES Score received on exam 2:95 Do you know your final exam score?Yes Score received on final exam: 91 CSCI 1301: Project 2 Page 5Do you know your lab average?yEs Average lab grade : 92 Do you know your project average? YES Average project grade : 85 Do you know your participation average? YES Average participation grade : 100 Do you know your quiz average?Yes Average quiz grade : 85 Current grade score: 90.75 Your current letter grade : A Congratulations! You received the A that you wanted! Example 3: user has only some scores Grading Scale: A 90 - 100 80 - 89 70 - 79 60 - 69 TI below 60 What letter grade do you want to achieve for the course?B Enter percentage weights below. Exam 1: 15 Exam 2: 20 Final Exam : 20 Labs : 15 Projects : 20 Participation: Quizzes : Do you know your exam 1 score?no Do you know your lab average?yes Average lab grade: 50 Do you know your project average?yes Average project grade: 80 Do you know your participation average? YES Average participation grade : 100 Do you know your quiz average?no Current grade score: 69.74 Your current letter grade : D In order to receive a grade of B, you need to score an average greater than or equal to 86.29 in the rest of the grade items. Example 4: user cannot get the desired grade Grading Scale: A 90 - 100 89 70 - 79 60 - 69 below 60 What letter grade do you want to achieve for the course?A Enter percentage weights below. Exam 1: 15 Exam 2: 20 CSCI 1301: Project 2 Page 6Final Exam : 20 Labs : 15 Projects : 20 Participation: 3 Quizzes : Do you know your exam 1 score?Yes Score received on exam 1:32 Do you know your exam 2 score?yES Score received on exam 2:48 Do you know your final exam score?YES Score received on final exam: 28 Do you know your lab average?yes Average lab grade : 28 Do you know your project average? no Do you know your participation average?yes Average participation grade:0 Do you know your quiz average?NO Current grade score: 33.15 Your current letter grade : F Unfortunately, a grade of A is not possible. Example 5: user enters answers other than yeso (treated as no) Grading Scale: A 90 - 100 80 - 89 70 60 below 60 What letter grade do you want to achieve for the course?C Enter percentage weights below. Exam 1: 15 Exam 2: 20 Final Exam: 20 Labs : 15 Projects : 20 Participation: Quizzes : Do you know your exam 1 score?Yes Score received on exam 1:45 Do you know your exam 2 score? nope Do you know your lab average?kinda Do you know your project average? Nah Do you know your participation average? no Do you know your quiz average?yes Average quiz grade: 70 Current grade score: 51.25 Your current letter grade : F In order to receive a grade of C, you need to score an average greater than or equal to 74.69 in the rest of the grade items. Example 6: user enters an invalid grade Grading Scale: CSCI 1301: Project 2 Page 790 - 100 80 - 89 TONOD 70 - 79 60 - 69 below 60 What letter grade do you want to achieve for the course?z The input is invalid. Example 7: user achieves the grade they want with grades remaining Grading Scale: 90 - 100 80 - 89 70 - 79 60 - 69 below 60 What letter grade do you want to achieve for the course?D Enter percentage weights below. Exam 1: 20 Exam 2: 20 Final Exam: 20 Labs : 10 Projects: 10 Participation: 10 Quizzes : 10 Do you know your exam 1 score?y Score received on exam 1:100 Do you know your exam 2 score?y Score received on exam 2:100 Do you know your final exam score?Y Score received on final exam : 100 Do you know your lab average?y Average lab grade : 100 Do you know your project average?Y Average project grade : 100 Do you know your participation average?n Do you know your quiz average?N Current grade score : 100.00 Your current letter grade : A You will receive at least a grade of D. Example 8: user knows all scores and does not obtain desired grade Grading Scale: 90 - 100 W D 80 89 70 - 79 non 60 - 69 below 60 What letter grade do you want to achieve for the course?A Enter percentage weights below. Exam 1: 15 Exam 2: 20 Final Exam: 20 Labs : 15 CSCI 1301: Project 2 Page 8Projects: 20 Participation: VW Quizzes : Do you know your exam 1 score?yes Score received on exam 1:79 Do you know your exam 2 score?yes Score received on exam 2:72 Do you know your final exam score?y Score received on final exam: 91 Do you know your lab average?y Average lab grade : 92 Do you know your project average?yes Average project grade : 87 Do you know your participation average?yes Average participation grade: 97 Do you know your quiz average?y Average quiz grade: 98 Current grade score: 85.42 Your current letter grade: B Unfortunately, a grade of A is not possible. You should thoroughly test your program with a lot of different input values to ensure correctness. The above examples do not test all possibilities for error. CSCI 1301: Project 2 Page 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!