Let me try
Ans to Q1:
- Random(n) will range from 0 to 14
- After adding 10 guesme = random(n) + 10; to it the max value can be 24 (14 + 10) and the min value can be 10 (0 + 10)
Ans to Q2
I am not sure how it ended up with 70, it must be 72
char Pub[12]; takes 12 bytes
double Turover; takes 8 bytes
char CITY [20]; takes 20 bytes
float Employees; takes 4 bytes
int Acode; takes 4 bytes
char Aname[20]; takes 20 bytes
float Amount; takes 4 bytes
As the author class inherits branch and publisher, variables are also part of it. Hence the size of Author should be
12 + 8 + 20 + 4 + 4 + 20 + 4 = 72
Edit: My bad, integer -32768 to 32767 range should consume only 2 byte. Hence 12 + 8 + 20 + 4 + 2 + 20 + 4 = 70


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks