Answer to Question #179121 in C++ for Vijay Raj

Question #179121

Define a class Flight with the following specifications:


Private Members a data member are


Flight number of type integer A data member Destination of type string A data member Distance of type float A data member Fuel of type float A member function CALFUEL() to calculate the value of Fuel as per the following criteria


Distance Fuel


<=1000 500


more than 1000 and <=2000 1100


more than 2000 2200


Public Members


FEEDINFO() A function FEEDINFO() to allow user to enter values for Flight Number, Destination, Distance & call function CALFUEL() to calculate the quantity of Fuel. SHOWINFO() A function SHOWINFO() to allow user to view the content of all the data members. (Implement the concept of class and objects)


1
Expert's answer
2021-04-07T20:03:15-0400
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class TEST
{
  private:
	int TestCode;
	char Description[30];
	int NoCandidate;
	int CenterReqd;
	int CALCNTR()
	{
		return NoCandidate/100+1;
	}
  public:
	void SCHDULE();
	void DISPTEST();
};
void TEST::SCHDULE()
{
	cout<<"Enter Test code ";
	cin>> TestCode;
	cout<<"Enter description ";
	gets(Description);
	cout<< "Enter no of candidates ";
	cin>>NoCandidate;
	CenterReqd=CALCNTR();
}
void TEST :: DISPTEST()
{
	cout<<"Test code "<<TestCode<<"\nDescripton "<<Description<<"\nNo of candidate "
	<<NoCandidate<<"\nCenter required "<<CenterReqd;
}
int main ()
{
	TEST obj;
	obj.SCHDULE();
	obj.DISPTEST();
	getch();
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS