Write a function called FindArea that takes in 2 parameters- the height and width of a rectangle. The function should r

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a function called FindArea that takes in 2 parameters- the height and width of a rectangle. The function should r

Post by answerhappygod »

Write a function called FindArea that takes in 2 parameters- theheight and width of a rectangle. The function should returnthe area of the rectangle. Hint: area = width *height
Write a python program that asks the user for a height andwidth, uses FindArea to find the area of the rectangle, and outputsthe area of the rectangle to the user.
Program 3
It is still very common to create phone numbers that includewords so that they are easy to remember. For example,1-800-flowers or 1-800-taxiusa
Write a function (name is up to you!) that accepts the last 7characters of a 1-800 number and turns them intonumbers, based on the letters and numbers assigned on the dial of aphone. If the character is a number- then use thatnumber. Otherwise, translate the letter into a number. The function should return the last 7 characters of the 1800 numberentered by the user.
Now- write a Python program that asks the user to enter a 1-800number, and then uses your function to translate the the last 7numbers of the number to numbers.
Your program should output the 1-800 number as a series ofnumbers. (you may format the numbers if you like!)
For example:
Please enter a 1-800 number you would like to translate. Do not include hyphens: 1800BIGFISH
The number you want to call is: 18002443474
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply