Have a computer science exam tomorrow, need help with a couple of questions
Q. If n given by user is 15, what maximum and minimum values the program can display?
void main()
{
int n, guessme;
randomize();
cin >> n;
guesme = random(n) + 10;
cout << guessme;
}
Answer is 24, and 10. I need the explanation.
Q. How many bytes will be required by an object belonging to class AUTHOR?
class PUBLISHER
{
char Pub[12];
double Turover;
protected:
void Register();
public:
PUBLISHER();
void Enter();
void Display();
};
class BRANCH
{
char CITY [20];
protected:
float Employees;
public:
BRANCH();
void Haveit();
void Giveit();
};
class AUTHOR: private BRANCH, publuc PUBLISHER
{
int Acode;
char Aname[20];
float Amount;
public:
AUTHOR();
Void Start();
Void Show();
};
Answer is 70, just need the explanation.
Thanks a lot.
Q. If n given by user is 15, what maximum and minimum values the program can display?
void main()
{
int n, guessme;
randomize();
cin >> n;
guesme = random(n) + 10;
cout << guessme;
}
Answer is 24, and 10. I need the explanation.
Q. How many bytes will be required by an object belonging to class AUTHOR?
class PUBLISHER
{
char Pub[12];
double Turover;
protected:
void Register();
public:
PUBLISHER();
void Enter();
void Display();
};
class BRANCH
{
char CITY [20];
protected:
float Employees;
public:
BRANCH();
void Haveit();
void Giveit();
};
class AUTHOR: private BRANCH, publuc PUBLISHER
{
int Acode;
char Aname[20];
float Amount;
public:
AUTHOR();
Void Start();
Void Show();
};
Answer is 70, just need the explanation.
Thanks a lot.