Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Case scenario Congratulations! The regional manager of your retail store has noticed your tech skills after youve helped your store manager with the previous issues.

Case scenario

Congratulations! The regional manager of your retail store has noticed your tech skills after youve helped your store manager with the previous issues. Hes promoting you to the corporate office, where you will work on a product development team. You quickly update your LinkedIn before you start work.

Your task is to create a program that accepts a product name, product category, and product price, and calculates and displays new information. Youve done something similar before, but your team needs you to do it this time using functions. This is so that any team member can easily change how the information is calculated.

What your Python program should do

There is no starter code.

Ask the user to enter the product name. The user can also enter x (without quotes) to quit.

Ask the user to enter the products category.

Ask the user to enter the products price.

The whole program should repeat (hint) until the user enters x to quit at the product name entry.

You do not need to show this original information to the user.

Create a function called newsku

This function should take the product name and category as parameters.

If the category is home, return a string that contains the first four letters of the product name in all caps.

If the category is work, return a string that contains the last four letters of the product name in all caps.

If the category is anything else, return the original product name in all caps.

Do not print anything from inside this function. This function needs to return a value.

Create a function called newprice

This function should take the product price as a parameter.

Increase the price by 15%. Return this new price.

Do not print anything from inside this function. This function needs to return a value.

Outside of your functions in the main block of code

You must call newsku() and pass in the product name and category. Remember to store the return value.

You must call newprice() and pass in the product price. Remember to store the return value.

Display this new information to the user.

After you display this information to the user, ask the user again for a product name or x to quit. Your program should run until the user types in x as the product name.

Assumptions, clarifications, and hints

You can assume that the length of the original product name will be more than four characters.

Your program should keep running until the user types in x as the product name.

The price can contain decimals. Sometimes the output will have weird rounding errors (see my sample output below); this is ok.

You should not use print anywhere inside your newsku and newprice functions.

You must use two functions (newsku and newprice). These two functions must accept parameters and return values per the instructions.

Please paste code and output thank you!

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

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago