Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

A well renowned hotel has three branches in miami. Namely x,y and z(Actually they gave names).Each has two types of customers. Regular and Rewardee. Also each branch has its own ratings x is given a 3 star rating while y has 5 star rating and z has 4 star rating. Each hotel has specific rates for weekend and weekdays. x charges $100 for regular customers on weekdays and $120 on weekends While it is $90 for rewardee on weekdays and $60 on weekends. Similarly y charges $130 for regular customers on weekdays and $150 on weekends. While its $100 for rewardee on weekdays and $95 on weekends.

OpenStudy (anonymous):

A well renowned hotel has three branches in miami. Namely x,y and z(Actually they gave names).Each has two types of customers. Regular and Rewardee. Also each branch has its own ratings x is given a 3 star rating while y has 5 star rating and z has 4 star rating. Each hotel has specific rates for weekend and weekdays. x charges $100 for regular customers on weekdays and $120 on weekends While it is $90 for rewardee on weekdays and $60 on weekends. Similarly y charges $130 for regular customers on weekdays and $150 on weekends. While its $100 for rewardee on weekdays and $95 on weekends. While z charges $195 for regular customers on weekdays and $150 on weekends. While its $120 for rewardee on weekdays and $90 on weekends. Now when the customer requests for a particular detail you need to find which hotel would yield the customer profit. In case of tie between hotels compare the ratings and provide the result. Input format: regular: 16Mar2010(sun), 19Mar2010(wed), 21Mar2010(Fri)

OpenStudy (anonymous):

how to implement this above program in c efficiently???

OpenStudy (anonymous):

i dont think this is a good thing to ask, perhaps you should write your own program, and ask for tips.

OpenStudy (anonymous):

I assume you when you said 'customer profit', you're supposed to compare not only the price but also the star rating? If so, then it would be tricky since different people have different tastes, and different priorities. One customer might be willing to add $50 to be able to get a better service, but another customer might not even want to add $10 for said service. So you're trying to put a value on something subjective. And to do that, you'll need a custom formula on how to compare these things. :P

OpenStudy (anonymous):

I think "customer profit" means "lowest price". The rating comes into play when there's a tie, in which case the hotel with the most stars is preferred. Anyway, I wouldn't bother thinking too much: just calculate everything and return the minimum price.

OpenStudy (anonymous):

Oh. I see. If that is so, then yours would be a good pseudocode, 'just calculate everything and return the minimum price.' :D

OpenStudy (anonymous):

You want this to happen in code, well then you first desing it in pseudocode, do a flow work and then code it. Other than that, if you have any doubts regarding to coding or even pseudocoding, perhaps I or we could help out. You trow the first rock, then we aid you with a big pile of boulders if we see the situation fit for it ;p

OpenStudy (anonymous):

i have made the code but the problem is that tie criteria..i could not implement that ..i am sharing that piece of code can anyone please tell me how to add condition of tie with rating? if(xrwe<=yrwe && xrwe<=zrwe) { f=xrwe;h="x";rate=xrating; } else if(yrwe<=xrwe && yrwe<=zrwe) { f=yrwe;h="y";rate=yrating; } else if(zrwe<=yrwe && zrwe<=xrwe) { f=zrwe;h="z";rate=zrating; } System.out.println("The cheapest would be "+f+"in hotel "+h+" with rating "+rate);

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!