plz ans this program
-
Write and test the following function that attempts to remove all occurrences of an item from an array:
intremove(int a[], int& n, int x)
The function searches the first n elements of the array a for the item x. If an x is found, it is removed, all the elements above that position are shifted down, the
array size n is decremented. This is repeated until all occurrences of x in the array are removed and then the total number of elements removed is returned. If x is not
.Write your own Car class. The class data should include:
I. make (using an array of char),
II. year,
III. petrol,
IV. tankSize,
V. mpg (miles per gallon),
VI. owner (using an array of char).
The functions should include:
I. display,
II. fillPetrol: pass number of gallons as a parameter and return gallons actually input (before full),
III. drive: pass distance as a parameter and return distance actually travelled (stopping if empty),
IV. changeOwner (passing new name as a parameter).
V. You should also have two constructors (one with and one without parameters) and any other functions needed, such as full() and empty(). (Should these 2 functions be public or private?)
VI. Put code in the constructors to show when each is called (cout<< “Constructor X called”;).
VII. Write a program to create and use a Car object, making sure it calls all the public functions. -
Write and test the following function that attempts to remove all occurrences of an item from an array:
intremove(int a[], int& n, int x)
The function searches the first n elements of the array a for the item x. If an x is found, it is removed, all the elements above that position are shifted down, the
array size n is decremented. This is repeated until all occurrences of x in the array are removed and then the total number of elements removed is returned. If x is not
.Write your own Car class. The class data should include:
I. make (using an array of char),
II. year,
III. petrol,
IV. tankSize,
V. mpg (miles per gallon),
VI. owner (using an array of char).
The functions should include:
I. display,
II. fillPetrol: pass number of gallons as a parameter and return gallons actually input (before full),
III. drive: pass distance as a parameter and return distance actually travelled (stopping if empty),
IV. changeOwner (passing new name as a parameter).
V. You should also have two constructors (one with and one without parameters) and any other functions needed, such as full() and empty(). (Should these 2 functions be public or private?)
VI. Put code in the constructors to show when each is called (cout<< “Constructor X called”;).
VII. Write a program to create and use a Car object, making sure it calls all the public functions.We are happy to help people who have problems with code that they have written. However, we are not here to do their homework. Homework assignments are provided in order to test your knowledge, so it would not help you to be assessed on someone else's work. Give it a try, it may not be as difficult as you think.
-
Write and test the following function that attempts to remove all occurrences of an item from an array:
intremove(int a[], int& n, int x)
The function searches the first n elements of the array a for the item x. If an x is found, it is removed, all the elements above that position are shifted down, the
array size n is decremented. This is repeated until all occurrences of x in the array are removed and then the total number of elements removed is returned. If x is not
.Write your own Car class. The class data should include:
I. make (using an array of char),
II. year,
III. petrol,
IV. tankSize,
V. mpg (miles per gallon),
VI. owner (using an array of char).
The functions should include:
I. display,
II. fillPetrol: pass number of gallons as a parameter and return gallons actually input (before full),
III. drive: pass distance as a parameter and return distance actually travelled (stopping if empty),
IV. changeOwner (passing new name as a parameter).
V. You should also have two constructors (one with and one without parameters) and any other functions needed, such as full() and empty(). (Should these 2 functions be public or private?)
VI. Put code in the constructors to show when each is called (cout<< “Constructor X called”;).
VII. Write a program to create and use a Car object, making sure it calls all the public functions.I agree with Richard. Here is a very good opinion regarding the homework: [Visual C++ General: Can you help me with my homework assignment?](http://forums.codeguru.com/showthread.php?366302-Visual-C-General-Can-you-help-me-with-my-homework-assignment&p=1279572&highlight=homework#post1279572)
-
Write and test the following function that attempts to remove all occurrences of an item from an array:
intremove(int a[], int& n, int x)
The function searches the first n elements of the array a for the item x. If an x is found, it is removed, all the elements above that position are shifted down, the
array size n is decremented. This is repeated until all occurrences of x in the array are removed and then the total number of elements removed is returned. If x is not
.Write your own Car class. The class data should include:
I. make (using an array of char),
II. year,
III. petrol,
IV. tankSize,
V. mpg (miles per gallon),
VI. owner (using an array of char).
The functions should include:
I. display,
II. fillPetrol: pass number of gallons as a parameter and return gallons actually input (before full),
III. drive: pass distance as a parameter and return distance actually travelled (stopping if empty),
IV. changeOwner (passing new name as a parameter).
V. You should also have two constructors (one with and one without parameters) and any other functions needed, such as full() and empty(). (Should these 2 functions be public or private?)
VI. Put code in the constructors to show when each is called (cout<< “Constructor X called”;).
VII. Write a program to create and use a Car object, making sure it calls all the public functions.It's all done. I even went so far as to grade it for you. Definitely a solid B. How would you like it delivered? :rolleyes:
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles