Question

Each of the following Programming Challenges can be solved by a program that performs three basic...

Each of the following Programming Challenges can be solved by a program that performs three basic tasks—Input Data, Process Data, and Output Results. For each problem, use pseudocode to design a suitable program to solve it. Be sure to identify the data type of each variable used.

The manager of the Super Supermarket would like to be able to compute the unit price for products sold there. To do this, the program should input the name and price of an item per pound and its weight in pounds and ounces. Then it should determine and display the unit price (the price per ounce) of that item and the total cost of the amount purchased. You will need the following variables:

       ItemName      Pounds        Ounces
       PoundPrice    TotalPrice    UnitPrice

You will need the following formulas:

       UnitPrice = PoundPrice/16
       TotalPrice = PoundPrice * (Pounds + Ounces/16)

Homework Answers

Answer #1

Pseudocode

   START

       DECLARE STRING ItemName
       DECLARE INTEGER Pounds
       DECLARE INTEGER Ounces
       DECLARE FLOAT PoundPrice
       DECLARE FLOAT TotalPrice
       DECLARE FLOAT UnitPrice

       INPUT ItemName
       INPUT Pounds
       INPUT Ounces
       INPUT PoundPrice

       UnitPrice = PoundPrice / 16
       TotalPrice = PoundPrice * (Pounds + Ounces/16)

       PRINT "Unit Price: " + UnitPrice
       PRINT "Total Price: " + TotalPrice

   END

      

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Assembly Programming in MIPS Write a program in MIPS assembler that performs the following computations: Prompts...
Assembly Programming in MIPS Write a program in MIPS assembler that performs the following computations: Prompts the user to enter two integers and stores the smaller one in the first data memory word (with the lowest address) and the larger one in the second data memory word. Then divides the larger word by the smaller one in integer and stores the integer quotient in the third data memory word and the remainder in the fourth data memory word. Finally, it...
COSC 1436 Programming Assignment 2 Programming Assignment 2 Refactoring is the process of taking existing code...
COSC 1436 Programming Assignment 2 Programming Assignment 2 Refactoring is the process of taking existing code and improving its design without changing the functionality. In this programming assignment, you are going to take your code from Programming Assignment 1 and refactor it so that it uses functions. The program should still do the following:  Get the name of a student  Get the name of three assignments  Get the grade of three assignments as integers  Calculates the...
This is a Java program Program Description You work for a local cell phone company and...
This is a Java program Program Description You work for a local cell phone company and have been asked to write a program to calculate the price of a cell phone data plan being purchased by a customer. The program should do the following tasks: Display a menu of the data plans that are available to be purchased. Read in the user’s selection from the menu.  Input Validation: If the user enters an invalid option, the program should display an error...
You are to write a C++ program to produce an inventory report for a local company....
You are to write a C++ program to produce an inventory report for a local company. Your input will be item name, item number, quantity, price per item, safe stock value. The following shows which columns the input will be in: item name             item number         quantity                  price                      safe stock 20 chars                 5 char                     3 char                      6 chars                 3 chars Output will be as follows: item number         item name    quantity   price     price*quantity   %ofStock    flag You will put a symbol in the...
Problem 1 (Defining products and Creating a Menu) Write a program called a2_p1.py that asks a...
Problem 1 (Defining products and Creating a Menu) Write a program called a2_p1.py that asks a shop owner for product information and creates a menu system that allows customers to purchase multiple products of varying quantities. The program should start by asking the shop owner’s name (string) and company name (string). Next it should ask for three (3) products (strings), their prices (int – not ideal, but for now we will keep it this way), and the number of products...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using the following guidelines - Write two primary helper functions - one iterative (IsArrayPrimeIter) and one recursive (IsArrayPrimeRecur) - each of which Take the array and its size as input params and return a bool. Print out a message "Entering <function_name>" as the first statement of each function. Perform the code to test whether every element of the array is a Prime number. Print out...
Lab Objectives This lab was designed to inforce the following programming concepts: • Using classes to...
Lab Objectives This lab was designed to inforce the following programming concepts: • Using classes to create a data type SimpleCalculator capable of performing arithmetic operations. • Creating const member functions to enforce the principle of least privilege. The follow-up questions and activities also will give you practice: • Using constructors to specify initial values for data members of a programmer-defined class. Description of the Problem Write a SimpleCalculator class that has public methods for adding, subtracting, multiplying and dividing...
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings....
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings. You must base your code on the doubly linked list implementation given in my Week 8 slides. Change the code so that instead of an ‘int’ each node stores a string (choose a suitable size). Each node should also have a next node pointer, and previous node pointer. Then write functions to implement the following linked list operations: • A printList function that prints...
Objective: Write a Java program that will use a JComboBox from which the user will select...
Objective: Write a Java program that will use a JComboBox from which the user will select to convert a temperature from either Celsius to Fahrenheit, or Fahrenheit to Celsius. The user will enter a temperature in a text field from which the conversion calculation will be made. The converted temperature will be displayed in an uneditable text field with an appropriate label. Specifications Structure your file name and class name on the following pattern: The first three letters of your...
I'm currently stuck on Level 3 for the following assignment. When passing my program through testing...
I'm currently stuck on Level 3 for the following assignment. When passing my program through testing associated with the assignment it is failing one part of testing.   Below is the test that fails: Failed test 4: differences in output arguments: -c input data: a b c -c expected stdout: b observed stdout: a b expected stderr: observed stderr: ./test: invalid option -- 'c' Unsure where I have gone wrong. MUST BE WRITTEN IN C++ Task Level 1: Basic operation Complete...