Machine Problem 2
Machine Problem 2
OBJECTIVES
● To familiarize the students with the Matlab interface.
● To enable the students to use some basic commands.
MACHINE PROBLEM
Answer the following problems using commands in Matlab. Make sure to submit your code
with the .m extension.
1. Write a program to create a customer’s bill for a company. The company sells only five
different products: TV, Laptop, Speaker, Computer Mouse, and Keyboard. The unit prices are
20,000.00 pesos, 40,000 pesos, 6,000 pesos, 1000 pesos and 3000 pesos respectively. The
program must read the quantity of each piece of equipment purchased from the keyboard. It
then calculates the cost of each item, the subtotal, and the total cost after an 8.25% sales
tax.
The input data consist of a set of integers representing the quantities of each item sold.
These integers must be input into the program in a user-friendly way; that is, the program
must prompt the user for each quantity as shown below. The numbers in boldface show the
user’s answers.
Sample Output:
____________________________________________________________________
XX TV 20,000.00 XXXXXX.XX
XX LAPTOP 40,000.00 XXXXXX.XX
XX SPEAKER 6,000.00 XXXXXX.XX
XX MOUSE 1,000.00 XXXXXX.XX
XX KEYBOARD 3,000.00 XXXXXX.XX
__________
SUBTOTAL XXXXXX.XX
TAX XXXX.XX
TOTAL XXXXXX.XX
Rubrics