Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A movie theater sells 4 different priced tickets: youth, adult, senior, student. Below is a Matlab function called tickets that has 2 vectors as arguments:

A movie theater sells 4 different priced tickets: youth, adult, senior, student. Below is a Matlab function called "tickets" that has 2 vectors as arguments: the first vector has the price of each type of ticket in dollars and the second vector has the # of each type of ticket sold for a group of customers. The function returns the total ticket income and the total number of tickets sold. function [income cnt] = tickets( price, numTickets ) income = price.*numTickets; income = sum(income); cnt = sum(numTickets); end [totalIncome totalCount]= tickets([3 10 6 5], [1 3 1 2]) totalIncome = 49 totalCount = 7

image text in transcribed

a. The theater has decided to add a special discount. Customers get a percentage off equal to the number of people in their party. Add code to the above function for that modification.

b. The theater is also trying a different special discount. If there are more than 5 customers of a type (youth, adult, senior, student ), one customer of that type gets in free. Modify the code.

Write a Matlab function to solve the problem. Design will be done in lecture or lab D. (4 points) A movie theater sells 4 different priced tickets: youth, adult, senior, student. Below is a Matlab function called "tickets" that has 2 vectors as arguments: the first vector has the price of each type of ticket in dollars and the second vector has the of each type of ticket sold for a group of customers. The function returns the total ticket income and the total number of tickets sold. income price.*num Tickets, income sum income cent- sumonumTickets); end [totalIncome totalCount] tickets (13 10 6 5], [13 1 2]) totalIncome 49 total Count 7

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago