[Help] C++ Object Oriented Programming

Solved thank you
Last edited on
closed account (DSLq5Di1)
Would I be correct in assuming you were provided the bicycle class and the comments in main are excercises to perform?

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
29
30
31
32
33
34
35
36
37
38
39
40
int main ()
{
    // Create 2 Bicycle references
    // Create 2 String references for owners' namesq
    // Create 2 integers for license numbers

    string s1("Kenny McCormick");
    int num1 = 12345;

    string s2("Bruce Wayne");
    int num2 = 80085;

    // Bicycle 1 is owned by Kenny McCormick, license number 12345
    // Use the your full name and a license number for Bicycle 2
    // This data must be stored in the above String and integer variables.

    // Create the first Bicycle object with the default Bicycle constructor
    Bicycle b1;

    // Set the owner's name and license number with set methods using
    // the variables you created as arguments
    b1.setOwnerName(s1);
    b1.setLicenseNumber(num1);

    // Create a second Bicycle object with the other Bicycle constructor
    // Use the variables you created as arguments
    Bicycle b2(s2, num2);

    // Output each owner's name and license number in cout statements
    // using the objects and the get methods. For example: bike1.getOwnerName()
    cout << "Bicycle #1" << endl;
    cout << "Name : " << b1.getOwnerName() << endl;
    cout << "License Number : " << b1.getLicenseNumber() << endl;

    cout << "Bicycle #2" << endl;
    cout << "Name : " << b2.getOwnerName() << endl;
    cout << "License Number : " << b2.getLicenseNumber() << endl;

    return 0;
} 
Topic archived. No new replies allowed.