Espiya
Espiya Technology Boards => Computer Help => : BebeAdik September 02, 2013, 06:43:12 AM
-
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
int days;
int SNSD=18000;
int GG;
int PRI;
int Total;
int room;
cout<<"Three types of room"<<endl;
cout<<"\t[1] SNSD Room \n \t[2] GG Room \t[3] PRI Room \n";
cout<<" Type of room: ";
cin>>room;
cout<<"How many days: ";
cin>>days;
switch(days)
{
case 1:
cout<<"Service Charge = 2500"<<endl;
cout<<" Hanbok(Korean Dress) = 3500"<<endl;
cout<<"Futons (5 beds) =6000"<<endl;
cout<<"Electricity Fee = 4000"<<endl;
Total=days*SNSD;
cout<<"The total is: ";
break;
case 2:
Total=GG*days;
cout<<"The total amount is: "<<Total<<endl;
break;
case 3:
Total=PRI*days;
cout<<"The total amount is: "<<Total<<endl;
break;
}
system("pause>0");
return 0;
}
// ayan na nagawa ko, ang porblema ko hindi tugma yung FINAL FEE ko. Atsaka hindi lumalabas yung mga service charge ko
// PLEASE GUYS HELP! :(
-
Switch room hindi switch days then each case malagay ka ng
Cin ng days then dun sa chice ng room if magaavail ng extra
service like electricity fees ipasok mo sa loop then
if else then re loop or mas maganda mag function call ka nalang
para sa extra services. Para mas organized ang codes mo
-
int GG;int PRI; <<<<<<<ano laman ng mga ito?
switch(days) // replace it into switch(room)
-
try natin i modify
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
int days;
int SNSD=18000;
int GG; //dapat may value ...default i think is zero
int PRI; // dapat may value ...default i think is zero
int Total;
int room;
cout<<"Three types of room"<<endl;
cout<<"\t[1] SNSD Room \n \t[2] GG Room \t[3] PRI Room \n";
cout<<" Type of room: ";
cin>>room;
cout<<"How many days: ";
cin>>days;
switch(days) //switch(room)
{
case 1:
cout<<"Service Charge = 2500"<<endl;
cout<<" Hanbok(Korean Dress) = 3500"<<endl;
cout<<"Futons (5 beds) =6000"<<endl;
cout<<"Electricity Fee = 4000"<<endl;
Total=days*SNSD; //kasama sa computation ang mga charges parang ganito Total = (days*SNSD)+ ...+ fees and charges
cout<<"The total is: "<<total;
break;
case 2:
cout<<"Service Charge = 2500"<<endl; // kung ito rin yun mga fees and charges
cout<<" Hanbok(Korean Dress) = 3500"<<endl;
cout<<"Futons (5 beds) =6000"<<endl;
cout<<"Electricity Fee = 4000"<<endl;
Total=GG*days;same kanina
cout<<"The total amount is: "<<Total<<endl;
break;
case 3:
fees and charges
Total=PRI*days; same kanina
cout<<"The total amount is: "<<Total<<endl;
break;
}
system("pause>0");
return 0;
}
// ayan na nagawa ko, ang porblema ko hindi tugma yung FINAL FEE ko. Atsaka hindi lumalabas yung mga service charge ko
// PLEASE GUYS HELP! :(
-
LAKING TULONG NYO GUYS! SALAMAT :) :D KAYA ANG SARAP MAG-ESPIYA EH! :D
-
aun nasagot na sorry brotha kasi cp gamit ko haha di ko mamodify yung code mo pero may tumulong na naman. ;) enjoy with coding.