1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
adell [148]
3 years ago
13

The manager of the Super Supermarket would like to be able to compute the unit price for products sold there. To do this, the pr

ogram 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 UnitPriceYou will need the following formulas: UnitPrice = PoundPrice/16 TotalPrice = PoundPrice * (Pounds + Ounces/16)
Computers and Technology
1 answer:
Alenkasestr [34]3 years ago
4 0

Answer:

The program in Python is as follows:

name = input("Name of item: ")

PoundPrice = int(input("Pound Price: "))

Pounds = int(input("Weight (pounds): "))

Ounces = int(input("Weight (ounce): "))

UnitPrice = PoundPrice/16

TotalPrice = PoundPrice * (Pounds + Ounces/16)

print("Unit Price:",UnitPrice)

print("Total Price:",TotalPrice)

Explanation:

This gets the name of the item

name = input("Name of item: ")

This gets the pound price

PoundPrice = int(input("Pound Price: "))

This gets the weight in pounds

Pounds = int(input("Weight (pounds): "))

This gets the weight in ounces

Ounces = int(input("Weight (ounce): "))

This calculates the unit price

UnitPrice = PoundPrice/16

This calculates the total price

TotalPrice = PoundPrice * (Pounds + Ounces/16)

This prints the unit price

print("Unit Price:",UnitPrice)

This prints the total price

print("Total Price:",TotalPrice)

You might be interested in
Write a class called Product. The class should have fields called name, amount, and price, holding the product’s name, the numbe
vichka [17]

Answer:

public class Product {

//Declaring the fields

   private String name;

   private int amount;

   private double price;

   //Constructor

   public Product(String name, int amount, double price) {

       this.name = name;

       this.amount = amount;

       this.price = price;

   }

   // The method get_price

   public double get_price(int amount){

       // amount of goods less than 10

       if(amount<10){

           double zeroDiscPrice;

           zeroDiscPrice = this.price;

           return zeroDiscPrice;

       }

       // amount of goods less than 100

       else if(amount>=10 && amount<100){

           double tenPercentDiscPrice;

           tenPercentDiscPrice = this.price-(this.price*0.1);

           return tenPercentDiscPrice;

       }

       // amount of goods greater than 100

       else{

           double twentyPercentDiscPrice;

           twentyPercentDiscPrice = this.price-(this.price*0.2);

           return twentyPercentDiscPrice;

       }

   }

}

Explanation:

The class is implemented in Java programming language

Three member variables (fields) are declared as described in the question

A constructor is created to initialize an instance of the class

The method get_price() as created uses a combination of if...else if....else To determing the price based on the amount of items bought as described in the question.

5 0
3 years ago
The ret instruction (without operands) will pop how many bytes off the stack?
Archy [21]
<span>Using the RET instruction without operands will pop 4 bytes off the stack. RET is part of the x86 instruction set and stands for “return from procedure”. A stack is part of memory that is allocated to store items. Popping bytes from a stack is the same thing is removing items from the data structure in memory.</span>
4 0
4 years ago
Question B_1 (15 points) Please define (describe) local variables and how they are used in computer programming ( e.g. In C, C )
OverLord2011 [107]

Answer and Explanation:

Static variables are variables that still maintain their values outside the score which they are declared. They are declared with the static keyword

Example:

<em>static int score = 30;</em>

Local variables are variables whose scope are restricted to a block. Their values are restricted to the block which they are declared in.

Example:

<em>void abd(){</em>

<em>int score;</em>

<em>}</em>

<em>score is a local variable to abcd() function</em>

5 0
4 years ago
Access data is _______ in a Word document.
Naya [18.7K]
I believe the answer is embedded. but make sure to check multiple sources.
5 0
3 years ago
Although “dog.jpg” and “dog.JPG” and “Dog.jpg” and “DOG.JPG” all appear to be the same file, they are not considered the same wh
bonufazy [111]
They are not considered the same when programming web pages on the Internet, because it depends on what opereting system you're using to create web-site. Every OS use different <span>character encoding capable. You can avoid that by entering utf-8 (or smth like that) in your html file.</span>
4 0
4 years ago
Other questions:
  • Write a java program called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the numbe
    6·1 answer
  • Is microsoft word the same as microsoft office?
    12·2 answers
  • Where can you find additional commands to include in menu options?
    12·1 answer
  • C++
    8·1 answer
  • An athlete runs every day for five days. Write a program that computes the total distance and average distance ran by the athlet
    10·1 answer
  • Ano kaya ang nararamdaman mo at mangyari sayo kung tatlong araw ka nang hindi kumakain​
    6·1 answer
  • Which is a group of related software applications that are bundled and sold together?
    9·2 answers
  • true or false then EXPLAIN why. Since many forms of money do not earn interest, people's demand for money is unaffected by chang
    14·2 answers
  • Input a list of positive numbers, terminated by 0, into an array Numbers[]. Then display the array and the largest and smallest
    11·1 answer
  • What is a common practice that enterprise organizations will implement to ensure the users of a network and a Mobile Device Mana
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!