week two cost program in pseudocode

week two cost program in pseudocode - Process 1 2 3 4 5 6 7...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Process: 1. Get user input 2. Input item name 3. Input price of item ($1000 for 1lb) 4. Divide price by ounces and pounds (1lb for $1000 then 1oz. = $62.5) 5. Prompt for number of ounces or pounds 6. Multiply the dividend unit price by number of oz. or multiply number of pounds by item price. 7. Display total unit price per oz. or lb. Input: Item name (coffee beans) Price ($1000 per 1lb bag) Output: Total_cost (real: > 0) Main Module Declare item price as real Declare unit price per unit of weight as real Declare number of units as real Declare units (oz. or lb.) needed as real Declare output prompt as string Declare total cost as real Get user input Input item name Input price of item Divide price by ounces (1lb for $1000 and 1 oz. for $62.50)
Image of page 1

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

View Full Document Right Arrow Icon
Multiply # of pounds by item price Prompt for ounces or pounds Multiply the dividend unit price by number of oz. Multiply the number of pounds by the item price. Display total unit price per oz. or lb. End main module Input Data Module Write, “What is the name of the item?” Item name Write, “What is the price of the item?”
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern