Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that you were ask to build an application for a book shop using template method. Read the following requirement, then answer below questions: the

Suppose that you were ask to build an application for a book shop using template method. Read the following requirement, then answer below questions:

    • the process of buying an item goes into the following order of steps: order the book, then pay, after that wrap it as a gift, and finally deliver. Use the following method names in your code: selectBook(), warpAsGift(), pay(), deliver().
    • The payment must be decided by subclasses
    • The delivery of the book is only allowed to be picked from the shop
    • The selection of the book is up to subclasses
    • The wrapping as a gift process, always does not wrap the book as gift, but this step can be changes by subclasses based on the customer preference

Questions:

1) (6 points) Write the code of the template method (including the class that contains the template method) Considering the above requirement

2) (4 points) Write a code for a subclass that allows customer to select book from an array list, do the payment using PalPay and wrap the book as a gift

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_2

Step: 3

blur-text-image_3

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

What is the estrus cycle of a female goat?

Answered: 1 week ago

Question

define what is meant by the term human resource management

Answered: 1 week ago