-Black Inspiration- -Telor-ceplox- -PROFIL- -Facebook- -Twitter- "* ikhsan_choco@ymail.com "*
Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!!----Stop Dreaming and Start Action Now...!! Jangan lupa kasih komentar demi kemajuan blog ini...!!!

3 Apr 2011

program to purchase fuel (program membeli bahan bakar)

 task group:
1. ikhsan koko irance (100180229)
2. fajar aditya (10018031)


 Well this time the program we get is a simple program purchases of fuel, so if we pay some money Ntar result is how many liters, if we ask too many liters will discharge the total price. How, from algorithm rude understand ..? Tell you what let's look a little beranalisis with the program algorithm.

Algorithm program: 
1. program called the input function.
2. (Fill command input function) displays to the user 3 choices of fuel to be purchased. if input dbawah 0 or above 3 then the program will continue to ask for input of fuel to the user. Asking the user to select purchase in liters or money. if the selection below 0 or 2 then the program will continue to ask for input. So there will be 2 times the selection is (1/2/3) and (half).  
3. program calls the function process. 4. (Command process function contents). program will remove the rest of the screen we chose earlier.

    
* If we choose 1 and then 1, then the program will display the number of liters pertamax of money we pay. if you choose 1 kemuadian 2, then the program will display the amount of money to be paid based on the input liters.
    
* If we choose 2 and then 1, then the program will display the number of liters of diesel fuel from the money we pay. if you choose 2 kemuadian 2, then the program will display the amount of money to be paid based on the input liters.
    
* If we choose 3 then 1, then the program will display the number of liters of premium from the money we pay. if you choose 3 kemuadian 2, then the program will display the amount of money to be paid based on the input liters.
How ..? understand the flow of the program ..? hehehe already common before we make a program must first understand the algorithm because the algorithm language is the most easily understood. Now we immediately see the source code:

#include
#include

using namespace std;

int main(int argc, char *argv[])
{

class spbu (){
friend ostream& opreator<<(ostream&,spbu&); friend istream& operator>>(istream&,spbu&);
public :
void banyak();
void pilihan();
void hitung_liter();
void hitung_harga();
private :
int harga;
int Biaya;
int a,b ;
float hasil ;
float premium ;
float solar ;
float pertamax ;
};
void banyak::liter(){
cout<<"Masukkan berapa liter yang dibutuhkan : "; cin>>x;
}
void banyak::pilihan(){
cout<<"pilih 1 untuk premium\n"<<<"pilih 2 untuk solar\n"<<<"pilih 3 untuk pertamax\n"<<<"Masukkan pilihan : "; cin>>y;
}
void banyak::hitung_liter(){
float i = 0.0;
while(i <= x){
i = i + 0.1;
cout<<
}
}
void banyak::hitung_harga(){
float hasil = 0.0;
float premium = 4500;
float solar = 6000;
float pertamax = 8000;
if(y == 1)
hasil = x * premium;
else if(y == 2)
hasil = x * solar;
else if(y == 3)
hasil = x * pertamax;
cout<<"harga : "<<
}
void main(){
spbu :
banyak.banyak();
banyak.harga();
banyak.hitung_liter();
banyak.hitung_harga();


system("PAUSE");
return EXIT_SUCCESS;
}

Tidak ada komentar:

Posting Komentar