Question: Edit the given program to produce the following output: - Take in the name of a superhero & tell him how many villains he/she has
Edit the given program to produce the following output: - Take in the name of a superhero & tell him how many villains he/she has to defeat today - The number of villains is randomly generated and should be a number between 11 and 42. - Use a seed of 7. Hint: Compile the program first before making edits
What is your name? Hello Captain America There are 42 villains you need to defeat today Oops! one of the villains was able to multiply himself by a power of 3. There are actually 74088 villains.
#include
int main() { string name; int number; cout << "What is your name?" << endl; cin >> name; cout << "Hello " << name << endl; cout << "There are "<< number >> " villains you need to defeat today"<< endl; // edit and include any necessary code cout << "Oops! one of the villains was able to multiply himself by a power of 3. There are actually villains." << endl;
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
