Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I need a help on this question please A movie theater offers a package that typically consists of a movie ticket, a snack, a

Hi, I need a help on this question please image text in transcribed

A movie theater offers a package that typically consists of a movie ticket, a snack, a drink and a free gift, a patron must present a ticket to enter the theater, but snack, drink and free gift are optional. So the ticket can be decorated by snack, drink and gift. This gives patron flexibility to purchase any number of tickets and snack/drink, however, free gift is limited to 1 per package order. Each snack and drink can be multiple or partial. The cost of multiple or partial is adjusted proportionally. For example, cost of 2 coke is 2 x $1, half popcorn is 0.5 x $5 We would like to use the Decorator pattern and Singleton pattern to create the receipt to show order's item name, quantity, item cost and final cost. The singleton is to ensure that a patron can only get no more than one free gift for his/her package | Here is the price for each item Ticket, Adult: $10; Senior/Student: $8 Popcorn (decorator), $5 Chips (decorator), $2 Drink (decorator): Coke: $1; Sprite: $1 Gift (decorator): $0 (limited to 1 per order) 6) Give the UML class diagram. 7) Provide the implementation code of the UML class diagram given in question 6) in the programming language of your choice. In the client code, create an order that consists of 1 adult and 1 student tickets with 60% popcorn, 40% chips and 2 coke and 1 free gift. The output should display item name, item quantity, item cost and final total cost on the screen

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago