i'm having trouble understanding this problem...can someone explain to me what to do?
Define a data structure named Car that stores two values: year and miles per gallon. Write a program that declares a variable of the Car type. Read in values for each field from stdin, then output the stored values to stdout.
this is what i have so far:
class Car
{
public:
int year;
int mpg;
I dont know how to declare a variable of the car type....we're going by Y. Daniel Liang's Introduction to Programming with C++ book...
Define a data structure named Car that stores two values: year and miles per gallon. Write a program that declares a variable of the Car type. Read in values for each field from stdin, then output the stored values to stdout.
this is what i have so far:
class Car
{
public:
int year;
int mpg;
I dont know how to declare a variable of the car type....we're going by Y. Daniel Liang's Introduction to Programming with C++ book...
Comment