Hi all, so at the moment Im doing some assignments involving C++ classes, I think I understand them fairly okay now, but this is a bit challenging none the less for me.
The task is to write a similar program to the one I found online and I planned to use it as a starting point to build my own, the problem is that theres only a picture and the guy didnt include the source code, so Im trying to back engineer it to understand how he did his to do mine using just the output of the program - if that makes sense?
So his program looks something like this:
1 2 3 4 5 6 7 8 9 10 11
|
#include "Computer.h"
using namespace std;
int main(){
Computer Dell ("XPS 13");
system("pause");
return 0;
}
|
and the output of this program would look like this:
Computer name -> XPS 13
RAM -> 4 GB
SSD -> 128 GB
Price -> 999.99 USD
So essentially Im trying to understand how to do the above, using classes. The RAM, SSD, Price values would be in 'private' and would have to be set using get/set.
And the "Computer.h" would further include "Computer.cpp" for the functions.
Ive basically made no progress on this myself, and wanted to see if someone smarter than me could give me a little nudge in the right direction to start.
Thank you for your help.