What your Python program should do Create a new repl for this lab. Do not reuse a repl from a previous lab or class acti

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

What your Python program should do Create a new repl for this lab. Do not reuse a repl from a previous lab or class acti

Post by answerhappygod »

What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 1
What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 1 (57.95 KiB) Viewed 32 times
What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 2
What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 2 (57.97 KiB) Viewed 32 times
What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 3
What Your Python Program Should Do Create A New Repl For This Lab Do Not Reuse A Repl From A Previous Lab Or Class Acti 3 (39.58 KiB) Viewed 32 times
What your Python program should do Create a new repl for this lab. Do not reuse a repl from a previous lab or class activity. 1. Ask the user to enter the product name. The user can also enter 'x' (without quotes) to quit. 2. Ask the user to enter the product's category. 3. Ask the user to enter the product's price, The whole program should loop 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 tech', return a string that contains the first three letters of the product name in all caps. If the category is 'office', return a string that contains the last three 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 10%. 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 news ku () 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. Keep running your program until the user types in 'x as the product name. Assumptions • You can assume that the length of the original product name will be more than three characters • Your program should keep running until the user types in X as the product name. Price can contain decimals. It's ok if you have the .00000000000001 like in my output. .

Sample output This is from one continuous run of the program. I copied my text from the black area. Please enter a product name. You can also enter x to quit: laptop Please enter the product's category: tech Please enter the product's price: 100 The new SKU is LAP and the new price is 110.00000000000001 Please enter a product name: You Han also enter x to quit: scantron Please enter the product's category: office Please enter the product's price: .75 The new SKU Is RON and the new price is 0.8250000000000001 Please enter a product name. You can also enter x to quit: whiteboard cleaner Please enter the products category: other Please enter the product's price: 8 The new SKU is WHITEBOARD CLEANER and the new price is 8.8 Please enter a product name. You can also enter x to quit: x Say hi to your TA!
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply