99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP 2012代做、代寫C++設(shè)計編程

時間:2024-04-01  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
COMP 2012 Object-Oriented Programming and Data
Structures
Assignment 1 Food Ordering System
Source: DALL-E
Introduction
In this assignment, we will combine the concepts of Object-Oriented Programming (OOP)
principles and utilizes C++ to construct a food ordering system. We will leverage the power
of OOP concepts like classes and objects to model real-world entities such as Order,
Buyer, and Menu. These classes will encapsulate relevant data and functionalities, ensuring
proper implementation. Additionally, we will employ basic C++ constructs like functions,
loops, and conditional statements to implement functionalities like adding items to
the menu, placing orders, and managing user interactions.
Furthermore, for this assignment you will work on these major functionalities.
Seller Actions
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 2 of 19
View menu
Update menu
Add food item
Update food price
Remove food item
View orders
Process orders
Buyer Tasks
View menu
Place order
View my order
Copy an order
End of Introduction
Code overview
The following section describes the given classes and their purposes. You are given the
following files:
Buyer.h
Food.h
Menu.h
Order.h
OrderList.h
main.cpp
Now let's have a quick go through for each files that includes classes and function to create
a Food Ordering System.
Buyer Class (Buyer.h)
The file Buyer.h is a C++ header file defining a class named Buyer. The Buyer class
provides a way to create and manage buyer objects with their unique IDs and names. It
offers methods to access this information securely and modify it when necessary.
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 3 of 19
class Buyer {
private:
 int buyerID;
 string buyerName;

public:
 //Default Constructor
 Buyer(int id = 0, const string& name = "");
 //Setter and getter methods for Buyer ID
 int getBuyerId() const;
 void setBuyerId(int newId);
 //Setter and getter methods for Buyer Name
 string getBuyerName() const;
 void setBuyerName(const string& newName);
};
Explanation of Buyer Class
The provided code defines a class named `Buyer` that represents a buyer in a system.
Member Variables
buyerID: An integer variable to store the unique identifier of the buyer.
buyerName: A string variable to store the name of the buyer.
Constructor
Buyer(int id = 0, const string& name = "")
This is the constructor for the `Buyer` class. It takes two optional arguments to initialize a
new `Buyer` object:
id (integer): An integer representing the buyer's ID (defaults to 0).
name (const string&): A constant string reference to the buyer's name (defaults
to an empty string).
Member Functions (Getters and Setters)
The `Buyer` class provides methods to access and modify its member variables in a
controlled manner:
getBuyerId() const: This function retrieves the current value of the `buyerID`
member variable and returns it as an integer. It's a **const** function, meaning it
guarantees not to modify the object's state.
setBuyerId(int newId): This function allows you to set a new value for the
`buyerID` member variable. It takes an integer argument (`newId`) representing the
new buyer ID.
getBuyerName() const: This function retrieves the current value of the
`buyerName` member variable and returns it as a string. Similar to `getBuyerId`, it's a
**const** function.
setBuyerName(const string& newName): This function allows you to set a new
value for the `buyerName` member variable. It takes a constant string reference
(`newName`) representing the buyer's new name.
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 4 of 19
By using getters and setters, the `Buyer` class promotes data encapsulation. It restricts
direct access to the member variables and provides controlled ways to retrieve and update
their values.
Food Class (Food.h)
The file Food.h is a C++ header file defining a Food class. The Food class provides a
structured way to represent and manage food items with their unique IDs, names, and
prices. It offers methods to control access to these attributes and allows for creating deep
copies of existing food items.
class Food {
private:
 int foodID;
 string foodName;
 float price;
public:
 //Default Constructor
 Food(int id = 0, const string& name = "", float price = 0.0);

 // Copy constructor for Food
 Food(const Food& other);
 //Setter and getter method for Food ID
 void setFoodId(int newId);
 int getFoodId() const;

 //Setter and getter method for Food Name
 void setFoodName(const string& newName);
 string getFoodName() const;

 //Setter and getter method for Food Price
 void setPrice(float newPrice);
 float getPrice() const;

};
Explanation of Food Class
The provided code defines a class named `Food` that represents a food item within a
system.
Member Variables
foodID: An integer variable to store the unique identifier of the food item.
foodName: A string variable to store the name of the food item.
price: A float variable to store the price of the food item.
Constructors
The `Food` class includes two constructors for creating new `Food` objects:
Default Constructor:
Food(int id = 0, const string& name = "", float price = 0.0);
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 5 of 19
This constructor takes three optional arguments for initializing a new `Food` object:
id (integer): An integer representing the food item's ID (defaults to 0).
name (const string&): A constant string reference to the food item's name
(defaults to an empty string).
price (float): A floating-point number representing the price of the food item
(defaults to 0.0).
Copy Constructor:
Food(const Food& other);
This constructor creates a deep copy of an existing `Food` object, ensuring
independent memory allocation for the copied data. While completing the copy
constructor task make sure you implement this as a delegated constructor.
Member Functions (Getters and Setters)
The `Food` class provides methods to access and modify its member variables:
getFoodId(): Returns the current value of the `foodID` member variable.
setFoodId(int newId): Sets a new value for the `foodID` member variable.
getFoodName(): Returns the current value of the `foodName` member variable.
setFoodName(const string& newName): Sets a new value for the `foodName`
member variable.
getPrice(): Returns the current value of the `price` member variable.
setPrice(float newPrice): Sets a new value for the `price` member variable.
Menu Class (Menu.h)
The file Menu.h is a C++ header file defining a Menu class. The Menu class provides a
structured way to manage a collection of food items within a menu system. It provides
functionalities to add, remove, display, and manage food items within a menu.
Explanation of Menu Class
class Menu {
private:
 Food* foodItems; // Dynamic array of food items
 int currentSize; // Current number of food items
 int capacity; // Maximum capacity of the array
 int nextFoodId; // Track the next available food item ID

public:
 Menu(); // Constructor to initialize currentSize and allocate memory for foodItems
 ~Menu(); // Destructor to free allocated memory
 void addFood(const Food& food);
 bool removeFood(int id);
 void displayMenu() const;
 void manageFoodItems();
 const Food* getFoodById(int id) const;
private: //Helper Functions
 bool isFull() const { return currentSize == capacity; }
 void resizeArray(); // Resizes the array if needed
 int findFoodIndex(int id) const;
};
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 6 of 19
The provided code defines a class named `Menu` that represents a menu system for
managing food items.
Member Variables
foodItems: A pointer to a dynamic array of `Food` objects. This array stores the
actual food items included in the menu.
currentSize: An integer variable that keeps track of the current number of food
items stored in the `foodItems` array.
capacity: An integer variable that specifies the maximum number of food items the
`foodItems` array can hold.
nextFoodId: An integer variable that is used as a counter to track the next available
food item ID which should be a unique value. This variable is then used to assign new
Food item ID (a new and unique value) when added to menu.
Public Member Functions
Menu() (Constructor): This constructor initializes the `Menu` object. It sets
`currentSize` to 0, 'nextFoodId' to 1, and allocates memory for the `foodItems` array
with a chosen initial capacity. NOTE: Assign capacity value to 10 in the beginning.
~Menu() (Destructor): This destructor is responsible for freeing the memory allocated
for the `foodItems` array when a `Menu` object goes out of scope, preventing memory
leaks.
addFood(const Food& food): This function adds a new food item to the menu. It
takes a reference to a `Food` object (`food`) and adds it to the `foodItems` array.
removeFood(int id): This function removes a food item from the menu based on its
ID (`id`). It searches for the food item with the matching ID and removes it from the
`foodItems` array.
displayMenu() const: This function displays the information about all food items
currently in the menu. It iterates through the `foodItems` array and displays details of
each food item.
manageFoodItems(): This function provides an interface for managing food items in
the menu. It offer options to add, remove, edit, or perform other operations on the food
items.
getFoodById(int id) const: This function retrieves a pointer to a `Food` object
from the menu based on its ID (`id`). It searches for the food item with the matching ID
and returns a pointer to it, or `nullptr` if not found.
Private Helper Functions
isFull() const: This helper function checks if the `foodItems` array is at full
capacity. It returns `true` if the `currentSize` equals the `capacity`.
resizeArray(): This private function handles resizing the `foodItems` array if
needed. It called by `addFood` if the array is full, increasing the capacity and
reallocating memory for the array.
findFoodIndex(int id) const: This helper function searches for the index of a
food item with a specific ID (`id`) within the `foodItems` array. It iterates through the
array and returns the index if a match is found, or -1 if not found.
Order Class (Order.h)
The file Order.h is a C++ header file defining a Order class. The Order class provides a way
to represent and manage customer orders, including the ordered food items, buyer
information, and unique order ID. It offers functionalities to add items (with max size 10),
display order details, create order clones, and retrieve relevant information.
Menu
Introduction
Description
Resources & Sample
I/O
Submission &
Deadline
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 7 of 19
Explanation of Order Class
The provided code defines a class named `Order` that represents a customer's order within
a system. It manages the details of the ordered items, buyer information, and order ID.
Member Variables
`orderId (private)`: This integer variable stores a unique identifier that distinguishes
each order within the system, ensuring no duplicate orders are created.
`currentNum (private)`: This integer variable tracks the current number of food items
included in the order, indicating the order's overall size.
`orderedItems (private)`: This array of `Food` objects, with a fixed capacity of 10,
stores the individual food items that have been added to the order. It acts as a central
repository for the order's contents. NOTE: DO NOT CHANGE THE ARRAY SIZE.
`buyer (private)`: This member variable holds an object of the `Buyer` class,
containing information about the customer who placed the order. This enables
association of orders with specific buyers.
Public Member Functions
Order() (Default Constructor): This function automatically initializes a new `Order`
object upon its creation. It will assign the 'orderId' and 'currentNum' value to 0.
addItem(const Food& item): This function is responsible for adding a new `Food`
item to the `orderedItems` array. It takes a reference to a `Food` object (`item`) as
input. However, it needs to manage the fixed size of the array, by returning a
success/failure indicator.
displayOrder() const: This function presents a visual summary of the order's
details, including the order ID, buyer information, and a list of the ordered food items
with their relevant details. It provides a clear readout of the order's contents.
cloneOrder(const Order& other): This function generates a self-contained copy
of another existing `Order` object (`other`). It involves replicating the `currentNum`,
and performing deep copies of the `orderedItems` array to ensure independent
memory storage.
getBuyer() const: This function grants read-only access to the `buyer` object
within the order, enabling retrieval of buyer information without the ability to modify the
class Order {
private:
 int orderId;
 int currentNum;
 Food orderedItems[10]; // Array to hold ordered food items (fixed size)
 Buyer buyer;
public:
 Order(); // Default Constructor
 bool addItem(const Food& item);
 void displayOrder() const;
 void cloneOrder(const Order& other);
 const Buyer& getBuyer() const;
 void setBuyer(int newBuyerId, string newBuyerName);
 int getcurrentNum() const;
 void setOrderId(int newId);
 int getOrderId() const;
};
Frequently Asked
Questions
Changelog
Page maintained by
USMAN Muhammad
Email: usman@ust.hk
Last Modified:
03/29/2024 11:50:38
Homepage
Course Homepage
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 8 of 19
original object. It maintains data integrity.
getCurrentNum() const: This function reveals the current count of food items
within the order, providing insight into the order's size and contents.
setOrderId() const: Sets a new value for the `orderId` member variable.
getOrderId() const: This function returns the unique order ID, allowing for external
identification and tracking of specific orders within the system.
Order List Class (OrderList.h)
The file OrderList.h is a C++ header file defining a OrderList class. The OrderList class
provides a way to manage a collection of orders using a linked list. It offers functionalities to
add, remove, find, and display orders in the system.
Explanation of OrderList Class
The provided code defines a class named `OrderList` that manages a collection of `Order`
objects using a linked list data structure. It provides functionalities to add, remove, find,
display, and filter orders based on buyer ID.
Member Variables
**Private:**
head: A pointer to the first node (`OrderNode`) in the linked list. This serves as the
entry point for traversing the list.
Nested Struct: OrderNode
The `OrderList` class utilizes a private nested struct named `OrderNode`. This struct
defines the building block of the linked list, representing a single node that stores an `Order`
object and a pointer to the next node in the list.
order: An `Order` object, holding the details of a customer's order.
class OrderList {
public:
 OrderList();
 ~OrderList();

 void addOrder(const Order& order);
 bool removeOrder(int orderId);
 Order* findOrder(int orderId) const;
 void displayOrderList() const;
 void displayOrdersForBuyer(int buyerId) const;
 bool isEmpty() const;
private:
 struct OrderNode {
 Order order;
 OrderNode* next;
 const Buyer& buyer = order.getBuyer(); // Get a reference to the Buyer object
 OrderNode(const Order& order, OrderNode* next = nullptr) : order
 };
 OrderNode* head; // Pointer to the first node in the linked list
};
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 9 of 19
next: A pointer to the next `OrderNode` in the linked list. It allows traversing the list by
following these pointers from node to node.
buyer (const Buyer&): A constant reference to the `Buyer` object associated with
the `order`. This reference is retrieved using the `getBuyer()` method of the `Order`
object within the node.
OrderNode(const Order& order, OrderNode* next = nullptr)
(Constructor): This constructor initializes a new `OrderNode` object. It takes an
`Order` object by reference (`order`) and an optional pointer to the next node (`next`).
It creates a new node storing the order and setting the `next` pointer accordingly
(defaults to `nullptr` if not provided).
Public Member Functions
OrderList() (Constructor): This constructor initializes the `OrderList` object. It set
the `head` pointer to `nullptr`, indicating an empty list.
~OrderList() (Destructor): This destructor is responsible for deallocating all the
nodes in the linked list when an `OrderList` object goes out of scope, preventing
memory leaks. It iterate through the list, starting from the `head`, and delete each
node appropriately, ensuring proper memory management.
addOrder(const Order& order): This function adds a new `Order` object to the
`OrderList`. It creates a new `OrderNode` with the provided `order` and inserts it at
the end of list.
removeOrder(int orderId): This function attempts to remove an order from the
list based on its unique ID (`orderId`). It searches for the node containing the matching
order and removes it from the linked list.
findOrder(int orderId) const: This function searches for an order in the list
based on its ID (`orderId`). It iterates through the linked list and returns a pointer to the
`Order` containing the matching order, or `nullptr` if not found.
displayOrderList() const: This function displays information about all orders
currently in the list. It iterates through the linked list and calls the `displayOrder`
function of each `OrderNode`'s `order` object to display details.
displayOrdersForBuyer(int buyerId) const: This function displays
information about orders placed by a specific buyer identified by their ID (`buyerId`). It
iterates through the list and checks the `buyer` reference within each `OrderNode`
using the `getBuyer().getId()` (assuming `Buyer` has a `getId` function) to see if it
matches the provided `buyerId`. If there's a match, the order details are displayed.
isEmpty() const: This function check if the order list is empty or not.
Main Class (main.cpp)
The main.cpp file already implemented for your use. Please don't make any changes in
main.cpp file. You are only required to complete other TODO tasks as shown in next
section.
End of Code overview
Description
This section describes your tasks in this assignment. You will need to finish 5 files:
1. Buyer.cpp
2. Food.cpp
3. Menu.cpp
4. Order.cpp
5. OrderList.cpp
These files may contain some functions that are already implemented for you. You should
not modify them, otherwise your submission may have unexpected behaviours in the
automatic grading system.
Assignment Tasks
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 10 of 19
TODO 1
Complete the Buyer.cpp file. Here are the tasks list:
Task 1.1
Buyer::Buyer(int id, const string& name)
Complete the default constructor for buyer class.
Task 1.2
void Buyer::setBuyerId(int newId)
Complete setter method for Buyer Id. This function should assign the newId with current
buyer Id.
Task 1.3
int Buyer::getBuyerId() const
Complete getter method for Buyer Id. This function return the current buyer Id value.
Task 1.4
void Buyer::setBuyerName(const string& newName)
Complete setter method for Buyer Name. This function should assign the newName with
current buyer Name.
Task 1.5
string Buyer::getBuyerName() const
Complete getter method for Buyer Name. This function return the current buyer Name value.
TODO 2
Complete the Food.cpp file. Here are the tasks list:
Task 2.1
Food::Food(int id, const string& name, float price)
Complete the default constructor for Food class.
Task 2.2
Food::Food(const Food& other)
Complete the copy constructor for Food class. Copy constructor should be implemented
as a delegated constructor.
Task 2.3
void Food::setFoodId(int newId)
Complete setter method for Food Id. This function should assign the newId with current food
Id.
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 11 of 19
Task 2.4
int Food::getFoodId() const
Complete getter method for Food Id. This function return the current food Id value.
Task 2.5
void Food::setFoodName(const string& newName)
Complete setter method for Food Name. This function should assign the newName with
current food name.
Task 2.6
string Food::getFoodName() const
Complete getter method for Food Name. This function return the current food Name value.
Task 2.7
void Food::setPrice(float newPrice)
Complete setter method for Food Price. This function should assign the newPrice with
current food price.
Task 2.8
float Food::getPrice() const
Complete getter method for Food Price. This function return the current food Price value.
TODO 3
Complete the Menu.cpp file. Here are the tasks list:
Task 3.1
Menu::Menu()
Complete the default constructor for Menu class.
Task 3.2
Menu::~Menu()
Complete the destructor for Food class.
Task 3.3
void Menu::addFood(const Food& food)
Complete addFood method for Menu class. This function adds a new food item to the menu.
It takes a reference to a Food object food and adds it to the foodItems array.
Task 3.4
bool Menu::removeFood(int id)
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 12 of 19
Complete removeFood method for Menu class. This function removes a food item from the
menu based on its id. It searches for the food item with the matching ID and removes it from
the foodItems array.
Task 3.5
int Menu::findFoodIndex(int id) const
Complete findFoodIndex method for Menu class. This helper function searches for the
index of a food item with a specific id within the foodItems array. It iterates through the
array and returns the index if a match is found, or -1 if not found.
Task 3.6
const Food* Menu::getFoodById(int id) const
Complete getFoodById method for Menu class. This function retrieves a pointer to a Food
object from the menu based on its id. It searches for the food item with the matching ID and
returns a pointer to it, allowing access to its details.
Task 3.7
void Menu::resizeArray()
Complete resizeArray method for Menu class. This private function handles resizing the
foodItems array if needed. It called by addFood if the array is full, increasing the capacity
and reallocating memory for the array. NOTE: INCREASE THE CAPACITY BY 2 TIMES.
TODO 4
Complete the Order.cpp code file. Here are the tasks list:
Task 4.1
Order::Order()
Complete the default constructor for Order class.
Task 4.2
const Buyer& Order::getBuyer() const
Complete getBuyer method for Order class. This function grants read-only access to the
buyer object within the order, enabling retrieval of buyer information without the ability to
modify the original object. It maintains data integrity. In return this function should return a
buyer object.
Task 4.3
int Order::getcurrentNum() const
Complete getter method for currentNum variable. This function return the value of
currentNum variable.
Task 4.4
void Order::setOrderId(int newId)
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 13 of 19
Complete setter method for Order Id. This function should assign the newId with current
order Id.
Task 4.5
int Order::getOrderId() const
Complete getter method for Order Id. This function return the current order Id value.
Task 4.6
void Order::setBuyer(int newBuyerId, string newBuyerName)
Complete setter method for Buyer Id and Buyer Name. This function should assign the
newBuyerId and newBuyerName with current buyer class variable by using it's setter
methods.
Task 4.7
bool Order::addItem(const Food& item)
Complete addItem method for Order class. This function is responsible for adding a new
Food item to the orderedItems array. It takes a reference to a Food object item as input.
Task 4.8
void Order::cloneOrder(const Order& other)
Complete cloneOrder method for Order class. This function generates a self-contained
copy of another existing Order object other. NOTE: THIS METHOD USE DEEP COPY
APPROACH.
TODO 5
Complete the OrderList.cpp file. Here are the tasks list:
Task 5.1
OrderList::OrderList()
Complete the default constructor for OrderList class.
Task 5.2
OrderList::~OrderList()
Complete the destructor for OrderList class. This destructor is responsible for deallocating
all the nodes in the linked list when an `OrderList` object goes out of scope, preventing
memory leaks.
Task 5.3
void OrderList::addOrder(const Order& order)
Complete addOrder method for OrderList class. This function adds a new Order object to
the OrderList. NOTE: MAKE SURE YOU INSERT NEW ORDER IN LIST AT THE END.
Task 5.4
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 14 of 19
bool OrderList::removeOrder(int orderId)
Complete removeOrder method for OrderList class. This function attempts to remove an
order from the list based on its unique ID orderId.
Task 5.5
Order* OrderList::findOrder(int orderId) const
Complete findOrder method for OrderList class. This function searches for an order in the
list based on its ID orderId.
Task 5.6
bool OrderList::isEmpty() const
Complete isEmpty method for OrderList class. This function check if the order list is empty
or not.
Task 5.7
void OrderList::displayOrderList() const
Complete displayOrderList method for OrderList class. This function displays
information about all orders currently in the list.
Task 5.8
void OrderList::displayOrdersForBuyer(int buyerId) const
Complete displayOrdersForBuyer method for OrderList class. This function displays
information about orders placed by a specific buyer identified by their ID buyerId
End of Description
Resources & Sample I/O
Skeleton code: skeleton.zip
Demo program (executable for Windows): PA1.exe (Last updated 11:48 AM March
29)
End of Download
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 15 of 19
Test Cases
Testing main: main_test.zip (Last updated 05:12 PM March 16)
main_test.cpp: Contains all the test cases to check your TODOs
make: Modified Make file to run the main_test.cpp
input: A folder contains all the input commands for main_test.cpp file
output: A folder contains all the expected output
To test your all .cpp files before submission you can test them using main_test.cpp file.
NOTE: While testing your code please use the given modified make file inside the
main_test.zip
Once you put all the files and folders into your main PA1 directory then you can run the
main_test.cpp file by typing the following command in terminal.
make test
When you execute the program, the prompt will ask you to input the TODOs number to test
from 1 to 5 and input the task number for each TODO. Alternatively, you can pass a text file
to the program as input:
./PA1_test.exe < input/inputX.txt
NOTE: Change the value of X in range from **21 to get the output for desired test case.
Then compare your results with respective given output results inside output/outputX.txt
Note: If your machine cannot run the files/commands above, you may consider using one of
the CS Lab machines. For more details please refer to Lab1 and Lab 3 tutorials
End of Test Cases
Submission and Deadline
Deadline: 23:59:00 on Saturday, March 30, 2024.
ZINC Submission
Create a single zip file that contains Buyer.cpp, Food.cpp, Menu.cpp, Order.cpp, and
OrderList.cpp files. Zip only these files, NOT a folder containing them. Submit the zip file to
ZINC. ZINC usage instructions can be found here.
Notes:
You may submit your file multiple times, but only the latest version will be graded.
Submit early to avoid any last-minute problem. Only ZINC submissions will be
accepted.
The ZINC server will be very busy in the last day especially in the last few hours, so you
should expect you would get the grading result report not-very-quickly. However, as
long as your submission is successful, we would grade your latest submission with all
test cases after the deadline.
If you have encountered any server-side problem or webpage glitches with ZINC, you
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 16 of 19
may post on the ZINC support forum to get attention and help from the ZINC team
quickly and directly. If you post on Piazza, you may not get the fastest response as we
need to forward your report to them, and then forward their reply to you, etc.
NOTE: The program is compiled using the -fsanitize flag. You will lose points if your
program contains memory leak or other runtime issues.
Compilation Requirement
IMPORTANT: You are strongly recommended to finish the function prototypes such that the
program can compile before you start implementing the functions. If your program cannot
compile, your score on ZINC is automatically 0. If your program can compile, you may get
partial credits for tasks you have finished.
It is required that your submissions can be compiled and run successfully in our online
autograder ZINC. If we cannot even compile your work, it won't be graded. Therefore, for
parts that you cannot finish, just put in dummy implementation so that your whole program
can be compiled for ZINC to grade the other parts that you have done. Empty
implementations can be like:
Reminders
Make sure you actually upload the correct version of your source files - we only grade
what you upload. Some students in the past submitted an empty file or a wrong file or an
exe file which is worth zero mark. So you must double-check the file you have submitted.
Late Submission Policy
There will be a penalty of -1 point (out of a maximum 100 points) for every minute you are
late. For instance, since the deadline of assignment 1 is 23:59:00 on March 30th, if you
submit your solution at 1:00:00 on March 31st , there will be a penalty of -61 points for your
assignment. However, the lowest grade you may get from an assignment is zero: any
negative score after the deduction due to late penalty (and any other penalties) will be reset
to zero.
End of Submission and Deadline
int SomeClass::SomeFunctionICannotFinishRightNow()
{
 return 0;
}
void SomeClass::SomeFunctionICannotFinishRightNowButIWantOtherPartsGraded()
{
}
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 17 of 19
Frequently Asked Questions
Frequently Asked Questions
Q: My code doesn't work / there is an error. Here is the code. Can you help me fix it?
A: As the assignment is a major course assessment, to be fair, you are supposed to work on
it on your own, and we should not finish the tasks for you. We might provide some very
general hints, but we shall not fix the problem or debug it for you.
Q: Can I include additional libraries?
A: No, other than the libraries already included in their respective .cpp files.
Q: Can I use global or static variables such as static int x?
A: No.
Q: Can I use auto?
A: No.
Q: What is the purpose of nextFoodId variable in menu class?
A: Refer to Piazza disscussion @149 and also @144 and their followup discussions.
End of Frequently Asked Questions
Changelog
11:48 AM 29/03/2024: Updated the demo program PA1.exe using the updated menu.cpp
file.
07:51 PM 24/03/2024: Updated the description of cloneOrder(const Order& other)
function.
12:39 PM 20/03/2024: Assignment due date is changed from 26th March to 30th March.
10:57 AM 18/03/2024: Skeleton code file Menu.cpp is revised. In Menu.cpp file in the given
function void Menu::manageFoodItems() please update only the case 1:
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 18 of 19
is changed to
10:57 AM 18/03/2024: Skeleton code zip file is now updated with the new Menu.cpp file.
01:57 AM 17/03/2024: In OrderList class description findOrder(int orderId)
const function detail is updated. Furthermore, In Menu class description nextFoodId
variable and getFoodById(int id) const function details are updated.
01:26 AM 17/03/2024: In Order class description, more details on Order() and
cloneOrder(const Order& other) is added for further clarification.
case 1: {
 cout << "Current Menu items: "<< endl;
 displayMenu();
 if (isFull()) {
 cout << "Menu is full. Cannot add more food items."
 return;
 }
 // Get user input for food details
 string name;
 float price; // Ensure this is float to match the constructor
 cout << "Enter food name: ";
 cin >> name;
 cout << "Enter food price: ";
 cin >> price;
 Food newFood(nextFoodId, name, price); // Use nextFoodId here
 addFood(newFood);
 cout << "Food item added successfully." << endl;
 break;
 }
case 1: {
 cout << "Current Menu items: "<< endl;
 displayMenu();
 // Get user input for food details
 string name;
 float price; // Ensure this is float to match the constructor
 cout << "Enter food name: ";
 cin >> name;
 cout << "Enter food price: ";
 cin >> price;
 Food newFood(nextFoodId, name, price); // Use nextFoodId here
 addFood(newFood);
 cout << "Food item added successfully." << endl;
 break;
 }
COMP 2012 Assignment 1: Food Ordering System 29/03/2024, 23:23
https://course.cse.ust.hk/comp2012/assignments/assignment1/#submission Page 19 of 19
Maintained by COMP 2012 Teaching Team © 2024 HKUST Computer Science and Engineering
06:14 PM 16/03/2024: Test Cases section is updated. ZINC submission is also available
now.
05:58 AM 14/03/2024: Removed the OrderList class helper function, cleatList()
from OrderList.h file. Where this functionality needs to be implement in OrderList class
destructor. Please download the lastest skeleton file.
06:22 AM 14/03/2024: Updated the definition of Menu() constructor in Menu class and
Order() constructor in Order class.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp




















 

掃一掃在手機打開當(dāng)前頁
  • 上一篇:代做COMP9334、Python/Java程序設(shè)計代寫
  • 下一篇:菲律賓商務(wù)簽需要邀請函嗎(商務(wù)簽所需材料)
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團(tuán)工具
    出評 開團(tuán)工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                精品久久一区二区| 久久黄色级2电影| 欧美喷潮久久久xxxxx| 欧美亚洲动漫另类| 日韩免费观看高清完整版在线观看| 国产麻豆91精品| 久久久久国产免费免费 | 91国产丝袜在线播放| 久久精品水蜜桃av综合天堂| 丁香亚洲综合激情啪啪综合| 久久久九九九九| 欧美无人高清视频在线观看| 精油按摩中文字幕久久| 中文字幕亚洲综合久久菠萝蜜| 色噜噜久久综合| 九九热在线视频观看这里只有精品| 91精品在线观看入口| 亚洲欧美在线观看| 91丝袜美女网| 亚洲成av人片在线观看| 91精品国产欧美一区二区成人| 日韩久久久精品| 亚洲成a人片在线不卡一二三区| 国产成人亚洲综合a∨猫咪| 欧美四级电影网| 久久国产精品色婷婷| 国产精品嫩草影院com| 91丨porny丨在线| 日韩av不卡一区二区| 久久综合久久99| 99re这里都是精品| 亚洲午夜电影网| 国产色产综合色产在线视频| 国产精品你懂的在线| 日韩电影在线一区| 国产欧美精品一区二区色综合朱莉| 菠萝蜜视频在线观看一区| 首页亚洲欧美制服丝腿| 中文在线免费一区三区高中清不卡| 91免费国产在线观看| 777色狠狠一区二区三区| 国产欧美日韩三级| 全国精品久久少妇| 久久精品一区二区三区不卡| 亚洲欧美偷拍三级| 99久久精品国产精品久久| 91视频免费观看| 不卡的电影网站| 国产精品色呦呦| 日韩一级精品视频在线观看| 国精产品一区一区三区mba视频 | 日日噜噜夜夜狠狠视频欧美人 | 亚洲欧洲日韩av| 日韩免费性生活视频播放| 欧美三区在线观看| 国产精品网曝门| 国产乱淫av一区二区三区| 亚洲女与黑人做爰| 色综合中文字幕国产| 色综合久久88色综合天天免费| 亚洲色图丝袜美腿| 色综合天天天天做夜夜夜夜做| 午夜av一区二区三区| 亚洲国产三级在线| 免费一级片91| 国产福利一区二区| 99riav一区二区三区| 在线观看欧美日本| 国产一区二区三区免费在线观看| 国产二区国产一区在线观看| 菠萝蜜视频在线观看一区| 91啪在线观看| 久久久亚洲欧洲日产国码αv| 国产精品热久久久久夜色精品三区| 国产精品女上位| 国产精品污www在线观看| 一区二区三区日韩在线观看| 日韩高清国产一区在线| 亚洲午夜影视影院在线观看| 国产99久久久国产精品潘金| 色婷婷精品久久二区二区蜜臀av| 正在播放亚洲一区| 一区二区三区欧美日| 久久99国产精品久久99果冻传媒| 成人av在线资源网| 欧美一级淫片007| 日韩中文字幕麻豆| 欧美日韩在线播放| 亚洲精品在线三区| 91亚洲精品一区二区乱码| 国产精品无人区| 国产伦精品一区二区三区免费| 欧美精品在线视频| 亚洲国产精品一区二区www | 亚洲婷婷在线视频| 国产91露脸合集magnet| 久久久久久久久久久99999| 日韩精品色哟哟| 一本到不卡免费一区二区| 日韩精品在线一区二区| 日韩一区精品字幕| 日韩欧美一区二区不卡| 中文字幕乱码日本亚洲一区二区| 国产v日产∨综合v精品视频| 国产亚洲婷婷免费| 91国在线观看| 另类成人小视频在线| 欧美精品丝袜中出| 色综合天天综合在线视频| 亚洲高清在线视频| 国产精品麻豆视频| 欧美日韩精品一二三区| 亚洲国产中文字幕在线视频综合| 国产欧美精品一区二区色综合| 色婷婷久久久综合中文字幕 | 丁香婷婷综合网| 国产一区二区精品久久91| 中文字幕一区免费在线观看| 欧美性受xxxx黑人xyx| 国产精品123区| 日韩成人精品视频| 亚洲视频免费看| 国产亚洲成aⅴ人片在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 久久久不卡网国产精品二区| 欧美日韩美少妇| 99久久免费国产| 成人免费观看视频| 99久久国产综合色|国产精品| 丁香另类激情小说| 国产成都精品91一区二区三| 精品一区二区免费视频| 日产国产高清一区二区三区 | 日韩精品午夜视频| 免费观看日韩av| 国产精品美女久久久久久久久| 伊人夜夜躁av伊人久久| 国产精品福利一区二区| 亚洲天堂av老司机| 亚洲综合久久av| 免费高清不卡av| 国产精品综合久久| 91黄色免费版| 成人91在线观看| 91精品一区二区三区久久久久久| 亚洲精品在线免费观看视频| 国产精品麻豆视频| 久久www免费人成看片高清| 国产aⅴ精品一区二区三区色成熟| 不卡一区二区三区四区| 在线成人av影院| 亚洲免费在线电影| 成人午夜碰碰视频| 欧美网站大全在线观看| 欧美日韩国产区一| 91首页免费视频| 蜜桃av一区二区三区电影| 日本高清成人免费播放| 精品国产乱码久久久久久蜜臀| 综合亚洲深深色噜噜狠狠网站| 日韩**一区毛片| 欧美影视一区二区三区| 国产精品欧美经典| 懂色av中文字幕一区二区三区| 91色在线porny| 亚洲国产精品久久人人爱蜜臀| 色呦呦国产精品| 亚洲免费观看视频| 91福利在线看| 一区二区在线观看免费| 91福利视频在线| 日韩电影在线一区二区| 久久精品夜色噜噜亚洲aⅴ| 国产一区二区91| 国产精品国产成人国产三级| 偷拍亚洲欧洲综合| 欧美日韩精品一区二区在线播放| 亚洲网友自拍偷拍| 欧美一区二区三区四区五区| 亚洲女同ⅹxx女同tv| 欧美成人一区二区三区片免费| 国产呦精品一区二区三区网站| 久久精品免费在线观看| 色天使色偷偷av一区二区| 久久99国产精品久久| 亚洲欧美日韩国产一区二区三区| 欧美精品亚洲二区| 欧美区在线观看| 国产做a爰片久久毛片| 国产精品毛片大码女人| 欧美片在线播放| 成人av电影观看| 久久精品久久精品| 欧美zozozo| 日韩一区二区中文字幕| 99精品视频在线播放观看| 日韩综合小视频| 首页国产丝袜综合| 日韩经典中文字幕一区| 2021国产精品久久精品|