CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Shape {
private:
unsigned int id;
string name;
string color;
int dimension;
public:
Shape();
void UserInput();
void Show() const;
unsigned int GetID() { return id; }
static unsigned int ID;
};
unsigned int Shape::ID = 0;
void Shape::UserInput() {
cout << "Input shape name: ";
cin >> name;
cout << "\nInput shape color: ";
cin >> color;
cout << "\nInput dimension: ";
cin >> dimension;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run