Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the program below to demonstrate the following: 1. Prompt the user for the number of ounces 2. Display the equivalent number of cups. #

image text in transcribed
Modify the program below to demonstrate the following: 1. Prompt the user for the number of ounces 2. Display the equivalent number of cups. # Activity 2.8 # This program converts cups to fluid ounces. def main( ) : # display the intro screen. intro( ) # Get the number of cups. cups_needed = int(input( 'Enter the number of cups: ') ) # Convert the cups to ounces. ounces_in_main = cups_to_ounces (cups_needed) print ( 'Ounces value sent by the function is', ounces_in_main) # The intro function displays an introductory screen. def intro( ) : print ( 'This program converts measurements') print (' in cups to fluid ounces. For your' ) print('reference the formula is: ') print(' 1 cup = 8 fluid ounces') print ( ) # The cups_to_ounces function accepts a number of # 'cups and displays the equivalent number of ounces. def cups_to_ounces (cups) : ounces = cups * 8 return ounces #print( 'That converts to', ounces, 'ounces. ') # Call the main function. main ( )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

Students also viewed these Programming questions