word “accept” means that the function will accept parameters. Assignment: Please include in-code comments. Create a program that accepts integer inputs from the user for the dimensions of a square and a rectangle and determine and display the size and fit relationship between them. Which object is larger (by area). Which object, if either, fits inside the other. Example: A 5x3 rectangle does not fit inside a 5x5 square; however, a 4.9 x 3 rectangle does fit inside a 5x5 square. There are no specific units used. If any of the sides of the two objects are the s

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Starting out with Python by Tony Gaddis. This assignment is a continuation of the material covered in Chapter 5: Functions. The Power Point slides, and code examples contained in the Canvas module resource page should be helpful. You will use the Python language for this assignment. Objective: Use basic Python statements to create user-defined functions using the concept of Scope. Create a program that runs to completion in a logical manner. Do not use the Python “exit” or “continue” command. Do not use lists. In most cases, the purpose of a function is to accept one or more arguments and return a single value based on some operation using the arguments that were passed. The word “accept” means that the function will accept parameters. Assignment: Please include in-code comments. Create a program that accepts integer inputs from the user for the dimensions of a square and a rectangle and determine and display the size and fit relationship between them. Which object is larger (by area). Which object, if either, fits inside the other. Example: A 5x3 rectangle does not fit inside a 5x5 square; however, a 4.9 x 3 rectangle does fit inside a 5x5 square. There are no specific units used. If any of the sides of the two objects are the same, neither shape fits within the other. Write a Python program with input variables for the dimensions of two different objects: Object one: width, height of a rectangle Object two: length of a square side (all sides are the same). Inside main() you will call functions to request the object dimensions and to determine the dimensional relationship. The main() function will display two sentences based on the area and size relationship of the objects determined by the other functions. The program only runs once. Make sure you check that all inputs are greater than zero. If an invalid entry is made, continue to ask the user for a valid entry. The first sentence will be one of the following: "The object with the greatest area is the square." "The object with the greatest area is the rectangle." "The square and the rectangle have the same area." The second sentence will be one of the following: "The square fits inside the rectangle." "The rectangle fits inside the square." "Neither shape fits inside the other." Inputs: width, height, square side length Outputs: Two sentences Program functions: Function 1 get_inputs() Type: Non-value returning. Parameters: None. Process: Gets the height and width of the rectangle and the square side length from the user. Sets global variables for the rectangle and square side lengths accessible by the main() function. Return: None Function 2: get_area() Type: Value returning. Parameters: height and width (of either object). Note: This is a generic function for any size object. Process: Calculates Area. Return: Area. Function 3: get_object_fit() Type: Non-value returning. Parameters: None Process: Accesses the dimensions of object one and two from get_inputs() function global variables. Determines the fit. Set global variable(s) for fit that are accessible by the main function. Return: None Function 4: get_check_value(): Type: Value-returning. Parameters: Any number. Process: Checks to make sure the parameter is greater than zero. Note: Generic function. Return: True or False Special Program Requirements: Your processing must be very similar to the sample run below and you should test your code to the sample run as a minimum. Do not use any advanced functions including lists (arrays). Do not use the break, exit, continue statements to exit a loop or selection structure. Do not use Python code statements or functions that are not included in the chapters we have covered. Using python code not found in the covered chapters will result in point deductions or rejection of the assignment. Software Test Plan Document(STPD): Software Test Plan Document (STPD): You are required to submit a Software Test Plan Document (STPD) that contains a minimum of 8 test cases for the program including at least 2 invalid entry cases. Note: You are required to submit an STPD to receive the points for the specification category in the Rubric. The STPD must be complete and cover all logical cases. Documentation: You must include a header comment block at the beginning of your program. include in-code comments. # Name: # Assignment: # Course: # Date of completion: # Time to complete: # Program description: Sample Run: Enter the width of the rectangle: 5 Enter the height of the rectangle: 3 Enter the length of the square side: 5 The object with the greatest area is the square. Neither shape fits inside the other. Enter the width of the rectangle: 4 Enter the height of the rectangle: 3 Enter the length of the square side: 5 The object with the greatest area is the square. The rectangle fits inside the square.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education