Milestone 1 Requirements
For this milestone, you will be creating classes to represent the entrées and sides served at “Dogs ‘N Such” - a fast-food franchise focused on hot dogs. These will be created within the Data project of the solution you accepted from GitHub classroom.
General requirements:
- You need to follow the style laid out in the C# Coding Conventions
Assignment requirements:
You will need to create
Enum classes (2)
Hot Dog class
Side classes (4)
Purpose:
Review of how to create classes - Sets the stage for the rest of the semester. Everything included in this assignment you should have been exposed to before in CIS200 and CIS300. This assignment should be relatively straightforward, though it will take some time to complete. If you have any confusion after you have read the entire assignment please do not hesitate to reach out to a Professor Bean, the TAs, or your classmates over Discord.
Recommendations:
Get in the habit of reading the entire assignment before you start to code. Make sure you understand what is being asked of you. Please do not get ahead of yourself and have to redo work because you did not read the entire assignment.
Accuracy is important. Your class, property, enumeration and other names, along with the descriptions must match the specification given here. Otherwise, your code is not correct. While typos may be a small issue in writing intended for human consumption, in computer code it is a big problem!
Remember that you must document your classes. This includes a general identity comment at the top of your files, i.e.:
/*
* Author: Nathan Bean
* Edited by: (Only include if you are not the original author)
* File name: Something.cs
* Purpose: To inform the students of the requirements for this milestone
*/
- The tests provided in the DataTest project can be un-commented and run to check your work. You should not change these tests - if your code fails, it is your code that needs to change. Note these tests will not catch all possible issues in your code, as you will be adding to them in a future milestone.
Enum Classes
All enums should reside in the DogsNSuch.Data
namespace
There are three enums needed:
Size
- Done for you! Look below and in the repository code.Sausage
- The various kinds of sausage available, which include:- Beef
- Pork
- Kielbasa
- SpicyBeef
Bun
- The various kinds of buns available, which include:- SesameSeed
- Hoagie
- PizzaDough
- CornBreading
Dog Class
A Dogs ‘N Such hot dog is a combination of bun, sausage, and toppings. You will need to define a class to represent an individual hot dog, which can be customized after creation. You should name this class Dog
and declare it in the file Dog.cs in the DogsNSuch.Data
namespace. It should have the following properties:
Sausage
: A property with the Sausage
enum type, representing what sausage this hot dog is composed of. It should default to Beef.
Bun
: A property with the Bun
enum type, representing the bun the hot dog is served on. It should default to SesameSeed.
Ketchup
: A boolean property indicating if the hot dog is topped with ketchup (default true).
YellowMustard
: A boolean property indicating if the hot dog is topped with yellow mustard (default true).
BrownMustard
: A boolean property indicating if the hot dog is topped with brown mustard (default false).
SweetRelish
: A boolean property indicating if the hot dog is topped with sweet pickle relish (default true).
DillSpear
: A boolean property indicating if the hot dog is topped with a dill pickle spear (default false).
Sauerkraut
: A boolean property indicating if the hot dog is topped with sauerkraut (default false).
ColeSlaw
: A boolean property indicating if the hot dog is topped with cole slaw (default false).
ChoppedOnion
: A boolean property indicating if the hot dog is topped with chopped onion (default false).
SauteedOnion
: A boolean property indicating if the hot dog is topped with sauteed onion (default false).
FriedOnion
: A boolean property indicating if the hot dog is topped with fried onion (default false).
TomatoSlices
: A boolean property indicating if the hot dog is topped with slices of tomato (default false).
FriedPepper
: A boolean property indicating if the hot dog is topped with slices of fried peppers (default false).
Chili
: A boolean property indicating if the hot dog is topped with chili (default false).
CheddarCheese
: A boolean property indicating if the hot dog is topped with shredded cheddar cheese (default false).
SwissCheese
: A boolean property indicating if the hot dog is topped with shredded swiss cheese (default false).
BBQSauce
: A boolean property indicating if the hot dog is topped with BBQ sauce (default false).
CreamCheese
: A boolean property indicating if the hot dog is topped with cream cheese (default false).
CelerySalt
: A boolean property indicating if the hot dog is topped with a dash of celery salt (default false).
FrenchFries
: A boolean property indicating if the hot dog is topped with french fries (default false).
FriedPotatoes
: A boolean property indicating if the hot dog is topped with fried potatoes (default false).
Price
: A readonly property (i.e. it has only a get
and no set
) of type decimal
which is calculated based on the ingredients (see the table below).
Calories
: A readonly property of type uint
which is calculated based on the ingredients (see the table below).
The price and calories for each ingredient is:
Ingredient | Price | Calories |
---|---|---|
Beef sausage | 1.00 | 200 |
Pork sausage | 1.20 | 140 |
Kielbasa sausage | 2.00 | 220 |
Spicy beef sausage | 1.40 | 210 |
Sesame seed bun | 1.00 | 140 |
Hoagie bun | 1.00 | 260 |
Pizza dough | 2.00 | 130 |
Corn Breading | 1.50 | 86 |
Ketchup | 0.10 | 19 |
Yellow mustard | 0.10 | 3 |
Brown mustard | 0.15 | 15 |
Sweet relish | 0.10 | 20 |
Dill pickle spear | 0.20 | 3 |
Sauerkraut | 0.20 | 27 |
ColeSlaw | 0.20 | 291 |
Chopped Onion | 0.20 | 34 |
Sauteed Onion | 0.20 | 34 |
Fried Onion | 0.20 | 34 |
Fried Peppers | 0.20 | 172 |
Tomato Slices | 0.18 | 34 |
Chili | 1.00 | 256 |
Cheddar Cheese | 0.50 | 113 |
Swiss Cheese | 0.50 | 106 |
BBQ Sauce | 0.10 | 29 |
Cream Cheese | 0.10 | 291 |
Celery Salt | 0.02 | 0 |
French Fries | 1.00 | 365 |
Fried Potatoes | 1.00 | 365 |
Side Classes
Dogs ‘N Such offers 4 sides:
- Chili
- French Fries
- Fried Potatoes
- Cole Slaw
Each should have a class declared for it, in its own file. All sides should default to the small size.
Chili
You will need to define a class to represent a side of chili, which can be customized after creation. You should name this class Chili
and declare it in the file Chili.cs in the DogsNSuch.Data
namespace. It should have the following properties:
Size
: A property with the Size
enum type, indicating how large the bowl of chili is.
Cheese
: A boolean property indicating if the chili is topped with cheddar cheese. It should default to false.
Price
: A readonly property (i.e. it has only a get
and no set
) of type decimal
which is $1.00 for small, $2.00 for medium, and $3.00 for large, plus an extra $0.50 for cheese.
Calories
: A readonly property of type uint
which is 256 calories for small, 384 for medium, and 512 calories for large, plus an additional 113 calories if the chili is topped with cheddar cheese.
French Fries
You will need to define a class to represent a side of french fries, which can be customized after creation. You should name this class FrenchFries
and declare it in the file FrenchFries.cs in the DogsNSuch.Data
namespace. It should have the following properties:
Size
: A property with the Size
enum type, indicating how large the serving of french fries is.
Price
: A readonly property (i.e. it has only a get
and no set
) of type decimal
which is $1.00 for small, $2.00 for medium, and $3.00 for large.
Calories
: A readonly property of type uint
which is 360 calories for small, 540 for medium, and 720 calories for large.
Fried Potatoes
You will need to define a class to represent a side of fried potatoes, which can be customized after creation. You should name this class FriedPotatoes
and declare it in the file FriedPotatoes.cs in the DogsNSuch.Data
namespace. It should have the following properties:
Size
: A property with the Size
enum type, indicating how large the serving of fried potatoes is.
Price
: A readonly property (i.e. it has only a get
and no set
) of type decimal
which is $1.00 for small, $2.00 for medium, and $3.00 for large.
Calories
: A readonly property of type uint
which is 360 calories for small, 540 for medium, and 720 calories for large.
Cole Slaw
You will need to define a class to represent a side of cole slaw, which can be customized after creation. You should name this class ColeSlaw
and declare it in the file ColeSlaw.cs in the DogsNSuch.Data
namespace. It should have the following properties:
Size
: A property with the Size
enum type, indicating how large the serving of cole slaw is.
Price
: A readonly property (i.e. it has only a get
and no set
) of type decimal
which is $1.00 for small, $2.00 for medium, and $3.00 for large.
Calories
: A readonly property of type uint
which is 292 calories for small, 438 for medium, and 584 calories for large.
Submitting the Assignment
Since this is your first Milestone, let’s review how to submit milestones. You will be working out of repository hosted on Github.
Notice the “Releases” button in the top right of the picture. Click this button. You will be brought to the following screen.
Click “Create a new release”. When it loads assign a tag version. I assigned “v.0.1.0”. This is an example of semantic versioning, a common strategy used in software development to indicate different versions of the software. From the definition:
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
The v
just indicates ‘version’. Since our library isn’t ready for use yet, we use 0
for the Major version. Since we’ve added some code that includes new features that are backwards compatible (i.e. additional classes won’t cause conflicts with code using no classes), we’ll use 1
for the minor version. And we’ll leave the patch version at 0
.
If, after turning in your assignment you realized you missed something, you could create and submit a second release, with version v.0.1.1 (notice the patch version goes up by one because you’ve added a bug fix).
Click the “Publish release” button and use the release URL (copy it from your browser’s address bar) as your submission in Canvas. This is how you will submit all of your milestone assignments.
Review of the week
If you are having trouble with any of the concepts learned this week consider taking a look at the following links.