Click here to Skip to main content
15,909,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionplz ans this program Pin
Member 1477930521-Mar-20 16:53
Member 1477930521-Mar-20 16:53 
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.

AnswerRe: plz ans this program Pin
Richard MacCutchan21-Mar-20 21:51
mveRichard MacCutchan21-Mar-20 21:51 
AnswerRe: plz ans this program Pin
Victor Nijegorodov22-Mar-20 0:42
Victor Nijegorodov22-Mar-20 0:42 
QuestionRe: plz ans this program Pin
David Crow23-Mar-20 2:39
David Crow23-Mar-20 2:39 
QuestionBaffling Error! Pin
Richard Andrew x6421-Mar-20 11:11
professionalRichard Andrew x6421-Mar-20 11:11 
AnswerRe: Baffling Error! Pin
leon de boer21-Mar-20 19:11
leon de boer21-Mar-20 19:11 
AnswerRe: Baffling Error! Pin
Randor 22-Mar-20 3:20
professional Randor 22-Mar-20 3:20 
GeneralRe: Baffling Error! Pin
Richard Andrew x6422-Mar-20 4:40
professionalRichard Andrew x6422-Mar-20 4:40 
QuestionHow to make flowchart for matrix on C language? Pin
Member 1477750619-Mar-20 8:39
Member 1477750619-Mar-20 8:39 
AnswerRe: How to make flowchart for matrix on C language? Pin
jeron119-Mar-20 11:10
jeron119-Mar-20 11:10 
AnswerRe: How to make flowchart for matrix on C language? Pin
leon de boer19-Mar-20 15:09
leon de boer19-Mar-20 15:09 
GeneralVC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
Member 1326109416-Mar-20 20:35
Member 1326109416-Mar-20 20:35 
AnswerRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
OriginalGriff16-Mar-20 20:47
mveOriginalGriff16-Mar-20 20:47 
GeneralRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
Richard MacCutchan17-Mar-20 2:15
mveRichard MacCutchan17-Mar-20 2:15 
GeneralRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
leon de boer17-Mar-20 5:04
leon de boer17-Mar-20 5:04 
Questionparsing bitmap files (2) Pin
Calin Negru14-Mar-20 21:53
Calin Negru14-Mar-20 21:53 
AnswerRe: parsing bitmap files (2) Pin
Richard MacCutchan14-Mar-20 22:13
mveRichard MacCutchan14-Mar-20 22:13 
GeneralRe: parsing bitmap files (2) Pin
Calin Negru15-Mar-20 3:09
Calin Negru15-Mar-20 3:09 
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 3:34
mveRichard MacCutchan15-Mar-20 3:34 
GeneralRe: parsing bitmap files (2) Pin
Calin Negru15-Mar-20 4:05
Calin Negru15-Mar-20 4:05 
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 4:24
mveRichard MacCutchan15-Mar-20 4:24 
GeneralRe: parsing bitmap files (2) Pin
Calin Negru15-Mar-20 7:02
Calin Negru15-Mar-20 7:02 
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 7:04
mveRichard MacCutchan15-Mar-20 7:04 
AnswerRe: parsing bitmap files (2) Pin
leon de boer15-Mar-20 0:25
leon de boer15-Mar-20 0:25 
AnswerRe: parsing bitmap files (2) Pin
Calin Negru15-Mar-20 1:59
Calin Negru15-Mar-20 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.