联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-12-15 10:30

COM6471 Assignment 3: An Entire Restaurant

December 2, 2019

Introduction

This assignment expands on the previous assignment. Instead of a cafe that

only sells pies, this assignment asks you to consider a full restaurant that sells

a range of meals, a selection of drinks, and has the responsibility of managing

stock and inventory, as well as calculating suitable prices for its menu.

This assignment is broken down into five tasks. You should attempt all of

the tasks, but if you find one difficult you should still attempt the others and

submit whatever you produce.

1 Meals

Extending on the concept of Pies in the previous assignment, you should produce

suitable Java classes to model a range of possible meal types. You must include

at least these three meal types: Pie, Fish, and Steak. You are welcome to

include a few other relevant or interesting meal types. Each of these classes can

be instantiated, so ”Steak Pie” and ”Chicken Pie” are both examples of Pies;

”Fillet” and ”Rump” are both examples of Steak.

You should design and implement an efficient and maintainable class hierarchy

to represent these. You must make your system track the Ingredients of

each Meal, just as you did with the Pies in the previous assignment. As with the

Pies, you must track whether Ingredients are Vegetarian or Vegan, or neither.

The Meal class must have isVegetarian and isVegan() methods.

2 Prices

To compute an ideal sale price for the Meals, the restaurant wants to add up

the price of all the ingredients and add a 20% markup to cover staff costs etc.

You should augment your Ingredients with a cost attribute that records the

cost per unit of the Ingredient, and appropriate accessor and mutator methods.

You can then add a price() method to the Meal class which computes and

returns the sale price of a Meal.

1

Since not all Meals use the same quantity of particular ingredients, you

should further augment your Meal class to not only keep track of what Ingredients

are used, but also how much of each ingredient as a floating point number

(you might use 0.2kg of peas, or 2.5 chicken breasts). This should be factored

into the price.

3 Drinks

As well as meals the restaurant sells a range of Drinks. These include Beers,

Red Wines, White Wines, and Soft Drinks. You should produce a design and

implementation of a class hierarchy to represent Drinks. You should include

some attributes that you think appropriate — price, for example.

Matching of food to drinks is important in a high-class restaurant. You

should implement a drinksRecommendation() method in the Meal class that

returns a Drink. However, this should be abstract in the Meal class. The Pie

class should always return something from the Beer class, the Fish class should

always return something from the WhiteWine class, and the Steak class should

always return something from the RedWine class.

4 A Full Menu

You can now produce a full menu. Create a class that can contain many meal

items. It should have a void display() method that prints the menu to the

screen. Ideally it should be broken down by the class of the meals — i.e. Pies in

one section, Fish in another — and should also display the price neatly alongside

the items.

This class should also contain a static main method that creates a populated

Menu instance and displays it. You should try to demonstrate as many features

as possible of your system in this example.

5 Report

You should submit a report in clear, technical English that describes your Java

code, how the components operate, and how they interact. It must include at

least these sections:

A title page containing the title, your name and registration number, and

the following statement: I declare that this work is my own and I acknowledge

the contribution of others where appropriate.

Overview that describes the Meal classes, and the Drinks classes, and how

they fit together to form a coherent system. UML diagrams are allowed but not

required, other informal diagrams are also acceptable, but you should include

sufficient English prose description as well.

Meals, Prices, Drinks, Menus

2

These sections document each of the sets of classes and methods in more

detail. They should be technical descriptions of the individual classes with

suitable OO language used to describe their methods and attributes.

Conclusion a summarisation of the submitted system and a brief (constructive!)

description of your understanding of Java and OO design.

There is no strict word limit for this assignment but as a rough guide: less

than 1000 words is unlikely to be sufficiently detailed, while much more than

2000 is probably excessive.

Submission and Marking

As with the previous assignments, you should submit your .java files through

MOLE. You should also submit your written report through MOLE in PDF

format. The individual components will be marked as follows:

Meals [25%]

20 — 25 A set of classes with the correct inheritance structure and

methods at optimal points in the structure, making use of

polymorphism

15 — 20 A set of classes with the correct inheritance structure and

methods at reasonable points within that structure

10 — 15 A set of classes with the correct inheritance structure and

methods

5 — 10 A set of compilable class files with the required methods

0 — 5 A set of compilable class files

Prices [15%]

10 — 15 An elegantly implemented set of properties and methods to

achieve the objective.

5 — 10 An adequate set of properties and methods to achieve the

objective.

0 — 5 Credit given for whatever appears.

Drinks [15%]

10 — 15 An efficient and effective use of classes and subclasses to

achieve the objective.

5 — 10 An adequate use of classes and subclasses to achieve the

objective.

0 — 5 Credit given for whatever appears.

Menus [20%]

15 — 20 Effective class definition and methods, and a convincing

demonstration in the main method.

10 — 15 Functional class definition and methods and a demonstration

in the main method.

5 — 10 A class definition and set of methods that achieve some of

the objective, and that is partially demonstrated.

0 — 5 Credit given for whatever appears.

3

Report [25%]

20 — 25 A clear description of the overall system, separated into logical

sections to form OO elements, which are then described

in accurate, technical detail.

15 — 20 Each submitted code section described in an accurate technical

fashion, and the interactions between components discussed

10 — 15 Each submitted code section described in an accurate, technical

fashion

5 — 10 Each submitted code section at least described

0 — 5 Credit given for whatever appears

You are reminded that the University of Sheffield takes the use

of unfair means very seriously. The code you present for this assignment

must be entirely your own work. Code that is plagiarised — that is, copied

from somewhere else — is not acceptable and you will receive zero for this

assignment and be called to a departmental unfair means panel where it will be

investigated further. If you are found to have knowingly allowed your work

to be plagiarised you will also receive zero and be further investigated.

Since the purpose of these assignments is to test your knowledge of Object

Oriented design and Java, you must also avoid collusion — that is, discussing

your design or implementation with your classmates to such a degree that you

end up submitting similar work. Even if you have produced the code independently,

part of the object of the assignment is to evaluate your Object Oriented

design approach, so you must develop your solution independently.

4


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp