Week 2 Check Point2 Answer Key

Week 2 Check Point2 Answer Key - Declare ounces as integer...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Week 2 Check Point Assignment Answer Key for Chapter 2 Programming Problem CheckPoint Chapter 2 Programming Problem (Due: Day 5 – 8/16/10) Review the example in Appendix E (Posted in Course Materials) as well as the additional examples on pp. 33 and 36. Complete Ch. 2, Programming Problem 2, on p. 59. Post as an attachment to Assignment Section. (Microsoft Word format) Analysis Process : 1. Display a program title. 2. Prompt for the item name. 3. Prompt for the price of the item. 4. Prompt for the weight in pounds. 5. Prompt for ounces. 6. Convert pounds to ounces and add it to the input ounces. 7. Divide total price by ounces. 8. Display the price per ounce. Input: Item Name (string: itemName) Item Price (real: price) Item Weight in pounds (integer: pounds) Fractional ounces (integer: ounces) Output: Unit price (real: unitPrice) Design Main Module Declare itemName as String Declare price as real Declare pounds as integer
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Declare ounces as integer Declare unitPrice as real Write Unit Price Program Write This program computes the unit price for an item Call Input Data Module Call Perform Calculations Module Call Output Results Module End Program End Main Module Input Data Module Write What is the items name? Input itemName Write How much does the item cost? Input price Write What is the weight in pounds (no fractions)? Input pounds Write What are the fractional ounces? Input ounces End Input Data Module Perform Calculations Module Set ounces = 16 * pounds + ounces unitPrice = price/ounces End Perform Calculations Module Output Results Module Write The item is: , itemName Write The total price of the item is: $, price Write The unit price of the item is: $, unitPrice, per ounce End Output Results Module...
View Full Document

Page1 / 2

Week 2 Check Point2 Answer Key - Declare ounces as integer...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online