Hi all i'm newbie in C++ so i got some questions because our teacher is sooo stupid and he never answer in any question T_T
first of all hi to all! 2nd i created some programs and i want you to tell me if they got any problem cause my computer can't run the borland cobiler so i've got huge problem here with my college, and 3rd sorry for my poor english.
I want to create a class named car,
1) The attributes of order car will be the final speed, the acceleration and the consumption
2) create a layout that accept prices for the all attributes of age-group and it cedes him in them. Layout it will give in absentia prices 0 in the all attributes
3) create a method changeMaxSpeed which will change the speed and will have it as the new final speed
4) create a method printCar which will print the three attributes of car
5) create a table from ten cars and you call the layout of age-group in order to take initial prices the cars
στ) Use the changeMaxSpeed in order to you change final speed of car
6) Call ten times printCar in order to are printed the attributes of ten cars
so far i got this:
class car{
private:
int final_speed;
int acceleration;
int consumption;
public:
car(int a=0, int b=0, int g=0){
final_speed=a;
acceleration=b;
consumption=g;
~car(){}
void changemaxspeed(int a){
final_speed=a;
}
void printCar(){
cout<<"final speed is: "<<final_speed<<endl;
cout<<"acceleration is: "<<acceleration<<endl;
cout<<"consumption is: "<<consumption<<endl;
}
};
int main(){
car c;
const N=10;
int cars[N];
for(int i=0;i<N;i++){
if u would answer today i will appreciate it really, and some programs that ive done so far is this:
1) it wants to see if a name is with "man" or "woman" examble batman.
and it wants to return a price of bool and print the 1st "bat" and 2nd "man" or if there's no bat or man in the string it will print just the whole word.
is this works? or i'm really newbie at c++?
(PS: it want only the function not the main)
2) it want's to open a txt file named titles.txt and in this exist 4-5 names that some of them got the Ph.D. in the end and it wants to read and save it in 3 tables with 1000 size and after that to check what name is with "Ph.D." and save that names into a new file named "doctorates.txt" !
this is what ive got so far is this working?
Sorry friend, I contribute to this site during down time at work and since I AM the Sys Admin it would be a little hypocritical for me to be jumping onto Facebook.