Not sure how to do this...

Naitryn's Avatar, Join Date: Feb 2011
Newbie Member
I've done some C++ programming work but never one like this so I'm a little unsure of what to do. Here's the problem:

Marcy's Department store is having a BoGoHo. The store manager wants a program that allows the salesclerk to enter the prices of two items. The program should both calculate and display the total amount the customer owes. The half off should always be taken on the item having the lowest price.

I don't exactly know how to get it to calculate and take the half price off the lesser item. How exactly am I supposed to do this?
Umairajmal's Avatar, Join Date: Dec 2010
Go4Expert Member
Post your code then we can help.
xpi0t0s's Avatar, Join Date: Aug 2004
How would you do it on paper? That's always a good way to start figuring out how to do it. Take a few examples and work them out, and after you've done a few you should start getting the hang of it and be able to determine a step by step approach. Let's say the two items are $100 and $50, so the price is $100+half of $50 which is $125. Or maybe the items are $10 and $20, in which case the cost is $20+half of $10 which is $25. What is the cost of two items $50 and $60?

Don't be afraid to create new variables. If the items are in item1 and item2, you might want to create intermediate variables costL and costH.