Help with my program I'm new...
I have a program to write: Wrtie a class MPG, which has two instance variables miles and gallons, three instance methods printmpg(), setmiles(float m) and setgallons (float g) and aconstructor MPG (float m, float g).
(i) printMPG() - calculate and prints the miles per gallon based on the values held in the instance variables miles and gallons - mpg=miles/gallons.
(ii)set miles (float m) - set the miles i.e set miles to the value of the parameter passed
(iii) setgallons(float g) - set the gallons i.e sets gallons to the value of the parameter passed
(iv) MPG (Float m, float g) - the constructor which sets the instance variable miles and gallons.
This is what I have and I dont know what to do after. I am completely lose. Please help someone...
MPG (float m, float g)
I am really really lost.. Please someone help. I know this is a simple program... Thanks...
Re: Help with my program I'm new...