cout << "Steven_Brightwell Lab_3" << endl; string studentname; int score; int studentscore; int totalpoints; int percentage; int count; float finalscore; count = 1; while (count <= 10) { cout << "Please enter the student's name" << endl; cin >> studentname; cout << "Please enter the student's score" << end%; cin >> score; cout << "Please enter the total points" « endl; cin >> totalpoints; count = count++; finalscore = score / totalpoints; percentage = finalscore * 100; if (percentage >= 90) cout << studentname << percentage << "%" << finalscore << "Excellent" << endl; if (percentage >= 80 && percentage < 90) cout << studentname << percentage << "%" << finalscore << "Well Done" << endl; if (percentage >= 70 && percentage < 80) cout << studentname << percentage << "%" << finalscore << "Good" << endl; if (percentage >= 60 && percentage < 7e) cout << studentname << percentage << "%" << finalscore << "Needs Improvement" << endl; if (percentage < 50 && percentage < 60) cout << studentname << percentage << "%" << finalscore << "Failed" << endl; } return 0;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

I dont understand what I did wrong but it is not computing out the correct percentage. How do I fix this

 

cout << "Steven_Brightwell Lab_3" << endl;
string studentname;
int score;
int studentscore;
int totalpoints;
int percentage;
int count;
float finalscore;
count = 1;
while (count <= 10)
{
cout << "Please enter the student's name" << endl;
cin >> studentname;
cout << "Please enter the student's score" << end%;
cin >> score;
cout << "Please enter the total points" « endl;
cin >> totalpoints;
count = count++;
finalscore = score / totalpoints;
percentage = finalscore * 100;
if (percentage >= 90)
cout << studentname << percentage << "%" << finalscore << "Excellent" << endl;
if (percentage >= 80 && percentage < 90)
cout << studentname << percentage << "%" << finalscore << "Well Done" << endl;
if (percentage >= 70 && percentage < 80)
cout << studentname << percentage << "%" << finalscore << "Good" << endl;
if (percentage >= 60 && percentage < 7e)
cout << studentname << percentage << "%" << finalscore << "Needs Improvement" << endl;
if (percentage < 50 && percentage < 60)
cout << studentname << percentage << "%" << finalscore << "Failed" << endl;
}
return 0;
Transcribed Image Text:cout << "Steven_Brightwell Lab_3" << endl; string studentname; int score; int studentscore; int totalpoints; int percentage; int count; float finalscore; count = 1; while (count <= 10) { cout << "Please enter the student's name" << endl; cin >> studentname; cout << "Please enter the student's score" << end%; cin >> score; cout << "Please enter the total points" « endl; cin >> totalpoints; count = count++; finalscore = score / totalpoints; percentage = finalscore * 100; if (percentage >= 90) cout << studentname << percentage << "%" << finalscore << "Excellent" << endl; if (percentage >= 80 && percentage < 90) cout << studentname << percentage << "%" << finalscore << "Well Done" << endl; if (percentage >= 70 && percentage < 80) cout << studentname << percentage << "%" << finalscore << "Good" << endl; if (percentage >= 60 && percentage < 7e) cout << studentname << percentage << "%" << finalscore << "Needs Improvement" << endl; if (percentage < 50 && percentage < 60) cout << studentname << percentage << "%" << finalscore << "Failed" << endl; } return 0;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Knowledge Booster
Research
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning