What is by-product pricing?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.