Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING PYTHON You need to write a program that allows a user to input the name, dimensions, and a character to be contained in a

USING PYTHON

You need to write a program that allows a user to input the name, dimensions, and a character to be contained in a box. The program will also allow the user to then see the name, dimensions, and area of the box as well as an ASCII graphical representation of a box filled with the character they chose. For example, the ASCII representation of a 5x4 box filled with the @

The top and the bottom need to be drawn with dash characters and the sides need to be drawn with a pipe character. A sample run of the program is included with this assignment for your reference. You must implement four different functions for this assignment. They are described below: A function that takes the width and height of a box as integers and returns the area of the box as an integer. A function that takes the width and height of a box as integers and the character to be contained in the box as a character and draws an ASCII representation of the box. This function will return the void type. A function that takes the name of a box as a string, the width and height of a box as integers, and the character to be contained in the box as a character and describes the box to a user. This description will include the name, width, height, and area of the box as well as an ASCII representation of the box. This function should call both of the functions described above. It will return the void type. A function that takes a string variable to hold the name of a box, a character variable to hold the character contained in a box, and integers to hold the width and height of a box and prompts the user to provide values for each variable. The parameters should be passed by reference to the function and it should return the void type. The main() function of your program should include an implementation of a command line user interface that will prompt a user to set the values for a box, view the values for a box, and exit the program. The user interface should inform the user if their input is invalid and prompt them to select a valid choice.

SAMPLE OUTPUT Welcome to the super fun box program! What would you like to do? 1) Set Box Values 2) Show Box Values x) Exit Program 1 What would you like to name the box? Boxie What character should the box be filled with? @ What is the width of the box? 5 What is the height of the box? 4 What would you like to do? 1) Set Box Values 2) Show Box Values x) Exit Program 2 Hello, I'm a box! My name is Boxie and I am 5 characters wide and 4 characters tall. My area is 20 characters squared. This is an ASCII representation of me: ----- |@@@| |@@@| ----- What would you like to do? 1) Set Box Values 2) Show Box Values x) Exit Program x Press any key to continue . . . 

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_2

Step: 3

blur-text-image_3

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago