Question
The most Grammy awards won in a single year by any artist is 8, tied between Micheal Jackson & Santana. Close behind are Beyonce and
The most Grammy awards won in a single year by any artist is 8, tied between Micheal Jackson & Santana. Close behind are Beyonce and Adele who have one 6 Grammys in one year. Georg Solti holds the record for the most Grammy awards at 31.
The program below will allow the user to input the name of their favorite musical artist and a range for a randomly generated number of awards, with three being the least number. Setup the random number generator to accept any range of numbers beginning at 3. If the favorite artist ties with any of the artists above they will get a corresponding output like the one shown below.
Review the existing code for a lines that need to be updated (//FIX ME) there should no need to correct any other lines of code
Input
Kelly Clarkson 15
Output
Who is your favorite musical artist? Kelly Clarkson Input a range for the number of awards possible 11 If Kelly Clarkson wins 11 Grammys next year they will have set a new record for most wins in one year!
Please just fix the code
code:
#include
using namespace std;
int main() {
srand(15);
string artist;
int grammy =0;
int range =0;
cout << "Who is your favorite musical artist?" << endl; //Output statement to collect input of artist
cin //FIX ME: Takes in the name of the artist
// FIX ME: output the name of the artist
cout << "Input a range for the number of awards possible ";
cin >> range;
grammy = (rand()% range); //FIX ME: Produces randomly generated number of Grammys with the minimum being 3
cout << grammy << endl; // output the number of grammys the artist could win
if (grammy < 6){ //FIX ME ( Account for less than record breaking awards
cout << grammy <<" Grammys would be awesome for" << artist << " but they would not break any records" << endl;
}
else if (grammy == 6){ //FIX ME (Account for 6 Grammys won)
cout << " If " << artist << " wins 6 Grammys next year she will be tied for number of Grammys with Micheal Jackson! ";
}
else if (grammy < 8){
cout << "If " << artist << " wins " << grammy << " Grammys next year they will have more Grammys than Micheal Jackson, but not broken a record! ";
}
else if (){ //FIX ME ( account for 8 Grammy awards in a year
cout << "If " << artist << " wins 8 Grammys next year she will be tied for number of Grammys with Adele! ";
}
else if (){ //FIX ME (account for Grammys between 8 and 31)
cout << "If wins " << grammy << " Grammys next year they will have set a new record for most wins in one year! ";
}
else if (){ // FIX ME (account for values over the maximum number of grammys awarded)
cout << " If " << artist << " wins " << grammy <<" Grammys next year they will have earned the most Grammys EVER! ";
}
else {
cout << "Your random number generator is incorrect!";
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started