Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use this format for part A> Use form as shown in picture for part A Use python for part B Design a program that asks

image text in transcribed
image text in transcribed
image text in transcribedUse this format for part A>
image text in transcribed
Use form as shown in picture for part A
Use python for part B
Design a program that asks the user to enter the weight of a package and then displays the shipping charges. 10. Time Calculator Design a program that asks the user to enter a number of seconds, and works as follows: - There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60 , the program should display the number of minutes in that many seconds. - There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600 , the program should display the number of hours in that many seconds. - There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86,400 , the program should display the number of days in that many seconds. Additional Problem Requirements: - Include a descriptive prompt for the input number of seconds. - Use named constants to represent seconds in a minute, seconds in an hour, and seconds in a day. - Create descriptive identifier names (variables and constants). - Include descriptive output when displaying the number of days, hours, minutes and seconds for an input number of seconds. A sample session is given below: Declare Real lengthA, widthA, areaA Declare Real lengthB, widthB, areab /I Get the dimensions of Rectangle A. Display "Enter the length of Rectangle A." Input lengtha Display "Enter the width of Rectangle A." Input widthA 1/ Get the dimensions of Rectangle B. Display "Enter the length of Rectangle B." Input lengthB Display "Enter the width of Rectangle B." Input widthB 11 Calculate the areas of the rectangles. Set areaA =1 engthA widthA Set areaB = lengthB * widthB 1) Compare the areas. If areaA > areaB Then Display "Rectangle A has the greater area." Else If areaB > areaA Then Display "Rectangle B has the greater area." Else Display "Both rectangles have the same area." b) Create a Python program called TimeCalc.py that implements the above pseudocode algorithm. The Python source code must have the following for full credit: - Include a block comment header at the beginning of your program that identifies the author, date, assignment, filename, and short description of the program. - Although Python does not directly support named constants, you can simulate a named constant by using an all UPPERCASE named variable with an initialization value that does not change throughout the program. - Include a block comment at the end of your program that includes the output from a sample session run of your program

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions