Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write code for this project that fullfills all the requirments. Need in done asap before 4 pm est. Thank you so much! Introduction In this

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

write code for this project that fullfills all the requirments. Need in done asap before 4 pm est. Thank you so much!

Introduction In this project, you will apply the knowledge of decision statements (e.g. branching statements), variables, assignments, string operations, inputs and outputs, basic algorithm design, compiling. program testing and debugging. You will create a working pragram that can calculate grades based on the set standard. IPlease note that this arade calculator is NOT used to calculate the grade for this course!/ Assignment Write a single-fle Java program called GradeCalculator (file name: GradeCalculator.java). This program should be able to calculate a student's current grade, to find the average score that student needs to obtain for the rernaining items in arder to achieve a certain desired letter grade. We will use the following grading scale to compute the final letter grade. Note that we only deal with the letter grade, no +or - fallowing the letter. Note: [ and ] : inclusive; ( and ): exclusive. The final course grade includes labs, quizzes, projects, participation, exam 1, exam 2, and final exam. Follow the instructions below for writing the program. 1. The program should first ask the user to input a letter grade thry want to receive. Note that the user input of the letter grade may be valid or invalid. 2. Then, the program asks the user if they know the scores for each graded item. 3.1 If the user does know [2.), i.e. the scores far each graded item, by entering " y " or "pes" luppercase or lowercase letters or a mix), the propram will ask the user the scores for each graded item. Each item is graded with a number in a 100-point grading scale. 3.2 If the user daes nat know one or mare scares for each graded itern, the user will enter " n " or anything else. Any input other than " y " or "yes" (by ianoring case) means NO - i.e, the user finalOverallscore: minimum score in the range of the letter arade the user wants to obtain. does not know the score. weight tg : the weight of the graded item gf. scoreac the score achieved in the grading item gi. 4. Exam 1, exam 2, and final exam are taken in order. Therefore, if the user does not know the totwKnownGrodeWelght: sum of we ghts of grading items with known scores. score for exam 2, the program will not ask the user to enter final exam score. If the user does (Hint: if value of totaknownGradeWeight is 100, ther all grades are known. No calculation will not know the score for exam 1 , the program will not ask the user to enter exam 2 score or final be needed.) exam score. 7. As you see, the desired letter grade is achievable only if the average score for the remaining 5. Once the user has entered the desired final letter grade, the weights of all graded items, and graded items is no greater than 100 . For instance, it is easy to understand that the user cannot the user's known scores, the program will calculate and display the current grade based on the expect an A grade if he/she has alreardy scored too low for all existing graded items. By noting follawing farmula: that fact, do the following: 7,1 If the user's desired letter grade is achievable, the program will print the average score for the user to obtain that final letter grade. weight ti : the weight of graded item gi 7.2 Otherwise \{when the user's desired is not achievable\}, the program will print that the user scorsa the score abtained in the graded item gi cannot achieve that letter grade. totaKnownGradeWelght: sum of we ahts of the araded items of known scores In our example, let's assume that the user's desired letter arade is A According to the formula, The Sigma symbol is the sum of each weighted score. the user needs to score a grade average greater than or equal to 91.07692 for the labs, quizzes, projects, participation, and final exam to obtain the A grade for the course. Fxample: the user wanis to get A; the user only know's examn 1 (-92), exarn 2 (-8,5). Fxamn 1 carries 15% weight and exan 2 carries 20% weight. The current scofe is expressed as follows: The program must display the gride average or anv ivernges with two decimil places as shown in the examples. (Hint: how to display a number with two decimal places? Recall a previous lab assignment.) Program requirements currentscore =(15+20)15+92+20+85=88 In order to receive full credit for this project, please follow all these requirements listed below. (Attentiom: Dividing integers! Consider how to handle it correctly...) (1) The name of the program file must be exactly Grodecoiculator java. As a result, the class name in such a Java source code must also be the same, which is Gradecaicuiotor. 6. Afterwards, the user's current letter grade is determined by checking the range of the letter grade that the current score belongs to. The program will display the current score and the (2) The program must read inputs and display the formatted results in the same way as grade letter. If the user has entered all scores of graded items, the program will indicate by what the instructions and examples show [See the last section for examples!) displaying the user's final score and the final letter grade. (3) The desired final letter grade entered by the user should be A, B, C, D or F. Otherwise, In our example, the user's current letter grade is a according to the course's grading scale the pragram will simply display an error message that is made by your cade ("The input (betwern 80 and 89 ). The formula to calculate the grade avernge ta obtain a final cwerall scare is invalid. "y and exit. The program itself should not "throw an exception" (as a proeram is as follows: auto-generated error message). avgToFinalLetterGrade =100totalKnownGradeWWeight100finaloverallscoreweighttgtscoregt (4) If the we ahts entered for all the graded items do not add up to 100, the program display what is shown in an example f"Weights dan't add up to 100, pragram exil and exit. Page 4 of 10 Submit the source cade file GrodeCalculator.jova to eLC. Make sure yaur Java program can (5) Your program should ignore the case "yes" or " y " from the user input. It treats all inputs compile and run. Do not submit anything else. other than " y "s" of " y " as NO. [See assignment description 3.1 and 3.2] Grading (6) If the user enters all scores of araded items, the program should indicate whether the user has received the desired grade (see examples). A scare between D and 10 will be assigned. (7) The current score and the average score for the user to obtain in the remaining graded (1) Points are AWARDED when your program passes B test cases that are cletenined or chosen items must be displayed with at most twa decimal places. by the grader/grading pragram. Test cases may include: when weights added up ta 1000.5). user has valid/finvalid input 0.5, user knows all scores and did not obtain desired grade (1.5), (8) In certain cases, the avgToFinalletterGrade may be a negative value (when and why?). Your program shauld tie able to process that case apprapriately. cannat obtain desired grade (1.5}, user knows anly same af their scores and can possibly obtain desired grade (1.5), user needs 100\% on remaining work to get desired arade (1.5), and user (9) At last, understand the following statement for Academic Honesty and add it into the does nat know all grades but can trivially achieve desired grade {1.5}. tap of your souree code to submit. The following lines should be added AROVE the orlainal first line of code. (2) Points are DEDUCTED when yaur program fails to meet certain requirements: Page 6 of 10 Page 8 of 10 Saxan: noctival an exim 7-37 Da sou knaw your lins1 cssm sun??YES Sesine roctival an lital exum: 2K Do zou kinow yeur lals ateragelyes Average lah grode:2x Lo you know; yeur penjest averageino Do zou know yeur participation zvernge? Tyes Average puricipation grode:00 Lo you know your qua zerage?ND Current grode scoce 13.15 Yorr cument letter grade: Cnforimately, a grade of is not pussible. Lxample 5: wser entes amsies other than yes'no (treated as no) Giore rasiresl on insl exam 91 Do you kraw your lah averige f Avirage lely grude: 92 Aviriege fingect pribe: K7 Averoge farticigation pradesy Wh you know yvar quiz average? Nvermge quiz grade-98 Cumatit grade score:85.12 Vnur cunte later grate:b Unfoctunasel F, a grzde of is not posible. Introduction In this project, you will apply the knowledge of decision statements (e.g. branching statements), variables, assignments, string operations, inputs and outputs, basic algorithm design, compiling. program testing and debugging. You will create a working pragram that can calculate grades based on the set standard. IPlease note that this arade calculator is NOT used to calculate the grade for this course!/ Assignment Write a single-fle Java program called GradeCalculator (file name: GradeCalculator.java). This program should be able to calculate a student's current grade, to find the average score that student needs to obtain for the rernaining items in arder to achieve a certain desired letter grade. We will use the following grading scale to compute the final letter grade. Note that we only deal with the letter grade, no +or - fallowing the letter. Note: [ and ] : inclusive; ( and ): exclusive. The final course grade includes labs, quizzes, projects, participation, exam 1, exam 2, and final exam. Follow the instructions below for writing the program. 1. The program should first ask the user to input a letter grade thry want to receive. Note that the user input of the letter grade may be valid or invalid. 2. Then, the program asks the user if they know the scores for each graded item. 3.1 If the user does know [2.), i.e. the scores far each graded item, by entering " y " or "pes" luppercase or lowercase letters or a mix), the propram will ask the user the scores for each graded item. Each item is graded with a number in a 100-point grading scale. 3.2 If the user daes nat know one or mare scares for each graded itern, the user will enter " n " or anything else. Any input other than " y " or "yes" (by ianoring case) means NO - i.e, the user finalOverallscore: minimum score in the range of the letter arade the user wants to obtain. does not know the score. weight tg : the weight of the graded item gf. scoreac the score achieved in the grading item gi. 4. Exam 1, exam 2, and final exam are taken in order. Therefore, if the user does not know the totwKnownGrodeWelght: sum of we ghts of grading items with known scores. score for exam 2, the program will not ask the user to enter final exam score. If the user does (Hint: if value of totaknownGradeWeight is 100, ther all grades are known. No calculation will not know the score for exam 1 , the program will not ask the user to enter exam 2 score or final be needed.) exam score. 7. As you see, the desired letter grade is achievable only if the average score for the remaining 5. Once the user has entered the desired final letter grade, the weights of all graded items, and graded items is no greater than 100 . For instance, it is easy to understand that the user cannot the user's known scores, the program will calculate and display the current grade based on the expect an A grade if he/she has alreardy scored too low for all existing graded items. By noting follawing farmula: that fact, do the following: 7,1 If the user's desired letter grade is achievable, the program will print the average score for the user to obtain that final letter grade. weight ti : the weight of graded item gi 7.2 Otherwise \{when the user's desired is not achievable\}, the program will print that the user scorsa the score abtained in the graded item gi cannot achieve that letter grade. totaKnownGradeWelght: sum of we ahts of the araded items of known scores In our example, let's assume that the user's desired letter arade is A According to the formula, The Sigma symbol is the sum of each weighted score. the user needs to score a grade average greater than or equal to 91.07692 for the labs, quizzes, projects, participation, and final exam to obtain the A grade for the course. Fxample: the user wanis to get A; the user only know's examn 1 (-92), exarn 2 (-8,5). Fxamn 1 carries 15% weight and exan 2 carries 20% weight. The current scofe is expressed as follows: The program must display the gride average or anv ivernges with two decimil places as shown in the examples. (Hint: how to display a number with two decimal places? Recall a previous lab assignment.) Program requirements currentscore =(15+20)15+92+20+85=88 In order to receive full credit for this project, please follow all these requirements listed below. (Attentiom: Dividing integers! Consider how to handle it correctly...) (1) The name of the program file must be exactly Grodecoiculator java. As a result, the class name in such a Java source code must also be the same, which is Gradecaicuiotor. 6. Afterwards, the user's current letter grade is determined by checking the range of the letter grade that the current score belongs to. The program will display the current score and the (2) The program must read inputs and display the formatted results in the same way as grade letter. If the user has entered all scores of graded items, the program will indicate by what the instructions and examples show [See the last section for examples!) displaying the user's final score and the final letter grade. (3) The desired final letter grade entered by the user should be A, B, C, D or F. Otherwise, In our example, the user's current letter grade is a according to the course's grading scale the pragram will simply display an error message that is made by your cade ("The input (betwern 80 and 89 ). The formula to calculate the grade avernge ta obtain a final cwerall scare is invalid. "y and exit. The program itself should not "throw an exception" (as a proeram is as follows: auto-generated error message). avgToFinalLetterGrade =100totalKnownGradeWWeight100finaloverallscoreweighttgtscoregt (4) If the we ahts entered for all the graded items do not add up to 100, the program display what is shown in an example f"Weights dan't add up to 100, pragram exil and exit. Page 4 of 10 Submit the source cade file GrodeCalculator.jova to eLC. Make sure yaur Java program can (5) Your program should ignore the case "yes" or " y " from the user input. It treats all inputs compile and run. Do not submit anything else. other than " y "s" of " y " as NO. [See assignment description 3.1 and 3.2] Grading (6) If the user enters all scores of araded items, the program should indicate whether the user has received the desired grade (see examples). A scare between D and 10 will be assigned. (7) The current score and the average score for the user to obtain in the remaining graded (1) Points are AWARDED when your program passes B test cases that are cletenined or chosen items must be displayed with at most twa decimal places. by the grader/grading pragram. Test cases may include: when weights added up ta 1000.5). user has valid/finvalid input 0.5, user knows all scores and did not obtain desired grade (1.5), (8) In certain cases, the avgToFinalletterGrade may be a negative value (when and why?). Your program shauld tie able to process that case apprapriately. cannat obtain desired grade (1.5}, user knows anly same af their scores and can possibly obtain desired grade (1.5), user needs 100\% on remaining work to get desired arade (1.5), and user (9) At last, understand the following statement for Academic Honesty and add it into the does nat know all grades but can trivially achieve desired grade {1.5}. tap of your souree code to submit. The following lines should be added AROVE the orlainal first line of code. (2) Points are DEDUCTED when yaur program fails to meet certain requirements: Page 6 of 10 Page 8 of 10 Saxan: noctival an exim 7-37 Da sou knaw your lins1 cssm sun??YES Sesine roctival an lital exum: 2K Do zou kinow yeur lals ateragelyes Average lah grode:2x Lo you know; yeur penjest averageino Do zou know yeur participation zvernge? Tyes Average puricipation grode:00 Lo you know your qua zerage?ND Current grode scoce 13.15 Yorr cument letter grade: Cnforimately, a grade of is not pussible. Lxample 5: wser entes amsies other than yes'no (treated as no) Giore rasiresl on insl exam 91 Do you kraw your lah averige f Avirage lely grude: 92 Aviriege fingect pribe: K7 Averoge farticigation pradesy Wh you know yvar quiz average? Nvermge quiz grade-98 Cumatit grade score:85.12 Vnur cunte later grate:b Unfoctunasel F, a grzde of is not posible

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Why do people tell lies on their CVs?

Answered: 1 week ago

Question

2. What is the difference between an embellishment and a lie?

Answered: 1 week ago