Create a custom python module

Assignment Help Python Programming
Reference no: EM131279857

- Write all lines of your pseudocode as comments immediately after your name and SPC ID# comment.

- Add more comments as needed in each program to explain what your code is doing.

- Choose descriptive variable names in all programs.

- Before submitting this assignment,

1. Write a program named program51.py that defines a value-returning function named cuber that returns both the surface area and volume of a cube. A cube is a rectangular prism with all sides equal. Prompt the user to enter the cube's side length from the keyboard in the main function and then call the cuber function. The main function should "catch" the values returned by cuber and display both the surface area and volume accurate to three decimal places.

SAMPLE OUTPUT
Enter side length of cube 2.5
Surface area is 37.500
Volume is 15.625

2. Write a program named program52.py that uses main and a void function named numbers that takes no arguments and does not return anything. The numbers function generates 5 random integers, each greater than 10 and less than 30 (duplicates are okay), and prints them all on one line separated by spaces. A loop is required for this, and the loop should also total up the integers so the sum can be displayed when the loop ends. The main function should call the numbers function.

SAMPLE OUTPUT
12 24 16 21 17
The total is 90

3. Create a custom Python module named tempconvert.py. This module must contain two functions: one that converts from Celsius to Fahrenheit and one that converts from Fahrenheit to Celsius. Write a program named program53.py that imports the tempconvert module. The program should prompt the user to specify the temperature and the scale, and then perform the appropriate conversion accurate to two decimal places.

SAMPLE OUTPUT 1
Enter the temperature to convert 37
Was that input Celsius or Fahrenheit?
Enter C or F C
In Fahrenheit, that is 98.60
SAMPLE OUTPUT 2
Enter the temperature to convert -40
Was that input Celsius or Fahrenheit?
Enter C or F F
In Celsius, that is -40.00

Reference no: EM131279857

Questions Cloud

What is the portfolios duration : What are the limitations of using duration as a measure of a bond's price sensitivity to interest-rate changes?- What is the portfolio's duration?
Which code of ethics holds the most meaning for you : Which code of ethics holds the most meaning for you? Which ethical principle do you feel is the most important for you as a Health Information Management professional?
Chain of command notifications : Your plan should cover incident handling, data recovery, logging requirements, chain of command notifications, bug eradication, incident recovery, and emergency steps. Submit the plan to your instructor when it is completed.
Create a film poster from the given lis of cinema. : Create a film poster from the Given lis of cinema.
Create a custom python module : Write a program named program51.py that defines a value-returning function named cuber that returns both the surface area and volume of a cube. A cube is a rectangular prism with all sides equal.
Ethics issue of interest : You may also use the Internet or the Strayer Library to research articles on ethical issues in information systems and choose one (1) ethics issue of interest to you.
Discuss disclosure apology and offer programs : Discuss Disclosure, Apology, and Offer programs. Compare and contrast benefits and drawbacks to the organization and the patient/family and/or provider. Analyze the impact to patient care outcomes.
Develop a suitable set of dimensionless parameters : The maximum thickness, h, of a square of material that can be supported is assumed to be a function of the length of the side of the square, , the density of the material, ρ, the acceleration of gravity, g, and the surface tension of the liquid, σ..
Two bonds expected to exhibit negative convexity : Suppose that the current market yield for 10-year corporate bonds is 7%.-  Which of these two bonds would be expected to exhibit negative convexity?

Reviews

Write a Review

Python Programming Questions & Answers

  Write an expression whose value is the concatenation

Write an expression whose value is the concatenation of the three str values associated with name1, name2, and name3, separated by commas. So if name1, name2, and name3, were (respectively) "Neville", "Dean", and "Seamus", your expression's value wou..

  Interaction between the customer and the machine

In Python:Simulate a cash register or ATM including the interaction between the customer and the machine (i.e. assume that you are automating the responses)

  Part-1for task 1 list the things you changed and the

part-1for task 1 list the things you changed and the purpose of changing it. good reasons include making code easier

  Ida to reverse engineer a piece of shellcode

You are a Malware Investigator at 0xC0ff33, Inc and an incident responder came across injected shellcode during an investigation. He has done all he can in IDA and has passed on the .idb file to you. Figure out what the purpose of the malware was ..

  What are the issues assciated with top-down analysis

what are the issues assciated with top-down analysis please explain?

  Design flowchart that ask actual value of piece of property

Design a flowchart and Python code that ask for the actual value of a piece of property and displays the assessment value and the property tax.

  Write a function trans(m) which returns the transpose

Write a function trans(M) which returns the transpose of an n-by-n matrix M. The matrix M is represented by a list of n lists, each of length n. Transposing M means that each M[i][j] is swapped (once!) with M[j][i].

  Aussie best car abcdeclares that based on its yearly sales

aussie best car abcdeclares that based on its yearly sales it will award a bonus as follows. the bonus will be equally

  Design and implement a python program which plays poker

The goal of this project is to gain practice with use of classes and creating functions. You will design and implement a Python program which plays simplified Texas Hold'em Poker.

  Student record due smartsite thursday 1211 1155 pm file

due smartsite thursday 1211 1155 p.m. file names grading.py ltbrgtall prompts for input and all output must match my

  How do you prevent replay attacks

What was your choice of cipher? What mode of operation does it use? Why did you make these choices? How do you prevent attackers from tampering with messages in transit? How do you prevent replay attacks

  Python program that reads in a series of positive integers

Write a Python program that reads in a series of positive integers and writes out theproduct of all the integers less than 25 and the sum of all the integers greater than or equal to 25. Use 0 as a sentinel value

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd