Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

NIT3112 Advanced Web Development P a g e 1 | 6 Coffee Victoria POS Lab Assessment 1 – Practical Programming Project Due date: Refer to Assignment Submission Box on VU Collaborate *** No late...

1 answer below »
NIT3112 Advanced Web Development
P a g e 1 | 6
Coffee Victoria POS
Lab Assessment 1 – Practical Programming Project
Due date: Refer to Assignment Submission Box on VU Collaborate
*** No late submission ***
Weighting: 15% of total assessment
You are to work individual, one copy of the assignment.
Submission details are at the end of this document.
Objectives:
This assessment is designed to assess your understanding of variables, constants, types,
operators, input/output, loops, if statements, classes, objects and functions.
Problem Description:
Coffee Victoria POS is a small-CBD Coffee Shop in NSW Australia. The population is bustling,
so the Coffee Shop sells select products to maintain the rush time (
eakfast and lunch). It sells
five products only. Each product has a name and a price.
The programmer requires to demonstrate basic C# programming techniques, specifically using
classes and objects. This assignment aims to develop a top-down design and to write a
program to be used as a cash register by the Coffee Victoria POS.
Application Requirements : For our program simulation, a purchase transaction is sale and
payment of a single product. For each sale, the program should prompt and get a numbered item
co
esponding to the product name and quantity of the product purchased. The total cost of the
purchase should be calculated and displayed. Then the program should ask the amount of
money paid by the customer. The calculated change will be displayed in dollars and cents as
well as the cu
ency denominations in banknotes and coins needed to make up the change in the
most efficient way.
For example:
If the amount of change is $37.35, then the customer would be given:
• One twenty-dollar banknote, • One ten-dollar banknote,
• One five-dollar note, • One two-dollar coin,
• One twenty-cent piece, • One ten-cent piece,
• and one five-cent piece.
NIT3112 Advanced Web Development
P a g e 2 | 6
At the end of the day, the cashier enters “Done” to end the simulation. The program should then
display the total amount of sales in each of the five categories and terminate. The five-product
Menu is shown in table 1.
Item number Item name Item price
1 Coffee (cappuccino, Latte, Espresso) $3.75
2 Drink 500ml $4.5
3 Roll (Fish, Lamb, Chicken, Beef) $9.95
4 Toasted (egg and Cheese)’ $5.95
5 Muffin $4.99
6 Done [ ]
Analysis
The program will be launched from the main class “CoffeeVictoriaPOS”. “Product” class is a
good choice for a class with information about products for sale in the “CoffeeVictoriaPOS”.
The price can be set or updated by calling setPrice () method in the Product class. Also, we will
construct a class “Change” to return the co
ect change and cu
ency denominations for a
particular sale, by calculating the smallest number of required $100, $50, $20, $10, $5 banknotes
and $2, $1, 50c, 20c, 10c, 5c coins. Figure 1, illustrates the classes that need to be implemented.
Figure 1: UML Classes
NIT3112 Advanced Web Development
P a g e 3 | 6
Methods required in the classes:
A. The public class Product
Product (String name)
constructor initializes data attributes
setPrice (int cents)
sets Product price in cents.
addToTotal(int amount)
adds cu
ent sale to total, recorded in cents
getName( )
eturns the product name
getPrice( )
eturns product's price in cents
getTotal( )
eturns day's sales in cents
B. The class Change
Change ()
constructor initializes data attributes
denChange (int amount)
calculate and store cu
ency denominations
getNotes ()
eturns a
ay of banknote denominations
getCoins ()
eturns a
ay of coin denominations
Data Input
• Product name (follow the table one).
• Use Menu’s item number to select the desired product.
• User must enter the quantity
• Amount of money received from the customer in cents
Output
• The total amount of purchase = quantity * product_price
• Change returned to customer = amount tendered − amount purchased)
• In addition to the amount of change, display the number of hundred-dollar, fifty-dollar,
twenty-dollar, ten-dollar and five-dollar notes, two-dollar coins, one-dollar coins, fifty-
cent, twenty-cent, ten-cent and five-cent coins.
• At the end of the day (menu item 6. Done entered) display the total dollars of sales fo
each of the five product categories and totals for the day.
NIT3112 Advanced Web Development
P a g e 4 | 6
Figure 2: Main Menu (output Screen)
Figure 3: User Select order number & Qty. from Menu (output Screen)
Figure 3: User Enter $ XXXXXXXXXXfor the order system display change must be given (output Screen)
NIT3112 Advanced Web Development
P a g e 5 | 6
Figure 4: User select six from the Main Menu, the system display end of day sales (output Screen)
What do you have to hand in?
An electronic copy of
1. Your application project packed as a single zip file.
2. Readme.docx file with information on how to run your program. Include any extra information
about your design and program that you wish the marker to know.
3. A word document with the evidence of trial runs of your program.
4. Code for all the classes that have been compiled and are ready to run.
5. A
ief description of each class. At the start of each method, there should be a comment clearly
describing what the method does.
Each class should be fully documented commencing with a heading. In particular, the
heading should include your name, unit, assignment details, date written and a
ief
description of the class.
: Start Early! Do not underestimate the amount of time needed to write and test the program, nor
the complexity of this assignment.
https:
commons.wikimedia.org/wiki/File:Nuvola_apps_important.svg
https:
commons.wikimedia.org/wiki/File:Nuvola_apps_important.svg
https:
commons.wikimedia.org/wiki/File:Nuvola_apps_important.svg
https:
creativecommons.org/licenses
y-sa/3.0
https:
creativecommons.org/licenses
y-sa/3.0
https:
creativecommons.org/licenses
y-sa/3.0
NIT3112 Advanced Web Development
P a g e 6 | 6
NIT3112 – Assignment
Name……………………….
ID No……………………….
Markers Guideline Allocated Marks Achieved
Description of how to solve the problem plus
eadme.docs file. Printout of extensive trial runs
15
class Product & Change — design and implementation
40
class CoffeeVictoriaShop — design and implementation
10
Other classes for CLI application — usability and
implementation. 10
Output & Functionality — program works and meets
specification. 15
Originality, user friendliness and presentation.
Appropriate commenting of code and readability of the code. 10
Total 100
Answered Same Day Nov 01, 2021 NIT3112

Solution

Arun Shankar answered on Nov 03 2021
149 Votes
main.cs
using System;
class Change
{
int[] notes;
int[] coins;

NumberFormat formatter;

Constructor
public Change(){
notes = new int[7];
$1, $2, $5, $10, $20, $50, and $100
coins = new int[5];
1c, 5c, 10c, 20c, 50c
}

The function calculates and stores

cu
ency denominations
public void denChange(int amount)
{

Make the notes[] a
ay
if(amount >= 10000){
notes[0] = amount/10000;
amount = amount % 10000;
}
if(amount >= 5000){
notes[1] = amount/5000;
amount = amount % 5000;
}
if(amount >= 2000){
notes[2] = amount/2000;
amount = amount % 2000;
}
if(amount >= 1000){
notes[3] = amount/1000;
amount = amount % 1000;
}
if(amount >= 500){
notes[4] = amount/500;
amount = amount % 500;
}
if(amount >= 200){
notes[5] = amount/200;
amount = amount % 200;
}
if(amount >= 100){
notes[6] = amount/100;
amount = amount % 100;
}

Make the coins a
ay
if(amount >= 50){
coins[0] = amount / 50;
amount = amount % 50;
}
if(amount >= 20){
coins[1] = amount / 20;
amount = amount % 20;
}
if(amount >= 10){
coins[2] = amount / 10;
amount = amount % 10;
}
if(amount >= 5){
coins[3] = amount / 5;
amount = amount % 5;
}
if(amount >= 1){
coins[4] = amount;
}
}

public int[] getNotes(){
return notes;
}

public int[] getCoins(){
return coins;
}

public static String cu
ency(int cents){
return "$" + (cents/100) + "." + (cents % 100);
}
}
end of class Change
class Product
{
String name;
int price;
int total;

Constructo
public Product(String _name){
this.name...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here