Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This activity is worth 10 total points This lesson\'s Group Activities are (do b

ID: 3856158 • Letter: T

Question

This activity is worth 10 total points

This lesson's Group Activities are (do both):

1. A U.S. customary gill is a measure of volume that is equal to 32 fluid drams. One dram is equal to 1/8 of a U.S. fluid ounce. Yes, these are real measurements. If you know the number of fluid ounces, you can calculate the number of drams (d) as:

drams = ounces * 8

and the number of gills as

gills = ounces / 4

Write a program that asks the user to enter the number of ounces of apple cider they want to purchase to take home. It should then calculate and display the correct number of gills and drams. If the result is more than 1024 drams, a message should display indicating that the amount they want is large and they will need to purchase their cider in gallons. If the result is less than 100 drams, a message should display indicating that the amount they want is too small and perhaps they should just order a pint.

2. When mixed, the primary colors - red, blue, and yellow - create secondary colors - orange, green, and purple.

Mix red and blue to get purple

Mix blue and yellow to get green

Mix yellow and red to get orange

Design a program which prompts the user to enter two of the primary colors. If anything other than "red" "blue" or "yellow" is entered, the program should display an error message. If they enter two of the same color, an error message should display. Otherwise, the program should display the name of the new secondary color.

Helpful Hint: you can convert any string into lowercase by using the method lower(). For example:

letters = 'WXYz'
print(letters.lower())

This will display:

wxyz

You may find this helpful in case your end user enters "RED" or "Red" instead of "red."

the program to use is python

Explanation / Answer

Program 1.

ounces = int(input ('Enter the number of ounces of apple cider: '))
gills = ounces/4
drams = ounces * 8
print ('Gills = ' + str(gills))
print ('Drams = ' + str(drams))

if drams > 1024:
   print ('Amount is too large, you need to purchase in gallons.')

if drams < 100:
   print ('Amount is too small, you should just order a pint.')

OUTPUT:

$ python3 program1.py
Enter the number of ounces of apple cider: 256
Gills = 64.0
Drams = 2048
Amount is too large, you need to purchase in gallons.

Please ask the other question in a separate post. Thank you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote