In: Computer Science
Description:
In this lab you will choose the statements to create a program that:
Creates a brand new data type called "Monster". Once created, creates a variable of type Monster and assign values to the variable and then display the contents.
This lab will again take the form of a guided multiple-choice quiz like you had in the previous labs. For each question, pick the statement that implements the given requirement.
A Sample Run:
Monster name: Orc
Monster movement: 5
Monster dps: 3.5
//I have implemented the code you can take the input from the console and to run program use the // //below link from repl
//I have even used the strucure and used it as a data type
// LINK : https://repl.it/@FAYAZPASHA/OutstandingQuizzicalCarriers#main.cpp
#include<bits/stdc++.h>
using namespace std;
struct Monster{ //A User Defined Structure
string name;
int movement;
float dps;
};
int main(){
Monster monster; //Using the predefined
structure as a datatype
//monster.name = "Orc";
//monster.movement = 5;
//monster.dps = 3.5;
cout << "Enter Monster name: ";
string name; cin >> name;
cout << "Enter Monster Movements: ";
int mov; cin >> mov;
cout << "Enter Monster DPS: ";
float dp; cin >> dp;
monster.name = name;
monster.movement = mov;
monster.dps = dp;
cout << "Monster name: " << monster.name
<< endl;
cout << "Monster movement: " <<
monster.movement << endl;
cout << "Monster dps: " << monster.dps
<< endl;
return 0;
}