Trying to create a class,
im new to programming and have been watching some videos on youtube
but still not quite sure how to go about this.
Some guidance to point me in the right direction would be much appreciated.
This is the assigment,
*******
Create a class that represents gas and diesel prices at a gas station. Attributes are the cost per gallon of regular, mid-grade, and premium gasoline, and the cost per gallon for diesel fuel. The class must contain the following methods/functions:
1) Default constructor with all attributes set to 0
2) Initial value constructor
3) Accessors for all attributes
4) Mutators for all attributes
5) An average cost function that returns the average cost per gallon.
6) Functions that return the total cost for a given amount of gallons. Inputs are the type of fuel (1 = regular, 2 = mid-grade, 3 = premium, 4 = diesel) and the number of gallons
*******
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#pragma once
class Station
{
int regular,midgrade,premium,diesel;
public:
Station(void);
~Station(void);
int getRegular();
void setRegular(int);
int getMidgrade();
void setMidgrade(int);
int getPremium();
void setPremium(int);
int getDiesel();
void setDiesel(int);
};
THIS IS WHATS IN MY .H FILE
|