If and Else statements.

Nov 3, 2010 at 3:59am
I have a problem. I need to write a program that gives me the final price of a watch after the taxes have been added and discounts subtracted. There are a total of 3 watches each with different prices. I need to use if and else statements so I can obtain a desired output depending on the watch I chose. My problem is structuring the code. My professor does little to explain I was hoping someone could assist me. It's very difficult to explain without showing the actual code.

Nov 3, 2010 at 4:51am
It's very difficult to explain without showing the actual code.


So why not show us the code? Afraid we'll steal it? ;P
Nov 3, 2010 at 6:55am
What i got from ur explanation is this:

you need to calculate final price of clock in case you care given with the initial price(without taxes and discount).

You need not to write it using if-else
just make a function and pass the initial price of the watch as an argument and the function will return u the final price.
the function may be called any number of times with different initial price


Cheers........
Nov 3, 2010 at 11:55am
Do I just copy paste it in here? It's a little big. When I copy paste it it get all jumbled and weird. I see other people minimize it to fit the page. How?
Nov 3, 2010 at 3:56pm
why u require if else statements ....u just need to make a function and deduct tax and discount to get job done.....as per ur question statement
Nov 3, 2010 at 9:49pm
My thoughts exactly but the professor requires me to use them.
Nov 9, 2010 at 4:19pm
i think ur professor wants something else rather than simple calculation.....

just explain ur problem in details....
Nov 10, 2010 at 2:19pm
how can people here helped you when you haven't post your code's. actually if and else statement are just conditional statements. you can used this easily as long as you understand the used of this statement. for you to learn see more sample programs from online tutors or even in here.
Topic archived. No new replies allowed.