Question

USE PYTHON 3, RUN THE CODE BEFORE POSTING THE ANSWER, AND READ THE ASSIGNMENT REQUIREMENTS NOTE CAREFULLY: Assignment...

USE PYTHON 3, RUN THE CODE BEFORE POSTING THE ANSWER, AND READ THE ASSIGNMENT REQUIREMENTS NOTE CAREFULLY:

Assignment Requirements
NOTE: This program requires the use of if, elif, else, and casting between strings and numbers. The program should use the various code syntax covered in module 3. The program must result in print output using numeric input similar to that shown in the sample output below.

Program: Cheese Order

  • set values for maximum and minimum order variables
  • set value for price variable
  • get order_amount input and cast to a number
  • check order_amount and give message checking against
    • over maximum
    • under minimum
  • else within maximum and minimum give message with calculated price

Sample input and output:

Enter cheese order weight (numeric value): 113
113.0 is more than currently available stock
Enter cheese order weight (numeric value): .15
0.15 is below minimum order amount
Enter cheese order weight (numeric value): 2
2.0 costs $15.98
# [ ] create, call and test 
0 0
Add a comment Improve this question Transcribed image text
Answer #1

# TEXT CODE

# set values for maximum order variable
maximum = 100.0

# set values for minimum order variable
minimum = 1.0

# setting value for price variable
price = 7.99

# get order_amount input and cast to a number(float)
order_amount = float(input("Enter cheese order weight (numeric value): "))

# comparing order_amount with maximum and minimum variables
# and printing appropriate message

# if order_amount is greater than maximum value
if order_amount > maximum:
  
# print the message
print(order_amount,"is more than currently available stock")
  
  
# else if order_amount is less than minimum value
elif order_amount < minimum:
  
# print the message
print(order_amount,"is below minimum order amount")
  
# else order_amount is in between
else:
  
# calculate the cost and then print the cost upto two decimal point
cost = order_amount*price
  
print(order_amount, "costs $%0.2f"% cost)

SCREENSHOTS:

code:

1 # set values for maximum order variable 2 maximum18e.0 4 # set values for minimum order variable 5 minimum = 1.0 7 # settin

Sample input and output:

Enter cheese or der weight (numeric value): 113 113.8 is more than currently available stockEnter cheese order weight (numeric value): .15 8.15 is belo minimum or der amountEnter cheese or der weight (numeric value): 2 2.8 costs $15.98

> I just wanna say thank you so so so much. This helped alot. Thanks

Wildbunch_sa Tue, Jan 25, 2022 4:20 AM

Add a comment
Know the answer?
Add Answer to:
USE PYTHON 3, RUN THE CODE BEFORE POSTING THE ANSWER, AND READ THE ASSIGNMENT REQUIREMENTS NOTE CAREFULLY: Assignment...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • IN PYTHON: The following code contains syntax errors. Assuming the code should read in a name,...

    IN PYTHON: The following code contains syntax errors. Assuming the code should read in a name, and output a message indicating if the last name is "Smith". REWRITE THIS STATEMENT CORRECTLY. value = input(" enter your name using LAST, FIRST format") val= value.split(",") if value[0] ="Smith": print("your last name is common") else val[0] != "Smith": print("not so common") print(]"ODD")

  • Before you start doing this code Read carefully there is a format that you have to...

    Before you start doing this code Read carefully there is a format that you have to follow HERE IS THE FORMAT YOU MUST USE FOR HW #2 - NOTE THE IF ELSE IF...not IF IF IF HW #2 Format : Instructions: This program will generate some information for a user about interplanetary travel (pretend we can travel easily to other planets for this problem). This program will perform calculations concerning weight on various planets as well as travel time between...

  • Could anyone please help with this Python code assignment? In this programming assignment you are to...

    Could anyone please help with this Python code assignment? In this programming assignment you are to create a program called numstat.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The count of how many numbers are in the file. The average of the numbers. The average is the sum of the numbers divided by how many there are. The maximum value. The...

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. DON'T use Function concept or any other concept except while loop,if-else. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not...

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not receive any credit, so be sure that your code interprets correctly...

  • Can I have the answer for the Questions in Python 3 CSC1015F Assignment 4: Control (if,...

    Can I have the answer for the Questions in Python 3 CSC1015F Assignment 4: Control (if, for, while) Assignment instructions This assignment e s con Python programs that use isputandoutput statements, and 12-lea control flow w a nts, whila'stament, and statement that perform INote that you don't have to retuition in the order in which they are presented on the assignments You should do what works best for you! Question 1 mark) write a program called growth as their tenteramentation...

  • need help with python program The objectives of this lab assignment are as follows: . Input...

    need help with python program The objectives of this lab assignment are as follows: . Input data from user Perform several different calculations Implement conditional logic in loop • Implement logic in functions Output information to user Skills Required To properly complete this assignment, you will need to apply the following skills: . Read string input from the console and convert input to required numeric data-types Understand how to use the Python Modulo Operator Understand the if / elif /...

  • Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that...

    Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that uses iteration to guess a number from 1 to 10. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program. Instructions Write pseudocode for a Python program that uses iteration to guess a number from...

  • IT Java code In Lab 8, we are going to re-write Lab 3 and add code...

    IT Java code In Lab 8, we are going to re-write Lab 3 and add code to validate user input. The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy level for a given height. The formula is as follows:                 bmi = kilograms / (meters2)                 where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less...

  • Please answer in: c++ and or pseudo code NOTE: Assignment 4 should utilize only the following...

    Please answer in: c++ and or pseudo code NOTE: Assignment 4 should utilize only the following topics: Variables, Assignment, Input/Output, Selection Structures and repetition structures (i.e. loops). Hungry? In the United States, we tend to be obsessed with eating large animals. We have sayings of “I’m so hungry, I could eat a horse” and ask meaningful questions like “How do you eat an elephant? One bite at a time!” For this assignment, you’re going to put things in perspective. You...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT