Question: 5. 19 Programming Lab 2: Grade Calculator With Methods Instruetor note: to dxwnhad the template complete in an iot, and copy and pasleyout solition 10.

 5. 19 Programming Lab 2: Grade Calculator With Methods Instruetor note:
to dxwnhad the template complete in an iot, and copy and pasleyout
solition 10. 10 pes for enmmentif or not folowing the progiem aperifications
netedei We will break cur oode down into several methods that oach
have one inecife piapote One to hande the hoinemok gates ine is
handie the test grades, one to handle the midterm grode, one to
handie the finsl earti grade ind one to frd the intiar Grabe
ashsoutif Whith the given numerical grade Step 1: Step 2. - Vadide
tha miethod, ute a peist atainemerib iobraingt tis - Peiciart in animvirlabie
and i - Chitalder of the for? Step 1: - A Scanner
object in and constants haye been dectared for you in the moin
metiod inside the terngate code hevise kenes thear is - We will
retum to the main method atter writing al our methods (This is
cocmon paictice - mine me hods and Ifm call itum) step 2
iverage as type doable. The meohod heoder and dommenting fas been ainim
for youl - Ceclare a count yariabe as linteger and stoge the
irout. - Leclare a nun varabie ind intialze tog - Uue a
tor loophat cosants fram 6 ugho eoant. varm f conanit 0. Inside
the tor loop, use a print statement to prompt the user for

5. 19 Programming Lab 2: Grade Calculator With Methods Instruetor note: to dxwnhad the template complete in an iot, and copy and pasleyout solition 10. 10 pes for enmmentif or not folowing the progiem aperifications netedei We will break cur oode down into several methods that oach have one inecife piapote One to hande the hoinemok gates ine is handie the test grades, one to handle the midterm grode, one to handie the finsl earti grade ind one to frd the intiar Grabe ashsoutif Whith the given numerical grade Step 1: Step 2. - Vadide tha miethod, ute a peist atainemerib iobraingt tis - Peiciart in animvirlabie and i - Chitalder of the for? Step 1: - A Scanner object in and constants haye been dectared for you in the moin metiod inside the terngate code hevise kenes thear is - We will retum to the main method atter writing al our methods (This is cocmon paictice - mine me hods and Ifm call itum) step 2 iverage as type doable. The meohod heoder and dommenting fas been ainim for youl - Ceclare a count yariabe as linteger and stoge the irout. - Leclare a nun varabie ind intialze tog - Uue a tor loophat cosants fram 6 ugho eoant. varm f conanit 0. Inside the tor loop, use a print statement to prompt the user for the individal grades: - Read in the input and add it to the sum. sum / count. - return the homework average from the method. Example of get Homevorksvorage method execiting llow many hothevorit grades ito be entenced? it is. braue 21+7.0 Txade 2y 8t? Grnde di 76.4 Grade 43 4 h. Step 3 a uner'a test grudes and calculate the average Remember to letum the test anerage and comment your method aoous the inethse with in tagn, as needed. Example of getrestaverage method execiaing - Mou mahy tonte araden to te mnteredin 2 . Graian if The Grinde 2 t: 8 : Step 4: - Whe e rothod getridternitxanbebde (*paraseter here*l that repura alyod dockin sigre the zaput - returi the midterm cian grage Step S: - setiarnil anial riarigo o* Step 6: - Write a mothod gettetterGrade ("paraneter bere*) that thkes a numencal cinalorade as a paramelar and tefints , String - Inside this method, the String variable lettercrade has been dectared for you an A i+80 is a 8 , ele 4. Iruide ench If/else stateinent, assign a stung Course grade: X. whoie x a the yeter ansel - return the iotier arade frample of get Lettergrade method eveoubog Iten 7 - freuri ciack to live maie uietiod How many homework graden fa be watered?t 4 Crade 21.78.6 ? Grade 2+89 Geade 3 t 76.4 Grade 4191 How many testin gxades ta be anteredi. 2 Crade,217 78 Orada 2100 Vlease entet your nidtatim whan prabei 82.3 rous tifal qrede let lit,le Couran urande I II How many homework grades to be entered?: Grade 1: Grade 2: Grade 3: Grade 4i How many teats grades to be entered?: Grade 1: Grade 2: Please enter your midterm exam qradet Please enter your figsl exam qrade: Your final grade ist 85.16 Course grade: B The input in zylabs is of the form. 478.689.76.491 where 4 is the number of grades being entered and the other 4 values are the grades. 5.19. Programming Lab 2 Ginde Cilculator With Methods GradeCalculatorwithMethods:java 1 import javo. Util, Scarner: 3 public class GrodeCalculatorWithethods f. public stotic. final double HOME Mopk WEIGHT - 0.20. pubile static final double tEST wetcir e, 34; How many homework qrades to be entered?: Grade if Grade 2 w Grade it teac n grades Please enter your final exam arade: Your final grade dat ly.3th How many homework qrades to be entered?: Grade i: Grade 2: Grade 3: Grac d output How many homework grades to be entered?: Gradf 1: Grade 2: Grade Js frac Course grade: B 5.19 Programming Lab 2: Grade Calculator With Methods instructor note: Thin Leb wil be more chalienging than Programming Lab 1. We need to start looroing how to write "one large progam' using al ef the topici we have learned This includes variablea, Decisiont, Loops, and Methods. Please read the istructicns carefully Vou may prefer to dewryead the terpiaie complete in an 106 , and copy and paste your solvion You will be requied to put in proper Java oommenting (10 pts), so please indude I will manusly ieview your code and can deduet up to 10 tas . for commentin or not following the program apecifications In bis Mogramring Lat, we mit going to learn how to vee Methode to make our code mare effective and handie 'separation of concerns" Thirk of frerisads lien functions - each method hardles one specfio probleri or lask, but a able to be caledireused as many tirnes as needed The purpase of this pepgam is to prompt the student to irgut the gredes for each calegary find the atudenfs crabe average for eoch. calegary, and use these avereges 10 calculate the isers final gade averuge and letier grede tha at smiar to Progranming Lab t, out ainh thetheds ard locess With the orish rumercal grede. Step 1; Step 1: - A Scanner object in and constants have been declared for you in the nain method inside the template code. Please leave these in. - We will retum to the nain method after writing all our methods. (This is common practice - write methods and then caf them) Step 2t. - Write a method getllonevorkaverage (5canner in) that takes the Scanner object as a parameter and rehans the homewori averoge as type double. The method header and cornmenting has been writien for you - Inside this method, use a print ntatement to prompt the uher for the pumber of grades to be entered for homework. - Declare a count variable as integer and atore the input. - Declare a sun variabie and initialize to 0. - Use a for loop that counts from 0 up to count. - Inside the for loap, use a print satermeen to prompt the user for the indindual grades - Read in the nput and add in to the aum. Outside of the for loop. greate a variable hotework.kverage and store tie caleuluted ayerage in ife variable tawaged er total. Sumi ( count) - return the homework average from the method at ade Grade 2. 34 sum/ / count) - return the homework average from the method. Example of get HoneworkAverage method executing How many hotework grades to be entered?: 4 Grade 11 : 7.6 Grade 2: 89 Grade 3: 36,4 crade 4: 91 Step 3: - Write a method getFentaver age ("parpheter here*) that returns a double. Follow the same instructions in Step 230 itiag in a uied s test grades and calculate the averige. Hemember to return the test average and comment your mithod above the methorf Example of getteataverage method executing foimany testal gcadea to be anceced?a 2 Graile 21 . 78.3 Arade 27 of step 4: - Weite a method qetmid termRxanGrade ("paraneter here*) that celume a tyoh double. store the inpit Example of get reist hverage method corouting How many tests qradea to be entered? +2 Crade 14 78,9 Grade 2 is 88 Step 4: - White a method getMidterolixanGrade (*paraneter here*) that retuins a type dauble. - Intide this method promot the user to enter their midterm exam grade (no for loop needed as only one soore can be entered) and tiote the inpus. - returs the midterm exam grade Eample of gethidternexantirade method executing: Step 5 : the inpot - return the find eain orade step 6 : - Inside this method, prompt the user to enter their final exam grade (no for loop needed as only one score can be entered) and store the input. - return the final exam grade. Example of getzinalsxambrade method evecuting. Please enter your tinal exam grade: 90.+1 step6 : - Write a methd getlettercrade ( "parameter here*) that takes a numenical finalGrade as a parameter and feturns a string - irside this method, the String variable lettercrade has been declared for you. - Uee an if/elee if/else otatement to check if the finaldrade is an A, B, C, D, or F We will use a 10 -point scale where >90 is an A> is a 8, etc. - return the letter grase . Ahore Please make sure you are not "printing" the Suring in this mothod We wil print it in the main methad. Eumple of getLetcerfir ade method exeouting: Step 7: - Return back to the main method. - Call the 4 methods for homework, tests, midterm, and final, passing the Scanner object as a parameter to eoch. Mabke sure 10 atore the return vasues in appropriate variables. - Calculate the final numerical grade average using the variables and the constants that were declared above (grade average is the sum of all of the averages * CONSTANT) - Use a printt statement to output the final grade average to 2 decimal places. - Call the getietterGrade method, passing the final grade average as a parameter. - Use a printlin statement to output the letter grade. Entire run of program in an IDE (this is formatted) Wow many homwwork qraden to be entered?r 4 Crade 1170.6 Orade 2n e9. Cf ade 31.76.4 Grase 4791. Hiou many tenta grades to be encered?t? Grade 1 t TE. 9 tir ade 2:1 en Pheain nhter your midterin exan quade t 82,7 Whate encer your tinal exan quadet 90.1 Your tiral yrade ist 46,26 How masty homework qrades te be enteredtit 4 Grade 1=73,6 Grade 21 is Crade 37 76.4 Crade a 91 Hev many test. qeades to be natered?r-: Gtade 21,76,0 Grade 2+185 Pleate enter your midterh oxan qrader i? :3 blease entar your fln1 exan gradet 30,1 Your final grade its 85.16 coarae equaifs s Aemertber to comment your eode per the "Jave Coding PuL Es" doe n iCollegr (10 pta). ekan yratel trat final grade sat abjIC. Cistae oradein The rout in ty iate is of the form 4 7e, 4.95+10,4,1 How many homework grades to be entered?: Grade 1 t Grade 2t Grade 31 Grade 4t Hlok nany teats: 9 zaden to be entered?: Grade 1: Grade 21 Please enter yout midterm exam grade please enter your final pxam qrade: Your final grade ist os.16 Courne qrades B : 2 Compare output A Output differs. See highlights below 2.86.2.76input33.12.65.772.185.1 Youf output Expected output How many homework gradeA to be wntered? Crade It Gracle 2: liow maay teat Cournel grafen e 5. 19 Programming Lab 2: Grade Calculator With Methods Instruetor note: to dxwnhad the template complete in an iot, and copy and pasleyout solition 10. 10 pes for enmmentif or not folowing the progiem aperifications netedei We will break cur oode down into several methods that oach have one inecife piapote One to hande the hoinemok gates ine is handie the test grades, one to handle the midterm grode, one to handie the finsl earti grade ind one to frd the intiar Grabe ashsoutif Whith the given numerical grade Step 1: Step 2. - Vadide tha miethod, ute a peist atainemerib iobraingt tis - Peiciart in animvirlabie and i - Chitalder of the for? Step 1: - A Scanner object in and constants haye been dectared for you in the moin metiod inside the terngate code hevise kenes thear is - We will retum to the main method atter writing al our methods (This is cocmon paictice - mine me hods and Ifm call itum) step 2 iverage as type doable. The meohod heoder and dommenting fas been ainim for youl - Ceclare a count yariabe as linteger and stoge the irout. - Leclare a nun varabie ind intialze tog - Uue a tor loophat cosants fram 6 ugho eoant. varm f conanit 0. Inside the tor loop, use a print statement to prompt the user for the individal grades: - Read in the input and add it to the sum. sum / count. - return the homework average from the method. Example of get Homevorksvorage method execiting llow many hothevorit grades ito be entenced? it is. braue 21+7.0 Txade 2y 8t? Grnde di 76.4 Grade 43 4 h. Step 3 a uner'a test grudes and calculate the average Remember to letum the test anerage and comment your method aoous the inethse with in tagn, as needed. Example of getrestaverage method execiaing - Mou mahy tonte araden to te mnteredin 2 . Graian if The Grinde 2 t: 8 : Step 4: - Whe e rothod getridternitxanbebde (*paraseter here*l that repura alyod dockin sigre the zaput - returi the midterm cian grage Step S: - setiarnil anial riarigo o* Step 6: - Write a mothod gettetterGrade ("paraneter bere*) that thkes a numencal cinalorade as a paramelar and tefints , String - Inside this method, the String variable lettercrade has been dectared for you an A i+80 is a 8 , ele 4. Iruide ench If/else stateinent, assign a stung Course grade: X. whoie x a the yeter ansel - return the iotier arade frample of get Lettergrade method eveoubog Iten 7 - freuri ciack to live maie uietiod How many homework graden fa be watered?t 4 Crade 21.78.6 ? Grade 2+89 Geade 3 t 76.4 Grade 4191 How many testin gxades ta be anteredi. 2 Crade,217 78 Orada 2100 Vlease entet your nidtatim whan prabei 82.3 rous tifal qrede let lit,le Couran urande I II How many homework grades to be entered?: Grade 1: Grade 2: Grade 3: Grade 4i How many teats grades to be entered?: Grade 1: Grade 2: Please enter your midterm exam qradet Please enter your figsl exam qrade: Your final grade ist 85.16 Course grade: B The input in zylabs is of the form. 478.689.76.491 where 4 is the number of grades being entered and the other 4 values are the grades. 5.19. Programming Lab 2 Ginde Cilculator With Methods GradeCalculatorwithMethods:java 1 import javo. Util, Scarner: 3 public class GrodeCalculatorWithethods f. public stotic. final double HOME Mopk WEIGHT - 0.20. pubile static final double tEST wetcir e, 34; How many homework qrades to be entered?: Grade if Grade 2 w Grade it teac n grades Please enter your final exam arade: Your final grade dat ly.3th How many homework qrades to be entered?: Grade i: Grade 2: Grade 3: Grac d output How many homework grades to be entered?: Gradf 1: Grade 2: Grade Js frac Course grade: B 5.19 Programming Lab 2: Grade Calculator With Methods instructor note: Thin Leb wil be more chalienging than Programming Lab 1. We need to start looroing how to write "one large progam' using al ef the topici we have learned This includes variablea, Decisiont, Loops, and Methods. Please read the istructicns carefully Vou may prefer to dewryead the terpiaie complete in an 106 , and copy and paste your solvion You will be requied to put in proper Java oommenting (10 pts), so please indude I will manusly ieview your code and can deduet up to 10 tas . for commentin or not following the program apecifications In bis Mogramring Lat, we mit going to learn how to vee Methode to make our code mare effective and handie 'separation of concerns" Thirk of frerisads lien functions - each method hardles one specfio probleri or lask, but a able to be caledireused as many tirnes as needed The purpase of this pepgam is to prompt the student to irgut the gredes for each calegary find the atudenfs crabe average for eoch. calegary, and use these avereges 10 calculate the isers final gade averuge and letier grede tha at smiar to Progranming Lab t, out ainh thetheds ard locess With the orish rumercal grede. Step 1; Step 1: - A Scanner object in and constants have been declared for you in the nain method inside the template code. Please leave these in. - We will retum to the nain method after writing all our methods. (This is common practice - write methods and then caf them) Step 2t. - Write a method getllonevorkaverage (5canner in) that takes the Scanner object as a parameter and rehans the homewori averoge as type double. The method header and cornmenting has been writien for you - Inside this method, use a print ntatement to prompt the uher for the pumber of grades to be entered for homework. - Declare a count variable as integer and atore the input. - Declare a sun variabie and initialize to 0. - Use a for loop that counts from 0 up to count. - Inside the for loap, use a print satermeen to prompt the user for the indindual grades - Read in the nput and add in to the aum. Outside of the for loop. greate a variable hotework.kverage and store tie caleuluted ayerage in ife variable tawaged er total. Sumi ( count) - return the homework average from the method at ade Grade 2. 34 sum/ / count) - return the homework average from the method. Example of get HoneworkAverage method executing How many hotework grades to be entered?: 4 Grade 11 : 7.6 Grade 2: 89 Grade 3: 36,4 crade 4: 91 Step 3: - Write a method getFentaver age ("parpheter here*) that returns a double. Follow the same instructions in Step 230 itiag in a uied s test grades and calculate the averige. Hemember to return the test average and comment your mithod above the methorf Example of getteataverage method executing foimany testal gcadea to be anceced?a 2 Graile 21 . 78.3 Arade 27 of step 4: - Weite a method qetmid termRxanGrade ("paraneter here*) that celume a tyoh double. store the inpit Example of get reist hverage method corouting How many tests qradea to be entered? +2 Crade 14 78,9 Grade 2 is 88 Step 4: - White a method getMidterolixanGrade (*paraneter here*) that retuins a type dauble. - Intide this method promot the user to enter their midterm exam grade (no for loop needed as only one soore can be entered) and tiote the inpus. - returs the midterm exam grade Eample of gethidternexantirade method executing: Step 5 : the inpot - return the find eain orade step 6 : - Inside this method, prompt the user to enter their final exam grade (no for loop needed as only one score can be entered) and store the input. - return the final exam grade. Example of getzinalsxambrade method evecuting. Please enter your tinal exam grade: 90.+1 step6 : - Write a methd getlettercrade ( "parameter here*) that takes a numenical finalGrade as a parameter and feturns a string - irside this method, the String variable lettercrade has been declared for you. - Uee an if/elee if/else otatement to check if the finaldrade is an A, B, C, D, or F We will use a 10 -point scale where >90 is an A> is a 8, etc. - return the letter grase . Ahore Please make sure you are not "printing" the Suring in this mothod We wil print it in the main methad. Eumple of getLetcerfir ade method exeouting: Step 7: - Return back to the main method. - Call the 4 methods for homework, tests, midterm, and final, passing the Scanner object as a parameter to eoch. Mabke sure 10 atore the return vasues in appropriate variables. - Calculate the final numerical grade average using the variables and the constants that were declared above (grade average is the sum of all of the averages * CONSTANT) - Use a printt statement to output the final grade average to 2 decimal places. - Call the getietterGrade method, passing the final grade average as a parameter. - Use a printlin statement to output the letter grade. Entire run of program in an IDE (this is formatted) Wow many homwwork qraden to be entered?r 4 Crade 1170.6 Orade 2n e9. Cf ade 31.76.4 Grase 4791. Hiou many tenta grades to be encered?t? Grade 1 t TE. 9 tir ade 2:1 en Pheain nhter your midterin exan quade t 82,7 Whate encer your tinal exan quadet 90.1 Your tiral yrade ist 46,26 How masty homework qrades te be enteredtit 4 Grade 1=73,6 Grade 21 is Crade 37 76.4 Crade a 91 Hev many test. qeades to be natered?r-: Gtade 21,76,0 Grade 2+185 Pleate enter your midterh oxan qrader i? :3 blease entar your fln1 exan gradet 30,1 Your final grade its 85.16 coarae equaifs s Aemertber to comment your eode per the "Jave Coding PuL Es" doe n iCollegr (10 pta). ekan yratel trat final grade sat abjIC. Cistae oradein The rout in ty iate is of the form 4 7e, 4.95+10,4,1 How many homework grades to be entered?: Grade 1 t Grade 2t Grade 31 Grade 4t Hlok nany teats: 9 zaden to be entered?: Grade 1: Grade 21 Please enter yout midterm exam grade please enter your final pxam qrade: Your final grade ist os.16 Courne qrades B : 2 Compare output A Output differs. See highlights below 2.86.2.76input33.12.65.772.185.1 Youf output Expected output How many homework gradeA to be wntered? Crade It Gracle 2: liow maay teat Cournel grafen e

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 Databases Questions!