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
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '08
  • Knautz,T
  • $3.30, $4.99, $5.29, $8.59, $8.49

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes