Need Help? Contact the Espiya Helpdesk. CLICK HERE


Author Topic: Help naman guys about c++  (Read 1623 times)

BebeAdik

  • Active - First Star
  • *
  • Posts: 70
  • Karma 0
  • Once a Adik always an Adik!
Help naman guys about c++
« on: 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! :(

Skrappy <3

  • Espiya Fuckaroo <3
  • 2009 Cavaliers
  • Active - Top Level
  • *
  • Posts: 972
  • Karma 8
  • Gender: Male
  • Sex is a part of nature. I go along with nature.
Re: Help naman guys about c++
« Reply #1 on: September 02, 2013, 06:57:17 am »
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

tsukune

  • 2008 Guardians
  • Active - First Star
  • *
  • Posts: 78
  • Karma 0
Re: Help naman guys about c++
« Reply #2 on: September 02, 2013, 07:01:11 am »
int GG;int PRI; <<<<<<<ano laman ng mga ito?
switch(days) // replace it into switch(room)

tsukune

  • 2008 Guardians
  • Active - First Star
  • *
  • Posts: 78
  • Karma 0
Re: Help naman guys about c++
« Reply #3 on: September 02, 2013, 07:12:38 am »
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! :(

BebeAdik

  • Active - First Star
  • *
  • Posts: 70
  • Karma 0
  • Once a Adik always an Adik!
Re: Help naman guys about c++
« Reply #4 on: September 02, 2013, 07:52:13 am »
LAKING TULONG NYO GUYS! SALAMAT :) :D KAYA ANG SARAP MAG-ESPIYA EH! :D

Skrappy <3

  • Espiya Fuckaroo <3
  • 2009 Cavaliers
  • Active - Top Level
  • *
  • Posts: 972
  • Karma 8
  • Gender: Male
  • Sex is a part of nature. I go along with nature.
Re: Help naman guys about c++
« Reply #5 on: September 03, 2013, 01:02:00 pm »
aun nasagot na sorry brotha kasi cp gamit ko haha di ko mamodify yung code mo pero may tumulong na naman. ;) enjoy with coding.