uca082 - CSCI 105 Introduction to Computers Problem Solving Activity Algorithm GAUGE Given three products product1 product2 product3,current prices

# uca082 - CSCI 105 Introduction to Computers Problem Solving...

This preview shows page 1 - 2 out of 2 pages.

CSCI 105 – Introduction to Computers Problem Solving Activity Algorithm GAUGE . Given three products ( product1, product2, product3 ) ,current prices ( current price1, current price2, current price3 ) and old prices ( old price1, old price2, old price3 ) for each product. Calculate algebraic difference ( alg_diff) and percentage difference (pc_diff ). The product names are Strings and current and old prices are real numbers. 1. [Get product names and prices ] Read olive oil, gallon of milk, coffee. 2. [Calculate algebraic difference] Algebraic difference = Current price - Old price 3. [Calculate percentage difference] Percentage difference =(Current price - Old price) / old price * 100% 4. [Print the calculation and other information you want to print ] ITEM PURCHASED: item PRICE THIS MONTH: \$current_price PRICE LAST MONTH: \$old_price ALGEBRAIC DIFFERENCE: \$alg_diff PERCENTAGE DIFFERENCE: pc_diff% 5. [ Finished ] Exit Step item