I need serious help for C++ program :)

that is a pretty big first assignment almost feels overwhelming,

what you may want to do is create a number of classes lets say a car class,the car class should contain multiple children of cars such as Jaguar,Edsel etc the car class should contain attributes such as model number,year and other attributes according to your assignment,it should also contain a cylinder class use composition for this(basically just have a class as one of your class members exactly the same as you would do with the built in types char,int you are just using your own type)

as mentioned above cars will need cylinders so it's a good idea to maybe create a cylinder class give that class attributes

so yeah polymorphism,composition,classes,branch(conditions) is what you need to read up for for this project,

as a beginner it's quite a challenging assignment just because of the size not really it's difficulty level.

start the program and post the code what you have attempted here and members of the forum will gladly help :)
closed account (SECMoG1T)
this isn't a complete solution but you'll get the idea.

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>

int main()
{
    int model_choice=0, man_year=0;

    ///1. get the make of the car
    std::cout<<"choose your car model\n\n"\
             <<" 1) Edsel\n 2) Austin\n 3) Catepillar\n 4) Jaguar\n\n    :";

    std::cin>>model_choice;

    while(model_choice<1 || model_choice>4)
    {
       std::cout<<"    Only the above four are allowed, retry>>";
        std::cin>>model_choice;
    }

    ///2. get the year of manufacture
    std::cout<<"\n\n Enter the year of manufacture [1998 - 2018] : ";
    std::cin>>man_year;

    while(man_year< 1998 || man_year > 2018)
    {
        std::cout<<" the year of manufacture must be within [1998 - 2018], retry >> ";
        std::cin>>man_year;
    }

    char model;
    int  cylider_num=0;

    auto get_cyl_num = [](int lower,int upper)
                          {
                              int cylinders=0;

                              std::cout<<"\n Enter the number of cylinders for your car: ";
                              std::cin>>cylinders;

                              while(cylinders < lower || cylinders > upper)
                              {
                                  std::cout<<" the selected model can only have between ["<<lower<<" - "<<upper<<"] cylinders, retry>> ";
                                  std::cin>>cylinders;
                              }

                              return cylinders;
                          };

    ///3. get the number of cylinders

    switch(model_choice)
    {
        case 1:{ model='E';
                 cylider_num = get_cyl_num(6,8);///edsel 6 to 8 cylinders;
               } break;

        case 2:{ model='A';
                 cylider_num = get_cyl_num(4,6);///austin 4 to 6 cylinders;
               } break;

        case 3:{ model='C';
                 cylider_num = get_cyl_num(15,20);///Catepillar 15 to 20 cylinders;
               } break;

        case 4:{ model='J';
                 cylider_num = get_cyl_num(6,12);///jaguar 6 to 12 cylinders;
               } break;

        default: break;
    }

    std::cout<<"\n\n your car requires filter model : <"<<model<<(man_year%100)<<cylider_num<<">\n";
}
Please DON'T delete your question once you've got an answer. It makes the thread useless as a learning resource for others. It's a selfish abuse of this forum.
agreed Mikey,I honestly believe it should be a bannable offence.
Topic archived. No new replies allowed.