Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to know how to properly enter this into MATLAB. Please show every step. Thank you! Problem Statement This assignment asks you to design

image text in transcribedI need to know how to properly enter this into MATLAB. Please show every step. Thank you!
image text in transcribed
Problem Statement This assignment asks you to design a simple shopping program. Your program should list 5 items (shoes, bag, iphone, TV and book) and their prices and ask the user to choose one item from the list and then enter the quantity to purchase. Your program calculates the total cost and print it out. The input for item from user should not be case sensitive, i.e., your program should be able to recognize 'shoes, 'Shoes' or 'SHOES. However, if the input is 'shoe' or other item not in the list, your program should stop execution and give out an error message 'Item not found. Input e Item name Quantity Output The total cost if the item is in the list. An error message if the item is not in the list Hint You can use the function lower() to convert item name to lower cases. The lower() function takes a character array and converts every character to lower case. e.g., lower(Shoes')'shoes', lower('SHOES') 'shoes You can use the function error() to stop execution and give out an error message You can use t to introduce tab between item name and its price Sample Outputs& Test Cases Test1 shoes $50 bag $20 iphone$700 TV $700 book $10 Choose an item from the list: bag Enter quantity: 2 Your total is $40.00

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions