You are on page 1of 6

#include<iostream>

using namespace std;


main()
{
char name [20];

cout<<"enter your name: ";


cin.getline(name,20);

cout<<"hello " <<name<< " wlecome to uitm malaysia!!";

#include<iostream>
using namespace std;
main()
{
char name[20];
int park_option,total_price,no_adult,no_child;

cout<<"welcome to funfun lagoon!!" <<endl;


cout<<"Enter your name: ";
cin.getline(name,20);

cout<<"enter park option '1' for junglepark and '2' for water park :
";
cin>>park_option;

cout<<"\n\nenter no of adult : ";


cin>>no_adult;

cout<<"\n\nenter no of child : ";


cin>>no_child;

if(park_option==1)
{
total_price=(40.00*no_adult)+(25.00*no_child);

}
if(park_option==2)
{
total_price=(35.00*no_adult)+(25.00*no_child);
}
else
{
cout<<"invalid";
}

cout<<"\n\nyou have choosen: " <<park_option;


cout<<"\n\nyour payment is RM : " <<total_price;
}

#include<iostream>
using namespace std;

main()
{
int max_num,num1,num2,num3;

cout<<"enter your first number: ";


cin>>num1;

cout<<"enter your second number: ";


cin>>num2;

cout<<"enter your third number: ";


cin>>num1;

if(num1>=num2&&num3)
{
max_num=num1;
}
else if(num2>=num1&&num3)
{
max_num=num2;
}
else if(num3>=num2&&num1)
{
max_num=num3;
}

cout<<"maximum number: "<<max_num;


}

#include<iostream>
using namespace std;
main()
{
char name[20],type_of_room,mode_of_payment;
int number_of_days,disc,net_price,price,price_gst;

cout<<"enter your name: ";


cin.getline(name,20);

cout<<"\nchoose your room 's' for superior 'd' for deluxe : ";
cin>>type_of_room;

cout<<"\nenter number of days: ";


cin>>number_of_days;

cout<<"\nenter mode of payment, '$' for cash 'c' for credit: ";
cin>>mode_of_payment;

if(type_of_room=='s'&& mode_of_payment=='$')

{
price=305.00*number_of_days;
price_gst=305.00*0.06;
net_price=price-price_gst;
}

else if(type_of_room=='s'&& mode_of_payment=='c')


{
price=305.00*number_of_days;
price_gst=305.00*0.06;
disc=price*0.2;
net_price=disc-price_gst;

}
else if(type_of_room=='d'&& mode_of_payment=='$')
{

price=230.00*number_of_days;
price_gst=230.00*0.06;
net_price=price-price_gst;
}
else if(type_of_room=='d'&& mode_of_payment=='c')
{
price=230.00*number_of_days;
price_gst=230.00*0.06;
disc=price*0.2;
net_price=disc-price_gst;
}

cout<<"\nwelcome to Avanue guest house ";


cout<<"\nGuest Name : "<<name;
cout<<"\nType of Room: "<<type_of_room;
cout<<"\nNumber of day(s): " <<number_of_days;

cout<<"\nPayment: "<<price;
cout<<"\nDiscount: "<<disc;
cout<<"\nGST: "<<price_gst;
cout<<"\nnet price(RM): "<<net_price;

You might also like