(I have gotten this far and it won't display more than one reviewer or the correct stars. please help. c++ instructions below.)
#include <iostream>
using namespace std;
int main()
{
int amntReviewers = 0;
int ratings = 0;
int astricks = 0;
{
cout << "Enter number of reviewers: ";
cin >> amntReviewers;
}
cout << "Movie ratings must be from 1 to 5.";
for (int amntReviewers = 1; amntReviewers <= 5; amntReviewers +=1);
{
cout << "Enter Ratings: " << "Movie ratings must be from 1-5.";
cin >> ratings;
for (int ratings = 1; ratings <= 6; ratings += 1)
cout << '*';
//end for
cout << endl;
} //end for
return 0;
Okay, thank you! I have modified my program to reflect the following. I am not sure what I need to do to get it to start at "Enter ratings for reviewer 1" again after you enter 7 as a rating. Since 7 exceeds the rating limit it should allow you to enter the ratings for such reviewer once more. Please help.
#include <iostream>
using namespace std;
int main()
{
int reviewers = 0;
int ratings = 0;
cout << "Enter numbers of reviewers: " << endl;
cin >> reviewers;
cout << "Movie ratings must be between 1 and 5." << endl;
for (int reviewers = 1; reviewers <= 5; reviewers ++)
{
cout << "Enter ratings for reviewer " << reviewers << ":";
cin >> ratings;
if (ratings > 5)
{
cout << "The rating must be between 1 and 5!";
cin >> ratings;
}
for (int i = 0; i <= ratings; i += 1)
{
cout << "*";
}
cout << endl;
} // endlfor
system("PAUSE");