Hello, I am trying to write a program using C++ that will calculateyour college
ID: 3617002 • Letter: H
Question
Hello, I am trying to write a program using C++ that will calculateyour college GPA for you. I realize that Excel is an easier way to do this, but Ithought this would be more interesting. The goal/algorithm is of this nature: 1. Prompt for number of credit hours earned up until thecurrent semester 2. Prompt for cumulative GPA up until current semester 3. Prompt for number of classes worth credit hours that youare taking currently (here is the part I am having trouble with) 4. Based on input from 3, prompt for class name, GPA, andcredit hours for each class being taken, and only that manycalsses 5. Re-iterate entered informaiton in a table format 6. calculate current semester GPA 7. calculate cumulative GPA I know all of the formulas and what not to do thecalculations, I am just having trouble coming up with a working setof commands that will only prompt for the correct number ofclasses. It needs to be able to account for an input of 0, whichwill yield an output of only the info from steps 1 and 2, an inputof 1-8 for number of classes then prompt for only that many classescorrectly, then give an invalid error message for any value greaterthan 8. I have tried if-else functions, but they always give errormessages. Any suggestions? I realize that Excel is an easier way to do this, but Ithought this would be more interesting. The goal/algorithm is of this nature: 1. Prompt for number of credit hours earned up until thecurrent semester 2. Prompt for cumulative GPA up until current semester 3. Prompt for number of classes worth credit hours that youare taking currently (here is the part I am having trouble with) 4. Based on input from 3, prompt for class name, GPA, andcredit hours for each class being taken, and only that manycalsses 5. Re-iterate entered informaiton in a table format 6. calculate current semester GPA 7. calculate cumulative GPA I know all of the formulas and what not to do thecalculations, I am just having trouble coming up with a working setof commands that will only prompt for the correct number ofclasses. It needs to be able to account for an input of 0, whichwill yield an output of only the info from steps 1 and 2, an inputof 1-8 for number of classes then prompt for only that many classescorrectly, then give an invalid error message for any value greaterthan 8. I have tried if-else functions, but they always give errormessages. Any suggestions?Explanation / Answer
please rate - thanks //*********************************************************** //This is an attempt to write a better college GPA Calculator //1. Prompt for old GPA and credit hours earned //2. Take down old GPA and old credit hours //3. Print input to ensure accuracy to user //4. Ask for number of classes being taken that are worth credithours (up to 10) //5. Take down number of classes as an int variable //6. Prompt for each class hours and grades individually //7. Calculate semester and total GPA and semester and total hoursfor each of the if then statements //8. Print input number of classes and each classes hours andgrades as a table //9. Print calculated semester and total GPA and term and totalhours //honor points are hours1*GPA1+hours2*GPA2... //semhours = hours1+hours2... //termGPA = honor points/semhours //finalGPA = (oldGPA+semGPA)/(oldhours+semhours) //*********************************************************** #include #include using namespace std; int main () { //Variable Declarations int i; float oldGPA, oldhours; float numclasses; float GPA[10]; float hours[10]; float semGPA=0; float ttlGPA; string classname[10]; float honorpts=0, semhours=0, termGPA,finalGPA; //Initial inputs and outputs cout > oldGPA; cout > oldhours; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.