Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSI 31 Assignments for Weeks 2&3 Due Wednesday, February 21, 2018 1. (a) Write the design specifications for a program that calculates the volume of

image text in transcribed
image text in transcribed
image text in transcribed
CSI 31 Assignments for Weeks 2&3 Due Wednesday, February 21, 2018 1. (a) Write the design specifications for a program that calculates the volume of a box. Get the values for length, width, and height from the user at the console. Print the resulting volume to the screen (b) Write the program. (c) Copy the output from the program and paste it as a comment in the script of the program 2. (a) Write the design specifications for a program that calculates the average of n integers. Get the number of integers, n, to be averaged from the user at the console. Using a loop, accumulate the sum of the n integers entered by the user. Calculate the average and print it to the screen. (Note: You can use any name for n.) (b) Write the program (e) Copy the output from the program and paste it as comment in the script of the program For the following exercises (3-6) you do not need to write the design specifications. 3. Modify the temperature conversion program with a loop so that it executes 5 times. Add ar (Note: All the code in the text is in a folder called "code" convert.py # A program to convert Celsius temps to Fahrenheit def main) eelsius -eval input"What is the Celsius temperature?")) fahrenheit 9.0 / 5 0 * celsius + 32 print ("The temperature is". fahrenheit "degrees Fahrenheit. main 4. Modify the same program so that it computes and prints a table with of Celsius temperatures and the Fahrenheit equivalents every 10 degrees from O'C to 100'C.(Note: This program docs not require any input from the user ) Celsius Fahrenbcit 32 5o 10 20 68 30 0 104 Page 12 CSI 31 Assignments for Weeks 2&3 Due Wednesday, February 21, 2018 1. (a) Write the design specifications for a program that calculates the volume of a box. Get the values for length, width, and height from the user at the console. Print the resulting volume to the screen (b) Write the program. (c) Copy the output from the program and paste it as a comment in the script of the program 2. (a) Write the design specifications for a program that calculates the average of n integers. Get the number of integers, n, to be averaged from the user at the console. Using a loop, accumulate the sum of the n integers entered by the user. Calculate the average and print it to the screen. (Note: You can use any name for n.) (b) Write the program (e) Copy the output from the program and paste it as comment in the script of the program For the following exercises (3-6) you do not need to write the design specifications. 3. Modify the temperature conversion program with a loop so that it executes 5 times. Add ar (Note: All the code in the text is in a folder called "code" convert.py # A program to convert Celsius temps to Fahrenheit def main) eelsius -eval input"What is the Celsius temperature?")) fahrenheit 9.0 / 5 0 * celsius + 32 print ("The temperature is". fahrenheit "degrees Fahrenheit. main 4. Modify the same program so that it computes and prints a table with of Celsius temperatures and the Fahrenheit equivalents every 10 degrees from O'C to 100'C.(Note: This program docs not require any input from the user ) Celsius Fahrenbcit 32 5o 10 20 68 30 0 104 Page 12

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions