Name of group :
1. Nurul Hidayah (10018095)
2. Sri Rustiningsih (10018092)
3. Isliyati (10018091)
Simulation of fuel purchases
Declaration
Liter: integer;
Money: integer;
Type of fuel: String;
Description
Read (Liter);
Options Liter
1. 1 Liter 5000
2. 2 Liter 10 000
3. 3 Liter 15 000
4. 4 Litre 20 000
End {select}
Write {L}
Program
# include (iostream)
Class fuel {
Public:
void input ();
void process ();
void output ();
Private:
int output;
int liter;
};
void fuel:: insert () {
cout <<"enter the price of fuel:";
cin>> output;
cout <<"type of fuel:"; cin>> output;
}
void fuel:: process () {
output = liter * money
}
void fuel:: output () {
cout <<"the output of the process:" <<result;
}
int main (int argc, char * argv []) {
Fuel X;
X input ();
X process ();
X output ();
System ("pause");
Return exit_success;
}
/ * Import to jeliot: * /
{Public class fuel
void static void input ();
void static void process ();
void static void output ();
private int output;
private int liter;
};
Public void input();{
system.out.print ("enter the price of fuel")
output = input.readint ();
system.out.print ("type of fuel");
output = input.readint ();
}
Public void process () {
output = liter * money
}
Public void output () {
system.out.print ("output of the process : " + result);
}
Public static void main () {
X = new fuel fuel ();
X.input ();
X.procces ();
X.output ();
}
}
Tidak ada komentar:
Posting Komentar