I am consistently compiling errors when I attempt torun this particular program
ID: 3638454 • Letter: I
Question
I am consistently compiling errors when I attempt torun this particular program see below and if possible asist me in the process of correcting the data. I am using visual studio c++ 2010 express for this exercise. The c++ program class called Time will have 3 integer data members named hrs, mins & secs which would be used to store hours, minutes and seconds. Member function will contain a constructor that supply’s default values “zero” for each data member, a display function that prints an object’s data values and lastly, an assignment operator that execute a member intelligent assignment between “2 Time objects”.#include <iostream>
using namespace std;
int main()
{
class Time
{
int hrs,mins,secs;
public:
Time(int Hrs=0,int Mins=0,int Secs=0;)
{
hrs=Hrs;
mins=Mins;
secs=Secs;
}
void display()
{
cout<<"hrs = "<<hrs<<endl;
cout<<"mins= "<<mins<<endl;
cout<<"secs= "<<secs<<endl;
}
Explanation / Answer
class Player { // attributes int health; int strength; int agility; // pointers to weapons and armor Pointer weapon; Pointer armor; // actions that a player knows how to perform void move(); void attackMonster(); void getTreasure(); };
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.