What's new

Closed Send help asap! c++ if else statement :(

Status
Not open for further replies.

-CLAY-

Honorary Poster
Joined
Jun 29, 2018
Posts
133
Reaction
304
Points
165
Need help on this problem. C++ and pseudocode or any related na maitutulog about dyan. Bigyan ko nalang po siguro ng ρrémíùm app yung makakatulog sakin talaga.


The cost of renting a room at a hotel is, say $100.00 per night. For special
occasions, such as a wedding or conference, the hotel offers a special
discount as follows: If the number of rooms booked is at least 10, the
discount is 10%; at least 20, the discount is 20%; and at least 30, the
discount is 30%. Also if rooms are booked for at least 3 days, then there
is an additional 5% discount. Write a program that prompts the user to
enter the cost of renting one room, the number of rooms booked, the
number of days the rooms are booked, and the sales tax (as a percent). The
program outputs the cost of renting one room, the discount on each room
as a percent, the number of rooms booked, the number of days the rooms
are booked, the total cost of the rooms, the sales tax, and the total billing
amount. Your program must use appropriate named constants to store
special values such as various discounts.
 
convert all the given to variables.. add values to the variables by asking the user .. then the rest will be if/else statements and mathematical expressions..

Rate of 1-10..
parang na sa 2 lng level nito ts .. no offend .. goodLcuk ..
 
convert all the given to variables.. add values to the variables by asking the user .. then the rest will be if/else statements and mathematical expressions..

Rate of 1-10..
parang na sa 2 lng level nito ts .. no offend .. goodLcuk ..
Hahaha sorry beginner palang. So pano makukuha yung sa discount? What if 10 rooms kinuha ko for 3 days? Ilan discount niya at pano ang equation niya
 
Hahaha sorry beginner palang. So pano makukuha yung sa discount? What if 10 rooms kinuha ko for 3 days? Ilan discount niya at pano ang equation niya

Sorry but this type of problem is an elementary math to be honest. Don't tell me beginner ka pa sa math? Para hindi ka malito try mo muna isolve as math problem then later on pag naintindihan mo na yung flow; dun ka na mag add ng logic. Too basic ts. May time ka pa para mag switch ng course.
 
Bakit di ka na lang mag post ng code mo sa best ng naiitindihan mo dahil para sa simple mathemathical equations nahihirapan ka na?

Baka ang mangyari ay mangongopya ka lang ng code na hindi mo nalalaman ko bakit ganyan at ganito.
 
Hahaha sorry beginner palang. So pano makukuha yung sa discount? What if 10 rooms kinuha ko for 3 days? Ilan discount niya at pano ang equation niya

Lagi kong menemention na sana ipakita nila yung progress nila.
Para hindi namin isipin na sa amin mo pinapagawa yang assignment mo.
Ipakita mo yung name variables dyan sa code na yan kung talagang naintindihan mo.
Kung hindi mo alam ang discount, tutulungan ka namin magtanong ka lang tapos may kalakip na progress mo.

May variable ka which contains the discount.
If 30+ rooms, then add 30% discount if 20, 20%, if 10, then 10% tapos meron pa yun if 3 days nagbook then additional 5%
Apply mo yun sa room cost. Search mo paano mag-apply ng discount.
 
Last edited:
Hahahaha sorry pero di ako **** sa math inaamin ko di ako magaling pero kaya kong sumabay. Ang sa tanong kasi papalabasin mo yung sales tax at the same time ilalagay mo din siya? Kasi sabi prompt eh kaya nalilito ako kung mag eenter ako ng sales tax wala ng kwenta yung discount na 10% 20% 30%
 
Lagi kong menemention na sana ipakita nila yung progress nila.
Para hindi namin isipin na sa amin mo pinapagawa yang assignment mo.
Ipakita mo yung name variables dyan sa code na yan kung talagang naintindihan mo.
Kung hindi mo alam ang discount, tutulungan ka namin magtanong ka lang tapos may kalakip na progress mo.

May variable ka which contains the discount.
If 30+ rooms, then add 30% discount if 20, 20%, if 10, then 10% tapos meron pa yun if 3 days nagbook then additional 5%
Apply mo yun sa room cost. Search mo paano mag-apply ng discount.
May nagawa naman na po ako pero di ko sure sa pseudocode kasi nalilito ako kung ex. Sa atleast 10 rooms booked. roomnumber * room cost * days * 10/100 ba or ako na mismo maglagay sa salestax niya.
 
Hahahaha sorry pero di ako **** sa math inaamin ko di ako magaling pero kaya kong sumabay. Ang sa tanong kasi papalabasin mo yung sales tax at the same time ilalagay mo din siya? Kasi sabi prompt eh kaya nalilito ako kung mag eenter ako ng sales tax wala ng kwenta yung discount na 10% 20% 30%
Iba iba kasi ang sales tax sa kada state. Sa atin 12% ang sales tax.
Iaapply mo yun after ng computation mabawas sa yung discount sa kada room.
 
May nagawa naman na po ako pero di ko sure sa pseudocode kasi nalilito ako kung ex. Sa atleast 10 rooms booked. roomnumber * room cost * days * 10/100 ba or ako na mismo maglagay sa salestax niya.

Mali. Kasi pag 11 rooms 10% pa rin ang discount. Ilagay mo sa if-else yan. If rooms is 10+, apply 10% discount, else if 20+, 20% discount, so on and so forth.
 
Mali. Kasi pag 11 rooms 10% pa rin ang discount. Ilagay mo sa if-else yan. If rooms is 10+, apply 10% discount, else if 20+, 20% discount, so on and so forth.
Oo sir bale if (numberofroom >=10 && <20). Tama po ako na salestax yun sa lalabas dyan?
 
Mali. Kasi pag 11 rooms 10% pa rin ang discount. Ilagay mo sa if-else yan. If rooms is 10+, apply 10% discount, else if 20+, 20% discount, so on and so forth.
Oo sir bale if (numberofroom >=10 && <20). Tama po ako na salestax yun sa lalabas dyan?
 
Oo sir bale if (numberofroom >=10 && <20). Tama po ako na salestax yun sa lalabas dyan?
Haaay.. Bigay ko sayo code sa part na yan, para magkaroon ka ng progress. Intindihin mo mabuti ha?

Code:
//Get the overall discount based on inputs
    if (inputRoomNum >= 30)
    {
        discount = 30;
    }
    else if (inputRoomNum >= 20)
    {
        discount = 20;
    }
    else if (inputRoomNum >= 10)
    {
        discount = 10;
    }
 
Haaay.. Bigay ko sayo code sa part na yan, para magkaroon ka ng progress. Intindihin mo mabuti ha?

Code:
//Get the overall discount based on inputs
    if (inputRoomNum >= 30)
    {
        discount = 30;
    }
    else if (inputRoomNum >= 20)
    {
        discount = 20;
    }
    else if (inputRoomNum >= 10)
    {
        discount = 10;
    }
Yup gets ko na ang ibig ko lang sabihin is yung output nyan is yung sales tax.
 
Haaay.. Bigay ko sayo code sa part na yan, para magkaroon ka ng progress. Intindihin mo mabuti ha?

Code:
//Get the overall discount based on inputs
    if (inputRoomNum >= 30)
    {
        discount = 30;
    }
    else if (inputRoomNum >= 20)
    {
        discount = 20;
    }
    else if (inputRoomNum >= 10)
    {
        discount = 10;
    }
Nagpm po ako. Pacheck nalang po dun kung tama.
 
Status
Not open for further replies.

Similar threads

Back
Top