Derive a class bulkdiscount from discount policy

Assignment Help C/C++ Programming
Reference no: EM131661723

Question: Derive a class Combined Discount from DiscountPolicy, as described in Exercise I. It should have a constructor that has two parameters of type DiscountPolicy. It should define the method compute Discount to return the maximum value returned by compute Discount for each of its two private discount policies. The two discount policies are described in Exercises II and III.

Exercise I: Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count and itemCost.

Exercises II: Derive a class BulkDiscount from Discount Policy, as described in the previous exercise. It should have a constructor that has two parameters, minimum and percent. It should define the method computeDiscount so that if the quantity purchased of an item is more than minimum, the dis-count is percent percent.

Exercises III: Derive a class BuyN/temsCetOneFree from DiscountPolicy, as described in Exerdse I. The class should have a constmctor that has a single parameter n. In addition, the dass should define the method computeDi scount so that every nth item is free. For example, the following table gives the discount for the purchase of various counts Man item that costs 510, when n is 3.

Count          1       2        3        4        5        6        7

Discount      0       0        10      10       10      20      20

Reference no: EM131661723

Questions Cloud

How perception affected each party negotiation goals : Tony Taxpayer’s return has come up for audit by the Internal Revenue Service (IRS). Explain how perception affected each party’s negotiation goals.
Create an interface messageencoder : Create an interface MessageEncoder that has a single abstract method encode (plainText), where plainText is the message to be encoded.
Discuss about lack of bicycle helmet use for children : what type of sample would you need to examine your question and learn more about your issue
Should you pay the ten percent commission : Should you pay the 10 percent commission? Justify your response. Does it make a difference if your competitors routinely pay such commissions?
Derive a class bulkdiscount from discount policy : Derive a class BulkDiscount from Discount Policy, as described in the previous exercise. It should have a constructor that has two parameters.
What are some obstacles to effective competitor analysis : What are some obstacles to effective competitor analysis? How may these obstacles be overcome?
Discuss problem solving of population health problems : Directly apply principles and knowledge learned in the course to problem solving of population health problems in their own geographic areas
Compute the net income for orson company : Given the following information, compute 2015 net income for Orson Company. Stockholder's Equity January1 2015 - $120,000
What factors may affect mix of inputs use to produce product : What factors may affect the mix of inputs used to produce the product or service? To what extent does your chosen company benefit from economies of scale?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd