Write a main program that first reads all available meals

Assignment Help Programming Languages
Reference no: EM131316511

Assignment

A catering company provides prepared meals for events such as business meetings. The company has a number of standard meals, which it identifies with a unique integer ID number. At this stage each meal also has just a cost in £ and each event is characterised by a list of the meals the company must prepare for it. However, more characteristics may be added to either object in the future.

The company desires that you develop a basic software package that it will be able to use in order to manage its business efficiently and which it intends will be expanded in the future.

Part 1

Your first task is to develop the basic meal and event classes. Please provide just the minimum functionality expected of any well designed class. Please make any required design decisions in the context of the project described above and in accordance with good software engineering practice.

Part 2

Provide stream operators for both the meal and event classes. Examination

Part 3

Add to the event class two member functions that return its most expensive meal and the total cost of all the meals.

Part 4

Write a main program that first reads all available meals from a file called menu.txt. Write a function called create_event. This function is be called if a customer of the company wants to book an event.

The function is to show the customer the details of all the available meals and then ask the customer to enter which meals they wish to select. Once complete, the function is to return a dynamically created event object.

Note well, the customer must be allowed to choose to abort the process within the function in which case consider carefully the return value of the function.

Finally the main program is to print to screen the total cost of the event.

Note well, the formatting and creation of an example of the file menu.txt is your responsibility.

Part 5

To provide for future expansion, it is now considered appropriate to generalise to the concept of a event.

All events, of whatever sub-category, are to contain the member variables and functions described above.

A particular sub-category of event is to be weekend_event. The price of all meals for a weekend_event is to be x% higher than the usual prices given above in the menu.txt file of task 4 for example. Each weekend_event can have a different value of x.

Please modify your basic class declaration and definition code (not the full code of task 4) to reflect the relationship between event and weekend_event.

In particular, ensure that the functionality of task 3 gives the correct costs when called through an event pointer.

Reference no: EM131316511

Questions Cloud

Calculate the binomial interest rate tree : Assume annual compounding of interest for these problems. Assume 10% annual interest rate volatility. Calculate the binomial interest rate tree using the 2-year on-the-run issue and the 3-year on-the-run issue.
Define pm assessment in context of the pmo : For this assignment, address the following items: Define PM assessment in context of the PMO infrastructure management. Describe the primary domains of encompassing PMO assessment
Write program that calculate and prints the monthly paycheck : Write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15%.
Nonconstant growth valuation-stock current price : Nonconstant Growth Valuation A company currently pays a dividend of $1.5 per share (D0 = $1.5). It is estimated that the company's dividend will grow at a rate of 24% per year for the next 2 years, then at a constant rate of 5% thereafter. The compan..
Write a main program that first reads all available meals : Write a main program that first reads all available meals from a file called menu.txt. Write a function called create_event. This function is be called if a customer of the company wants to book an event.
Find inertial force acting on the man at the position shown : A man walks along a guide at a constant velocity υ on a disk in the vertical direction in Fig. P5.2 while the disk rotates at a constant angular velocity ω. Find the inertial force acting on the man at the position shown.
Current and projected free cash flows-horizon value : Current and projected free cash flows for Radell Global Operations are shown below. Actual 2013 2014 Projected 2015 2016 Free cash flow $619.52 $680.20 $720.25 $763.47 (millions of dollars) Growth is expected to be constant after 2015, and the weight..
Write a burger tycoon project paper : Each student is to write a Burger Tycoon Project paper (1-2 typed pages, single spaced, professionally prepared) which is due at the last class session
Integrative problem exchange rate behavior : As an employee of the foreign exchange department for a large company, Determine whether triangular arbitrage is feasible, and if so, how it should be conducted to make a profit. Using the information in question 1, determine whether covered interest..

Reviews

Write a Review

Programming Languages Questions & Answers

  Prepare calculator application - mock objects for testing

Which other classes do you think will need to be stubbed with mock objects for testing the application? For each class you identify explain why you think that class needs mocking and at least three di erent mocked behaviours you will need.

  What are advantages of using menus in a gui application

What are advantages of using menus in a GUI application? Design a menu structure for a program you would find useful in your work or hobbies. Write and post the code for the menu creation

  Implement and test the human resource information system

Assignment C# Application & Test Report - As part of your development efforts you will prepare and apply a small collection of test cases to verify that the completed application meets some of the key requirements agreed with the client - Your smal..

  Explain sql queries

For this week, imagine that you have been hired by a company to build a database for it and complete the given tasks

  Program compares the number entered to the previous number

The program compares the number entered to the previous number. In the event that it is a duplicate number, the user will be prompted to enter a different number. Display the number to the screen as long as it is not a duplicate.

  Designing system to handle donations of non-profit agency

You have been hired by worldwide non-profit agency to create a system to handle their donations.

  The process of identifying the classes or functions

How the two programs were selected and The process of identifying the classes or functions for replacement

  Write a function that uses stream-map

Now write a function that uses stream-map to produce the sum of two streams element by element for the first x elements . Be sure to test with several different types of streams (for example, you could sum together the odd and even numbers betwee..

  Write the program which processes test data

Write the program which processes test data. Output must be student's ID, followed by answers, followed by test score, followed by test grade. Suppose the following grade scale.

  Design and code a program including the given classes

Design and code a program including the following classes, as well as a client class to test all the methods coded: A Passenger class, encapsulating a passenger.

  Design program to ask user to enter amount of purchase

Design a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax.

  Explain what purpose it serves

List three debugging techniques, within the debugger, that can be used to locate logical error in the Java code. For each of these tools, explain what purpose it serves and how it relates to the debugging process

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