Structure of the new program - activity scheduler program

Assignment Help Computer Engineering
Reference no: EM131285604

Class Factory - Activity Scheduler

For this assignment you will modify the Activity Scheduler program, changing it to use the Class Factory design pattern. The behavior of the program is exactly as before. The structure of the new program is shown below:

1103_figure3.jpg

As before, assume that the user will enter the correct type of input in response to the prompts.

Classes IActivity, Activity, Name, LanId, and PhoneNumber

These classes are the same as before.

Class ScheduledActivity

This class is almost the same as before, except that now it both creates and destroys the IActivity objects:
- The constructor argument is now a pointer to a Factory object (not a pointer to an IActivity object). The constructor does exactly what it did before, except that it sets the attribute ‘activity' by invoking the Factory method NewActivity() (instead of setting it from the argument).
- The destructor now deletes the attribute ‘activity'.

Class Scheduler
This class is almost the same as before, except that it passes Factory objects to ScheduledActivity:
- Method addActivity() now takes a parameter that is a Factory* (instead of an IActivity*). It passes this parameter to the ScheduledActivity constructor.

Class Factory
This class is the interface for the four subclasses below. It has the following:
- A pure virtual method NewActivity(), which returns an IActivity*.
- A virtual destructor with an empty implementation (provided in the class declaration).

Classes ActivityFactory, LanIdFactory, NameFactory, and PhoneNumberFactory
These four classes implement interface Factory. Each provides an implementation of method NewActivity(), returning a new object of the appropriate type. (For example, ActivityFactory::NewActivity() returns a new Activity object, LanIdFactory::NewActivity() returns a new LanId object, etc.)

File MainControl.cpp, method main
This method is simpler than before, since it is no longer responsible for creating and destroying activities. Instead it creates four Factory objects (NameFactory, LanIdFactory, PhoneNumberFactory, and ActivityFactory). It passes each of these to the scheduler's addActivity() method, and deletes all four Factory objects. Then it calls the scheduler's run() method, and returns 0.

General Information
Make sure you follow all coding conventions.

Make sure you have no memory leaks: delete any objects that are no longer reachable by any pointer.

Reference no: EM131285604

Questions Cloud

Current emergency plan : Assume that your selected agency received funding to expand its current emergency plan, which involves the Department of Corrections and Department of Juvenile Justice. Provide a one-page email memorandum that introduces the plan, the role of the ..
Who do you think uses internet dating services : Who do you think uses Internet dating services? What, if anything, should dating services do to protect their clients?
Determine the steadystate amplitude of the block : For the system shown, m = 5.5 kg, k = 2300 N/m, and c = 37 N · s/m. The horizontal displacement imposed on the shaker table B is y(t) = 2.5 sin 18t mm, where the time t is measured in seconds. Determine the steadystate amplitude of the block.
Philosophical and legal issues this case raises : Review "The Katrina Breakdown" in Chapter 3. Setting aside the philosophical and legal issues this case raises, identify and explain two to three management or efficiency arguments for and against a more centralized response to large national disa..
Structure of the new program - activity scheduler program : Modify the Activity Scheduler program, changing it to use the Class Factory design pattern. The behavior of the program is exactly as before.
The ways marketing has helped our political process : What are some of the ways marketing has helped our political process? What are some ways the marketing of politicians might have an adverse effect on our government?
Human resource competency study aid : How would the HR skills identified in the Human Resource Competency Study aid an HR executive in assessing potential outsourcing partners?
Find the damping coefficient of each spring : An electric motor and its base have a combined mass of M = 12 kg Each of the four springs attached to the base has a stiffness k = 480 kN/m and a viscous damping coefficient c.
Why did black actors play in roles that were not necessarily : How were black actors portrayed in independent black films? Why did black actors play in roles that weren't necessarily positive stereotypes? What is meant by the "No Negro" era?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create and extened class named suite

make a class named HotelRoom that includes an interger field for the room number and a double field for the nightly rental rate. Include get methods for these fields and constructor that requires an interger argument representing the room number.

  Give one huge advantage of using javascript

One huge advantage of using JavaScript is you can accept input from the visitors to your site. As a visitor adds information to your form, what would you do to control inappropriately entered values.

  Discuss two approaches to system development

Discuss two approaches to system development. Describe system analysis and the major activities that occur during this phase of the systems development life cycle.

  Program that convert temperature in fahrenheit

Write a program that will convert a temperature in Fahrenheit to Celsius and Kelvin. The temperature to convert should be captured from user input. The formulas for converting the temperatures are:

  Download an image from the online companion web site

Download an image from the Online Companion Web site or find out an image of your own. Add text around the image. Experiment with the float property and its values to view the way that the text wraps.

  Discuss the different types of project feasibility factors

List and discuss the different types of project feasibility factors.

  It needs to sort the list in descending order

Let us suppose you are the manager of a firm and have list of employees with the number of days they were absent from work. If you want to find the top 10 absentees in the firm you will need to sort the list in descending order.

  Compute the greatest common divisor of two integers

Write down a recursive function that calculates the greatest common divisor of two integers using the Euclidean algorithm. Write a driver program to test your function.

  Choose one of the network tools found in a windows 2000

Select one of the network tools found in a Windows 2000 server. Look up use of this tool. Using a creative writing narrative format write a short story explaining how you will use this tool to keep the network running successfully.

  How the smallest word is at offset 0000

Sort all the words in memory that could be considred to be decimal ASCII-coded numbers. An ASCII-coded word can vary from 3030h (00d) to 3939h (99d). Sort the ASCII words so that the smallest word is at offset 0000.

  Analyze the technologies for analog-to-digital

Write a 3- to 5-page paper that provides a detailed technical analysis comparing the advantages and disadvantages of analog and digital technology. With this understanding, do the following: Analyze the technologies for analog-to-digital and digita..

  How to produce an average class with a public data

How to produce an Average class with a public data Produce an Average class with a public data member to collect the sum of integer entries and a public data member to hold the double average of the sum of the 10 integers.

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