
Create a custom Python module named functions.py. This module must contain two functions: one that converts from Dollars to Pounds and one that converts from Pounds to Dollars. These functions must be named convertdp ( used when P is selected ) and convertpd ( used when D is selected ). These 2 functions are to return a single full precision float value, all print statements are to be in program13. Use 1.26634 for the conversion factor, example 1 Pound currency would be equivalent to 1.27 Dollars
Write a program named program13.py , which imports the functions from module functions.py. The program's main() should prompt the user to specify D or P as choices then call the appropriate function which was imported. Conversion accuracy should use full precision ( 5 decimal places as provided above ) for the calculations , and display then print the result to two decimal places.
Use the import keyword: import functions from * . The call the functions, would be functionname()
Output should look like this:
Enter the value to covert: 25.5
Enter D or P to convert entered value to Pound(s) or Dollars(s) : D
The Value 25.5 Dollars(s) converts to 32.29 Dollar(s)
Enter the value to covert: 25.5
Enter D or P to convert entered value to Pound(s) or Dollars(s) : P
The Value 25.5 Dollars(s) converts to 20.14 Pound(s)

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 1 images

- Write in Python Write a function named max that accepts two float values as arguments and returns the value that is the greater of the two. For example, if 7.2 and 12.1 are passed as arguments to the function, the function should return 12.1. Use the function in a program that prompts the user to enter two float values. The program should display the value that is the greater of the two.arrow_forwardTHIS PROGRAM MUST BE WRITTEN IN C++! Your customer needs an automated system to patrol the highways. The job of the system is to collect the following information on vehicles traveling down a certain stretch of highway: license plate number, current speed, and speed limit. A program is required to determine if a speeding ticket is needed for each set of data. Ticket will only be issued when number of miles per hours (mph) over the speed limit is at least 5 mph. Ticket prices are calculated as follow: base + fee * <number of mph over the speed limit>. The base is always $150 and the fee per mph over the speed limit is varied according to number of mph over the speed limit. The fee per mph over the speed limit is $5 when number of mph over the speed limit is no more than 20 mph. However, the fee per mph over the speed limit is $10 when number of mph over the speed limit is between 20 mph and 50 mph. In addition, a ticket of $1000 is automatically given to vehicle when number of mph…arrow_forwardHow can I write a python program using the void functions and value-returning functions. It requires a main function and two custom functions. Both custom functions determine the cost of purchasing an item in specified quantities, but one function should return the cost to main and the other one should print the cost. Of course, the costs should be the same.Sample OutputEnter the unit price 12.50Enter the quantity 4Please pay $50.00Please pay $50.00arrow_forward
- write a python code:arrow_forwardOne lap around a standard high-school running track is exactly 0.25 miles. Define a function named laps_to_miles that takes a number of laps as a parameter, and returns the number of miles. Then, write a main program that takes a number of laps as an input, calls function laps_to_miles() to calculate the number of miles, and outputs the number of miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f' {your_value:.2f}') Ex: If the input is: 7.6 the output is: 1.90 Ex: If the input is: 2.2 the output is: 0.55 The program must define and call the following function: def laps_to_miles (user_laps) 461710.3116374.qx3zqy7 LAB ACTIVITY 1 # Define your function here 21 3 00 Jo UAWN P 4 if ___name__ 5 6 7.8.1: LAB: Track laps to miles 7 8 main.py '__main__': # Type your code here. Your code must call the function. 8/10 Load default template...arrow_forwardDevelop a Python function named "display_bookstore_info" to convey details about "Bookworm Haven." The function should include the following information: 1. A warm welcome message and the precise location of the bookstore. 2. An overview of the book categories available, highlighting bestsellers, fiction, non- fiction, science fiction, and children's books. 3. Any ongoing promotions or loyalty programs, such as "Buy 3 books, get a 10% discount with our Bookworm Rewards Card!" 4. Operational hours specified for each day of the week. 5. Contact details, including a customer support email (support@bookwormhaven.com) and a customer service hotline (1-800-READNOW). Ensure to call the function to present the provided information.arrow_forward
- For the following code can you change the factors that impact the total construction cost section into a function(define a function). Where the mean can be entered through by asking for the inputs of the mean value for each of the factors. (i.e., "Please enter the mean value for material", "Please enter the mean value for labour".. etc.). Follwoing this the standard deviation of the factors is calculated and this is all done in a function.arrow_forwardHow can I write a python program with a main function that imports a custom module file. The custom module file defines a function that takes the radius of a circle as its only parameter. In the module's custom function: calculate the area and circumference of the circle and use an f-string to print one precisely formatted line as follows: the radius should display centered with one decimal place in a column 8-characters wide. the area should be centered with four decimals in a column 12-characters wide. the circumference should also be centered with four decimals in a column 12-characters wide. outputs in the thousands should display commas. In the main function: print headings for the columns with the same alignments and widths. run a loop that will go through seven iterations. inside the loop generate a random integer from 40-80, inclusive. execute the function in the custom module with the random integer as its argument.arrow_forwardCreate a custom Python module named functions.py. This module must contain two functions: one that converts from Dollars to Pounds and one that converts from Pounds to Dollars. These functions must be named convertdp ( used when P is selected ) and convertpd ( used when D is selected ). These 2 functions are to return a single full precision float value, all print statements are to be in program53. Use 1.26634 for the conversion factor, example 1 Pound currency would be equivalent to 1.27 Dollars Write a program named program53.py , which imports the functions from module functions.py. The program's main() should prompt the user to specify D or P as choices then call the appropriate function which was imported. Conversion accuracy should use full precision ( 5 decimal places as provided above ) for the calculations , and display then print the result to two decimal places. Use the import keyword: import functions from * . The call the functions, would be functionname() Output…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





