Chapter 2 Programming Problem

# Chapter 2 Programming Problem - Input price Write “What...

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

Analysis Process : 1. Get user input 2. Find item name 3. Find item weight 4. Find item price 5. Prompt for ounces 6. Divide price by ounces 7. Display total Input: Output: unit_cost (real: > 0) Design Main Module Declare price as real Declare weight as real Declare item name as string Declare outputPrompt as string Declare unitCost as real Get user input Find item name Find item price Divide price by weight Display total End Main Module Input Data Module Write, “What is the price per ounce of item?”

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Input price Write, “What is the item?” Input item Write, “What is the price of the item?” Input item price End Input Data Module Find Cost per Unit Module Declare price as real Item name (text) Item weight (real: 0-1000) Item price (real: 0-100) ounces (real: 0-100) Declare item weight as real Declare item name as text Unit Cost = item price / item weight End Find Room Area Module...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern