In: Computer Science
Description:
In this program, you'll reuse the Monster data type you wrote in LA11A. Then, you'll write a function that accepts a Monster as an argument by reference, then print the Monster to the screen.
Again, this will be structured as a guided multiple choice quiz where you will choose the appropriate code for a program. After you have gotten a perfect score, write out the program and compile and run it to see it in action.
Instructions:
Choose the correct C++ code for each requirement presented.
Sample Run:
Monster name: Kobold
Monster movement: 2
Monster dps: 1.25
#include <iostream>
using namespace std;
struct Monster{
string name;
int movement;
double dps;
};
void printData(Monster &m){
cout<<"Monster name: "<<m.name<<endl;
cout<<"Monster movement: "<<m.movement<<endl;
cout<<"Monster dps: "<<m.dps<<endl;
}
int main(){
Monster m ={"kobold",2,1.25};
printData(m);
}
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME IT IS VERY IMP FOR ME