Design an algorithm that will prompt a terminal operator for the price of an article and a pricing code. Your?
-
Design an algorithm that will prompt a terminal operator for the price of an article and a pricing code. Your program is then to calculate a discount rate according to the pricing code and print to the screen the original price of the article, the discount amount and the new discounted price. Calculate the pricing code and accompanying discount amount as follows: Pricing code Discount rate H 50% F 40% T 33% Q 25% Z 0% If the pricing code is Z, then the words ‘No discount’ are to be printed on the screen. If the pricing code is not H, F, T, Q or Z then the words ‘Invalid pricing code’ are to be printed. 2. Design a program based on the algorithm of Question 1. Helppp needed
-
Answer:
It is not clear which language you want. I assume P is the price. I assume a character variable pricing_code which stores the code The following logic or code fragment should work in C, C++, Java if(pricing_code =='H') amount=P*0.5; else if(pricing_code=='F') amount=0.6*P; else if(pricing_code=='T'') amount=0.67*P; else if(pricing_code=='Q') amount=0.75*P; else if(pricing_code=='Z') amount=P; you can print message not eligible also
Smart at Yahoo! Answers Visit the source
Related Q & A:
- What Is A Swift Code?Best solution by Yahoo! Answers
- When will the next ps3 and xbox 360 price drop be?Best solution by Yahoo! Answers
- What do I do to find a old article from a newspaper?Best solution by Yahoo! Answers
- What is the lowest price for the iPhone for a month?Best solution by Yahoo! Answers
- How do you become a crane operator?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.