EngE 1114 HW3 - algorithms to determine the total admission...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EngE 1114 HW3 The only built in MATLAB functions that may be used in this assignment are sqrt and trig functions. Add help comments to your file and other comments as necessary to describe your algorithm. The first comment should match the header requirements for homework, without pagination. Problem1: Problem 1 assumes that you have completed the Programming 2 Worksheet from your Week 2 Workshop and have viewed the Equivalent Logic Presentation. Consider an attraction, such as a science museum, that offers group rates based on the size of the group. The individual entry fee is $7.00 The family rate, for groups of 4 8 people is $6.50/person The small group rate, for groups of 9 20 people is $6.00/person And the class rate, for groups larger than 20 people is $5.00/person. Prepare two
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: algorithms to determine the total admission price to the museum based on the group size or the number of tickets being purchased. Algorithm 1 will use a stacked if structure and logical operators to correctly determine the cost. Algorithm 2 will use an elseif structure. No logical operators are permitted in algorithm 2. User input to both programs will be the group size (number of tickets being purchased). Output will be the total cost of the tickets expressed as $x.xx. Submit the flowchart, listing, and output from 4 sample runs with each algorithm. Use the following input values for the sample runs: 1, 4, 9, 25. In your discussion address the difference between the two decision structures used to solve this problem and why one is more efficient than the other....
View Full Document

This note was uploaded on 09/19/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Ask a homework question - tutors are online