BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE
HELP ME CORRECTTHE CODE
Implement the class and methods according to the UML and specifications below.
Part 1 - Create Product.java and ProductTest.java
The Product class models an individual item type in a vending machine. Each product has a
name, cost. and price. Note that cost is the cost of the product to the vending machine company.
Price is the price that the vending machine will charge the customer. Violet has said that she is
unwilling to deal with anything but quarters, dollar bills, and debit cards so all prices are kept
divisible by 25 cents. Costs to the vending machine company can be any penny value. All of the
get methods perform the expected operation.
Data
Note: cost and price are both integers. All money in the vending machine is represented as cents
to enable simpler math and eliminate rounding issues.
ROUND_PRICE: int - the value in cents to which all prices will be rounded
name: String - the name of the product type
cost: int
price: int
Product()
The default constructor will create an instance of a product with a name of "Generic", a cost of
ROUND_PRICE = 25 cents and a price of twice the ROUND_PRICE.
Product(String name, int cost, int price) throws IllegalArgumentException
This constructor takes the name, cost, and price as parameters and sets the instance variables
appropriately. Null string names or negative cost or price should throw an
IllegalArgumentException. Prices should be rounded to the next ROUND_PRICE cents above
the amount given if the amount given if not already divisible by ROUND_PRICE. Note: if the
price given is not greater than the cost, the price should be the next ROUND_PRICE-divisible-
value that is greater than the cost.
toString()
The toString() method will return a String of the instance variables of the class exactly as shown
below. Assuming a name of "M&Ms", cost of $1.02, and a price of $1.25, toString() would
return:
Note: the cost and price are kept in cents so the toString() method will need to transform the
values into the right format.
Part 2 - Create Slot.java and SlotTest.java
The Slot class models a slot in the vending machine. Slots are loaded from the rear, and
purchases are removed from the front. This ensures that the items that have been in the machine
the longest are sold before newly added items.
Data
SLOT_SIZE: int = 10 - the maximum number of products that a slot in the vending machine can
hold.
products: ArrayList - models the actual products that are in the slot. Removing the one at the
front models buying one of the products in the slot and all of the others are moved forward
similar to an actual vending machine.
Slot()
The Slot() constructor creates an empty array list of products.
Slot(Product product)
This constructor creates a new slot that is filled with SLOT_SIZE of product.
load(Product product)
This method loads the slot with however many new products are required to make sure it is full
and returns th.
Write a program that mimics the operations of several vending machin.pdfeyebolloptics
The document describes a program that simulates the operations of two vending machines - one for drinks and one for snacks. The program reads item data from text files, allows a user to select an item from a displayed menu, processes a purchase by checking funds and updating balances, and returns change or messages about insufficient funds or out of stock items. The document outlines the required classes and methods to implement this program, including Item, VendingMachine, and VendingMachineDriver classes.
show code and all classes with full implementation for these Program S.pdfAlanSmDDyerl
show code and all classes with full implementation for these Program Specifications.
Example products ( camcorder, dvd player, blueray player, tv, camera, xbox 360, ps4, Wii,
laptops, iphone, battery, smart phones, computer desktop, printer, usb, mouse)
Develop an inventory management system for an electronics store. The inventory system should
have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically
store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object
info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not
contain any virtual function and/or use of dynamic_cast mechanism or point deductions will
apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member
initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as
a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke
the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must
explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>,
restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product
restocking is true somehow indicate it using "special effects" such as ***** or wh.
The document provides requirements for a programming project to model retail transactions with two classes: LineItem and Transaction.
LineItem represents an item being purchased with attributes like name, quantity, and price. Transaction combines LineItem objects and calculates a total price.
The requirements specify the attributes and methods needed for each class, including constructors, accessors, mutators, and methods to calculate totals and convert objects to strings. A test class is also required to test the Transaction class.
Program Specifications in c++ Develop an inventory management system f.docxsharold2
Program Specifications in c++
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implement.
Program Specifications in c++ Develop an inventory management syste.docxsharold2
Program Specifications in c++
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implement.
The document describes 5 programming exercises involving object-oriented concepts like classes, inheritance, interfaces, and relationships between classes. The exercises involve creating classes for points, persons, students, grids, bounded integers, and a parking ticket system. Students are asked to write code to implement the specified classes and relationships, and write tests to demonstrate the functionality.
Program Specifications Develop an inventory management system for an e.docxVictormxrPiperc
Program Specifications
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implementation s.
Pairwise testing is a technique that tests all possible combinations of each pair of input parameters to achieve high test coverage with fewer tests. It works by testing interactions between variables instead of all combinations. An example shows how to apply pairwise testing to test a car ordering application involving multiple variables, reducing thousands of combinations to just 8 test cases. Pairwise testing is effective but has limitations if variables or interactions are not well understood. Tools can generate pairwise test cases.
Write a program that mimics the operations of several vending machin.pdfeyebolloptics
The document describes a program that simulates the operations of two vending machines - one for drinks and one for snacks. The program reads item data from text files, allows a user to select an item from a displayed menu, processes a purchase by checking funds and updating balances, and returns change or messages about insufficient funds or out of stock items. The document outlines the required classes and methods to implement this program, including Item, VendingMachine, and VendingMachineDriver classes.
show code and all classes with full implementation for these Program S.pdfAlanSmDDyerl
show code and all classes with full implementation for these Program Specifications.
Example products ( camcorder, dvd player, blueray player, tv, camera, xbox 360, ps4, Wii,
laptops, iphone, battery, smart phones, computer desktop, printer, usb, mouse)
Develop an inventory management system for an electronics store. The inventory system should
have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically
store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object
info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not
contain any virtual function and/or use of dynamic_cast mechanism or point deductions will
apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member
initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as
a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke
the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must
explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>,
restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product
restocking is true somehow indicate it using "special effects" such as ***** or wh.
The document provides requirements for a programming project to model retail transactions with two classes: LineItem and Transaction.
LineItem represents an item being purchased with attributes like name, quantity, and price. Transaction combines LineItem objects and calculates a total price.
The requirements specify the attributes and methods needed for each class, including constructors, accessors, mutators, and methods to calculate totals and convert objects to strings. A test class is also required to test the Transaction class.
Program Specifications in c++ Develop an inventory management system f.docxsharold2
Program Specifications in c++
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implement.
Program Specifications in c++ Develop an inventory management syste.docxsharold2
Program Specifications in c++
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implement.
The document describes 5 programming exercises involving object-oriented concepts like classes, inheritance, interfaces, and relationships between classes. The exercises involve creating classes for points, persons, students, grids, bounded integers, and a parking ticket system. Students are asked to write code to implement the specified classes and relationships, and write tests to demonstrate the functionality.
Program Specifications Develop an inventory management system for an e.docxVictormxrPiperc
Program Specifications
Develop an inventory management system for an electronics store. The inventory system should have the following functionalities:
BuildInventory: read a text file containing electronics products information and dynamically store them in an array of pointers.
ShowInventory: display all inventory items.
UpdateInventory: ask for item id and quantity. If found display cost and update Product object info (reduce Product's quantity and potentially update restocking flag).
Terminate: save current inventory to a text file.
This programming assignment illustrates the following concepts:
Text file reading and writing.
Arrays of pointers and dynamic memory allocations with new and delete.
Inheritance.
C++ type casting: static_cast.
NOTE: This assignment is not about polymorphism or dynamic_cast! Your program should not contain any virtual function and/or use of dynamic_cast mechanism or point deductions will apply. You will have opportunity to use polymorphism in the next assignment.
Class Design
You need at least three classes.
class InventoryItem (minimum implementation specified below) - This is the base class.
Protected member data: item id (integer) and restocking (bool).
Public static data:
const integer (item id): initialize to 9999.
const bool (restocking): initialize to false.
Constructors
Default constructor: initialize item id and restocking using the default static data with member initializer syntax.
Non-default constructor: take 2 parameters.
Destructor: output "InventoryItem <item id> with <true/false> restocking destroyed ..."
Public member functions:
mutator/accessor for restocking, item id.
Display : to show InventoryItem item id and restocking (true/false). item id must be displayed as a 4-digit integer with leading 0s if < 1000.
class Product : derived from InventoryItem class (minimum implementation specified below).
Private member data: name (string), quantity (integer) and price (double).
Public static data:
const string (name): "No Product".
const int (quantity): 0
const double (price): 0.99
Constructors (use member initializer syntax)
Default constructor: set member data to static data's default values above. Must explicitly invoke the base class' default constructor.
Non-default constructor: take five parameters (id, restocking, name, quantity and price). Must explicitly invoke the base class' non-default constructor.
Destructor: output "Product: <item id>, Name<name>, quantity<quantity>, price <price>, restocking<true/false> destroyed ...".
Public member functions:
accessors/mutators for name, quantity, price.
Display: invoke Display from base class, then display its own data. NOTE: If the product restocking is true somehow indicate it using "special effects" such as ***** or whatever effect you'd like.
Cost : take an integer as its only parameter representing the quantity (how many product to be sold) and return the total cost (price * quantity parameter).
class InventorySystem: (minimum implementation s.
Pairwise testing is a technique that tests all possible combinations of each pair of input parameters to achieve high test coverage with fewer tests. It works by testing interactions between variables instead of all combinations. An example shows how to apply pairwise testing to test a car ordering application involving multiple variables, reducing thousands of combinations to just 8 test cases. Pairwise testing is effective but has limitations if variables or interactions are not well understood. Tools can generate pairwise test cases.
Visual Studio.NET is an integrated development environment (IDE) provided by Microsoft for developing .NET applications. It supports multiple programming languages and platforms including C#, .NET desktop, web, and mobile applications. The .NET framework supports over 30 languages. In Visual Studio, applications are called projects. The document provides steps to download, install, and use Visual Studio.NET to create a simple C# console application. It also covers various C# programming concepts like data types, variables, constants, operators, conditional statements, loops, methods etc. with examples.
1. The document describes creating an Int class that imitates the functionality of the int data type. The Int class contains an int variable and member functions to initialize, display, and add Int values. A sample program exercises the Int class.
2. It also describes creating a Tollbooth class to model a tollbooth. The class contains data for the number of cars and amount of money collected. Member functions increment counts for paying and non-paying cars. The class displays the totals.
3. Finally, it describes creating a Time class to store hours, minutes, seconds. Member functions initialize, display, and add Time objects. A program tests the Time class.
Static factory methods have several advantages over constructors for creating object instances, such as returning immutable objects or objects of subclasses. They allow returning an object of any subtype, have named methods instead of anonymous constructors, and can reduce verbosity for parameterized types. Some examples include Boolean.valueOf() and factory methods in the RandomGenerators class.
The document discusses polymorphism and abstract classes in object-oriented programming. It describes how polymorphism allows one method name to have multiple implementations depending on the object type. Late binding associates the correct method implementation at runtime based on the actual object. The document also introduces abstract classes, which allow defining common methods but postponing their implementation to subclasses.
The document provides instructions for an object-oriented programming assignment with 12 questions. Students are asked to write classes to model concepts like marks, circles, books, employee data, bank accounts, cars, timers, and students. The classes are to have data members and member functions to set, get, calculate and display the data. Main programs are to create objects and test the classes. Students must submit the assignment in MS Word or handwritten along with screenshots of program outputs by the deadline of June 20th.
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docxclarebernice
COIT20245, 2016 Term One - Page 1 of 9
Assessment details COIT 20245
Assessment item 2—JAVA Program using array of objects
Due date: Week 11 T116 – Midnight, Friday (27/5/16)
Refer below for complete assessment item 2 requirements
(Assignment Two)
ASSESSMENT
Weighting: 30%
2 Length: N/A
Objectives
This assessment item relates to the course learning outcomes as stated in the Course Profile.
Details
For this assignment, you are required to develop a Menu Driven Console Java Program to
demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and
built-in types, Java defined objects, arrays, selection and looping statements and various other Java
commands. Your program must produce the correct results.
The code for the menu and option selection is supplied: carPark.java and is available on the
course website, you must write the underlying code to implement the program. The menu selections
are linked to appropriate methods in the given code. Please spend a bit of time looking at the given
code to familiarise yourself with it and where you have to complete the code. You will need to write
comments in the supplied code as well as your own additions.
What to submit for this assignment
The Java source code:
o Car.java
o CarPark.java
If you submit the source code with an incorrect name you will lose marks.
A report including an UML class diagram of your Car class, how long it took to create the whole
program, any problems encountered and screen shots of the output produced. (Use Alt-PrtScrn to
capture just the application window and you can paste it into your Word document) You should test
every possibility in the program.
o ReportAss2.docx
You will submit your files by the due date using the “Assignment 2” link on the Moodle course
website under Assessment … Assignment 2 Submission.
COIT20245, 2016 Term One - Page 2 of 9
Assignment Specification
You have completed the console program for processing cars parked at the Rocky car park. We are
going to extend this application so the car’s licence plates and hours spent parked can be stored in an
array of objects.
The program will run via a menu of options, the file CarPark.java has been supplied (via the Moodle
web site) which supplies the basic functionality of the menu system.
Look at the code supplied and trace the execution and you will see the menu is linked to blank
methods (stubs) which you will implement the various choices in the menu.
Car class
First step is to create a class called Car (Car.java).
The Car class will be very simple it will contain two private instance variables:
o licencePlate as a String
o hours as an integer
You can also have constants for the fee values i.e $7.50, $4.50, $3.50 and $2.50.
The following public methods will have to be implemented:
o A default constructor
o A parameterised constructor
o Two set methods (mutators)
o ...
Automated Restaurant System (Command Design Pattern)PROBLEMY.docxrock73
Automated Restaurant System (Command Design Pattern)
PROBLEM
You are to implement an automated restaurant system utilizing the Command design pattern, minimally consisting of the following three commands. You will then extend this basic system in any way that you choose to demonstrate the use of additional design patterns.
· Display menu
· Submit Order
· Display tab
SCENARIO (of the basic system)
In the basic system, we assume that all orders are from the same table (i.e., there is only one table in the restaurant). Therefore, a tab is generated by simply totaling all of the ordered items, and tabs are not stored.
The menu of the basic system will consist of just main entrees. It will not include appetizers, desserts, drinks, etc. The information for each entrée will just be the name of the dish ("Roast Beef", "Chicken Korma", "Jiaozi", etc.) and the price.
APPROACH
You should implement the Command design pattern. This includes the following:
· Text-based user interface
· SystemInterface class
· Invoker class
classes of the Command design pattern
· Command interface
· Command classes (one for each command)
· Aggregator class
· Menu class
· MenuItem Class
· Orders class
· OrderItem Class
· Tab class
The user interface should just be a text-based numbered list of options, implemented in the main method. (It can be a GUI if you desire and are familiar with the development of GUIs, but no extra points will be given for this).
The SystemInterface can be a class of all static methods – one for each of the three commands of the user interface, if it does not have any state in your extension of the program.
The Aggregator class maintains references to the Menu object and the Orders object. It should provide a getter method for retrieving the Menu and Orders objects (no setters are needed). The Menu and Orders classes store a collection of MenuItem and OrderItem objects, respectively. A MenuItem object will store the menu item #, the description, and its cost. An OrderItem object will store an order by its item number only (not its description).
The Invoker class has methods cooresponding to the methods of the system interface. Each method simply creates a Command object of the appropriate Command class (constructed with a reference to the Aggregator object), calls its execute method, and returns the results (as a single object) back to the system interface. (Execute methods should not be passed any parameter values - any values needed are passed to the constructor.)
A tab will be constructed from the Tab class containing all of the ordered items, returned as an array of strings for the user interface to display. Note that a tab needs information from both the Menu and the Orders objects. (The Orders object indicates what menu items were ordered, and the Menu class has the description of each item to include in the Tab.)
EXTENSION OF THE BASIC SYSTEM
You are to extend the design and capabilitities of the program in any ways that you wish ...
The document summarizes a stock portfolio optimization report that uses Gaussian quadrature to analyze stock market data and optimize a portfolio to minimize risk and maximize returns. It describes collecting stock market data, applying a Gaussian quadrature formula to analyze the data and calculate the probability of gains and expected returns. The results show probabilities of gains around 50% and expected returns between 0.081 to 0.132, indicating the difficulty of predicting stock market behaviors but some ability to modestly optimize returns and reduce risk.
I have the first program completed (not how request, but it works) a.pdffootworld1
I have the first program completed (not how request, but it works) and I am trying to get the
second portion together.
First Program requested (complete)**********************************************
(1) Create three files to submit:
ItemToPurchase.h - Class declaration
ItemToPurchase.cpp - Class definition
main.cpp - main() function
Build the ItemToPurchase class with the following specifications:
Default constructor
Public class functions (mutators & accessors)
SetName() & GetName() (2 pts)
SetPrice() & GetPrice() (2 pts)
SetQuantity() & GetQuantity() (2 pts)
Private data members
string itemName - Initialized in default constructor to \"none\"
int itemPrice - Initialized in default constructor to 0
int itemQuantity - Initialized in default constructor to 0
(2) In main(), prompt the user for two items and create two objects of the ItemToPurchase class.
Before prompting for the second item, call cin.ignore() to allow the user to input a new string. (2
pts)
Ex:
(3) Add the costs of the two items together and output the total cost. (2 pts)
Ex:
Second Portion I am on
now**************************************************************************
*******
7.19 Program: Online shopping cart (continued) (C++)
This program extends the earlier \"Online shopping cart\" program. (Consider first saving your
earlier program).
(1) Extend the ItemToPurchase class per the following specifications:
Parameterized constructor to assign item name, item description, item price, and item quantity
(default values of 0). (1 pt)
Public member functions
SetDescription() mutator & GetDescription() accessor (2 pts)
PrintItemCost() - Outputs the item name followed by the quantity, price, and subtotal
PrintItemDescription() - Outputs the item name and description
Private data members
string itemDescription - Initialized in default constructor to \"none\"
Ex. of PrintItemCost() output:
Ex. of PrintItemDescription() output:
(2) Create three new files:
ShoppingCart.h - Class declaration
ShoppingCart.cpp - Class definition
main.cpp - main() function (Note: main()\'s functionality differs from the warm up)
Build the ShoppingCart class with the following specifications. Note: Some can be function
stubs (empty functions) initially, to be completed in later steps.
Default constructor
Parameterized constructor which takes the customer name and date as parameters (1 pt)
Private data members
string customerName - Initialized in default constructor to \"none\"
string currentDate - Initialized in default constructor to \"January 1, 2016\"
vector < ItemToPurchase > cartItems
Public member functions
GetCustomerName() accessor (1 pt)
GetDate() accessor (1 pt)
AddItem()
Adds an item to cartItems vector. Has parameter ItemToPurchase. Does not return anything.
RemoveItem()
Removes item from cartItems vector. Has a string (an item\'s name) parameter. Does not return
anything.
If item name cannot be found, output this message: Item not found in cart. Nothing removed.
ModifyItem()
Modifies an it.
Super market billing system using webcam SahithBeats
This document presents a project on developing a supermarket billing system using a webcam. The system aims to make shopping easier for customers by allowing them to scan products using the webcam integrated into a smart shopping cart. This will generate bills in real-time and reduce wait times at checkouts. The system was created using Python programming language with Flask as the backend framework. It involves modules for adding product details, training a model for product recognition, and adding or removing items from the virtual cart.
Goal The goal of this assignment is to help students understand the.pdfarsmobiles
Goal: The goal of this assignment is to help students understand the use of JUnit to test Java
code.
Description: In this assignment you will create a set of unit tests, to test the behavior of the code
written for Assignment 1. To keep things consistent, please use the solution to assignment 1
provided by the instructor. You can find the solution on TRACS, under Resources >
Assignment-related material > Assignment
Solution
s.
A unit test is an automated piece of code that invokes a unit of work in the system and then
checks a single assumption about the behavior of that unit of work. A unit of work is a single
logical functional use case in the system that can be invoked by some public interface (in most
cases). A unit of work can span a single method, a whole class or multiple classes working
together to achieve one single logical purpose that can be verified.
Think of unit testing as a way to test the behavior of the code (or parts of the code) written,
without actually having to run the program. For example, in the case of assignments 1, assume
that the front-end (console user interface) part of the program and the back-end part of the
program (dealership database management) are written by two different developers. How would
the developer of the back-end be able to ensure that the code he/she has written does what it is
supposed to do without having access to the front-end?
A good unit test is:
• Able to be fully automated
• Has full control over all the pieces running.
• Can be run in any order, if part of many other tests
• Runs in memory (no DB or File access, for example)
• Consistently returns the same result (You always run the same test, so no random numbers, for
example.)
• Runs fast
• Tests a single logical concept in the system
• Readable
• Maintainable
• Trustworthy (when you see its result, you don’t need to debug the code just to be sure)
In this assignment, you are asked to create JUnit tests to test the classes and methods written for
assignment 1. First you should consider testing the behavior of theses classes/methods under
normal operation scenarios. For example, to test the method findCar(String vin) of the class
Dealership, you may need to create a test method, which creates a mock Car object and adds it to
the carList before the method findCar can be called to search for it. To ensure that everything
worked as planned, you can then search for the car using its VIN and see if the correct car is
found. Mock objects can be created either in the same test method or before any test methods are
run, using the @BeforeClass annotation.
Subsequently, you can consider creating test cases for unusual scenarios, e.g. when a certain
input or behavior is expected to cause an exception to be thrown, or when a user input is not as
expected.
At the end create a TestRunner class, which has a main method that runs the unit tests that you
have created, and prints out the test results.
Tasks:
1. Implement the JUnit tests to test only the.
The document describes a class diagram and use case diagram for a vending machine system. The class diagram models the vending machine, items for sale, and smart card reader. It shows the attributes and methods for each class. The use case diagram identifies the actors (customer, administrator, employee) and key use cases (choose item, buy, set up, check item, re-charge). It also includes a scenario describing a customer's successful purchase from the vending machine.
This document contains 23 exercises related to Java programming. The exercises cover a range of topics including sorting and filtering lists, working with maps and sets, implementing classes and interfaces, inheritance and polymorphism using abstract classes and interfaces, and working with enums. The goal of the exercises is to practice and demonstrate skills in object-oriented programming concepts in Java.
Serialization surrogates allow serialization of types that were not designed for serialization by defining a surrogate type that implements serialization and deserialization methods. The surrogate type registers with the formatter to handle serialization/deserialization for the target type. When serializing/deserializing the target type, the formatter calls methods on the surrogate type instead of the target type. This allows serialization of types without a Serializable attribute or implementation of ISerializable.
Biology Skin Color Questions1. How does high UV light affect folat.pdfaminaENT
Biology Skin Color Questions
1. How does high UV light affect folate storage?
2. Which skin color is favored in high UV light environments?
3. How does low UV light affect vitamin D production?
4. Which skin color is favored in low UV light environments?
5. What does it mean to say that skin color patterns are the result of convergent evolution?
6. Does similar skin color in a human race indicate all members of the race share a single
common ancestor separate from other races?.
Bicoid (bcd) is a maternal-effect gene in Drosophilarequired for nor.pdfaminaENT
Bicoid (bcd) is a maternal-effect gene in Drosophilarequired for normal embryo development.
What would be the phenotypes of offspring from a homozygous mutant mother (bcd-/bcd-) and a
heterozygous father with one normal allele and one mutant allele (bcd+/bcd-)?
a. All offspring would be mutant.
b. All offspring would be normal.
c. of the offspring would be mutant and would be normal.
d. of the offspring would be mutant and would be normal..
BHP is setting up a lithium mine that costs $120 million today to op.pdfaminaENT
BHP is setting up a lithium mine that costs $120 million today to open. It will generate $20
million in revenue for the next 10 years with operating costs being 10% of annual revenue. After
that, the mine is leased out to Rio Tinto which will pay rent of $2 million a year in perpetuity.
This rent starts in year 11. BHP has a cost of capital of 10%. Calculate the NPV of this project.
a. -$1,926,926.31
b. -$1,866,926.31
c. $1,686,926.31
d. -$1,686,926.31
e. $1,866,926.31.
Bill Nye goes to the beach to collect data on certain types of nonli.pdfaminaENT
Bill Nye goes to the beach to collect data on certain types of nonlinear waves. To estimate the
phase speed of the waves he wants to use the classic relation d=vt - Create an estimator for v. -
He makes 40 observations of the course of an afternoon and uses these to estimate v. Assume
that his measurements of distance have d =10 meters and d=0.3 meters. Moreover, assume his
time measurements have t=2.5 seconds and t =0.1 seconds. Use the Delta Method to find the
mean and standard deviation of the distributions of estimates for v..
Bianca Genova has worked hard to make networking events for LinkedB2.pdfaminaENT
Bianca Genova has worked hard to make networking events for LinkedB2B more attractive to
members (see Exercises 10.18, 10.19, and 11.13 for background). She developed a speaker series
as one strategy to attract members to attend the events. Several months ago, she invited a
prominent author and speaker, Madison Avery, to an event on September 4. On August 21,
Madison sent the following note:
SUBJECT: Speaking Cancellation
Dear Bianca, I regret to inform you that I cannot speak at your September 4 networking event. I
will return the $2,000 advance that you sent me. In the past month, I have suffered some health
issues. I anticipated recovering more quickly. My doctor has advised that I avoid all travel for
several months to avoid some of these problems. On top of that, my father-in-law died two
weeks ago. As a result, Ive spent most of my time attempting to help my husband deal with this
tragic time. I appreciate your understanding.
Madison
At this time, 179 professionals have signed up for the event. Bianca needs to write a message to
all professionals who have RSVPd and paid for the event. She will explain that she will find a
fill-in speaker on the same topic and she will offer refunds to any person who no longer wants to
attend the event
Complete the following tasks:
a. Evaluate how well madison delivers bad news.
b. Rewrite madisons note to more effectively deliver bad news.
c. Assume the role of samantha and write a message to members that delivers the bad news and
also helps promote the networking event even in the absence of madison as a speaker..
Berth Vader is a Canadian citizen who has always lived in London, On.pdfaminaENT
Berth Vader is a Canadian citizen who has always lived in London, Ontario. He has a spouse and
two school(cid:2)aged children. As of May 2020, he accepts a permanent employment in Akron, Ohio
(in the USA). On October 1, 2020, he moves to Akron to locate housing for his family. In order
for his children to finish the school term, his family remains in London until January 1, 2021.
When they move, Berth severs all residential ties with Canada other than the family home. The
home is put up for sale in January, 2021. However, it remains unsold as of December 31, 2021.
While Berth was scheduled to begin working in the U.S. in early 2021, he is unable to obtain the
required residency documents until July 1, 2021.
Explain Berth's Canadian residency status for 2020 and 2021..
Berlisle Inc. is a manufacturer of sails for small boats. The manage.pdfaminaENT
Berlisle Inc. is a manufacturer of sails for small boats. The management is trying to get a better
understanding of their costs and are concerned with the variances that they have seen between
budgets and actual results. The budget is prepared each November at Berlisle and standards are
updated at that time, which stay in use for the next year.
A new quality initiative launched by management resulted in Berlisle deciding to go to a new
supplier to attain the material they are using in production, and recent political changes have
resulted in new tariffs of $0.20 per meter. This is the first month that the tariffs have come into
effect. Labour costs seem to be too high, and the company is considering replacing some of the
more senior workers with younger workers and part-time workers that they feel they could pay
less money to. The following information is available for Berlisle Inc for the month of March.
During the month, 12,000 good units of product were produced:
Standard: (budgeted expected usage per unit developed in the prior year)
Material: 7.0 meters per unit at $8.00 per meter
Labour: 1.8 hours per unit at $24.00 per hour
Actual usage for March 2019
Material purchases: 85,000 meters at $8.35 per meter (landed cost)
Material used: 81,500 meters
Direct labour: 20,700 hours at $25.30 per hour
What is the material price and quantity variance? Is it favourable or unfavourable.[3 marks]
What is the labour rate and usage variance? Is it favourable or unfavourable. [3 marks]
Based on your analysis, what recommendations would you make to the management of Berlisle?
[3 marks].
below you will find the condensed finacial statements for Koko Inc. .pdfaminaENT
below you will find the condensed finacial statements for Koko Inc. and Suz Inc. for 2022.
Intructions 1. Compute the following ratios for each company. a. Rate of return on net sales b.
Rate of return on total assets at year-end c. Rate of return on stockholder's equity at year-end d.
Earnings per share of common stock e. Ratio of Stockholder's equity to total equities f. Current
ratio g. Asset turnover h. Boook value per share of common stock 2. Comment on any
similarities or differences in two companies ratios. 3. From investor's point of view, is one
company more at risk than the other? 4. Would you grant a five -year loan to either company?
Explain..
More Related Content
Similar to BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE H.pdf
Visual Studio.NET is an integrated development environment (IDE) provided by Microsoft for developing .NET applications. It supports multiple programming languages and platforms including C#, .NET desktop, web, and mobile applications. The .NET framework supports over 30 languages. In Visual Studio, applications are called projects. The document provides steps to download, install, and use Visual Studio.NET to create a simple C# console application. It also covers various C# programming concepts like data types, variables, constants, operators, conditional statements, loops, methods etc. with examples.
1. The document describes creating an Int class that imitates the functionality of the int data type. The Int class contains an int variable and member functions to initialize, display, and add Int values. A sample program exercises the Int class.
2. It also describes creating a Tollbooth class to model a tollbooth. The class contains data for the number of cars and amount of money collected. Member functions increment counts for paying and non-paying cars. The class displays the totals.
3. Finally, it describes creating a Time class to store hours, minutes, seconds. Member functions initialize, display, and add Time objects. A program tests the Time class.
Static factory methods have several advantages over constructors for creating object instances, such as returning immutable objects or objects of subclasses. They allow returning an object of any subtype, have named methods instead of anonymous constructors, and can reduce verbosity for parameterized types. Some examples include Boolean.valueOf() and factory methods in the RandomGenerators class.
The document discusses polymorphism and abstract classes in object-oriented programming. It describes how polymorphism allows one method name to have multiple implementations depending on the object type. Late binding associates the correct method implementation at runtime based on the actual object. The document also introduces abstract classes, which allow defining common methods but postponing their implementation to subclasses.
The document provides instructions for an object-oriented programming assignment with 12 questions. Students are asked to write classes to model concepts like marks, circles, books, employee data, bank accounts, cars, timers, and students. The classes are to have data members and member functions to set, get, calculate and display the data. Main programs are to create objects and test the classes. Students must submit the assignment in MS Word or handwritten along with screenshots of program outputs by the deadline of June 20th.
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docxclarebernice
COIT20245, 2016 Term One - Page 1 of 9
Assessment details COIT 20245
Assessment item 2—JAVA Program using array of objects
Due date: Week 11 T116 – Midnight, Friday (27/5/16)
Refer below for complete assessment item 2 requirements
(Assignment Two)
ASSESSMENT
Weighting: 30%
2 Length: N/A
Objectives
This assessment item relates to the course learning outcomes as stated in the Course Profile.
Details
For this assignment, you are required to develop a Menu Driven Console Java Program to
demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and
built-in types, Java defined objects, arrays, selection and looping statements and various other Java
commands. Your program must produce the correct results.
The code for the menu and option selection is supplied: carPark.java and is available on the
course website, you must write the underlying code to implement the program. The menu selections
are linked to appropriate methods in the given code. Please spend a bit of time looking at the given
code to familiarise yourself with it and where you have to complete the code. You will need to write
comments in the supplied code as well as your own additions.
What to submit for this assignment
The Java source code:
o Car.java
o CarPark.java
If you submit the source code with an incorrect name you will lose marks.
A report including an UML class diagram of your Car class, how long it took to create the whole
program, any problems encountered and screen shots of the output produced. (Use Alt-PrtScrn to
capture just the application window and you can paste it into your Word document) You should test
every possibility in the program.
o ReportAss2.docx
You will submit your files by the due date using the “Assignment 2” link on the Moodle course
website under Assessment … Assignment 2 Submission.
COIT20245, 2016 Term One - Page 2 of 9
Assignment Specification
You have completed the console program for processing cars parked at the Rocky car park. We are
going to extend this application so the car’s licence plates and hours spent parked can be stored in an
array of objects.
The program will run via a menu of options, the file CarPark.java has been supplied (via the Moodle
web site) which supplies the basic functionality of the menu system.
Look at the code supplied and trace the execution and you will see the menu is linked to blank
methods (stubs) which you will implement the various choices in the menu.
Car class
First step is to create a class called Car (Car.java).
The Car class will be very simple it will contain two private instance variables:
o licencePlate as a String
o hours as an integer
You can also have constants for the fee values i.e $7.50, $4.50, $3.50 and $2.50.
The following public methods will have to be implemented:
o A default constructor
o A parameterised constructor
o Two set methods (mutators)
o ...
Automated Restaurant System (Command Design Pattern)PROBLEMY.docxrock73
Automated Restaurant System (Command Design Pattern)
PROBLEM
You are to implement an automated restaurant system utilizing the Command design pattern, minimally consisting of the following three commands. You will then extend this basic system in any way that you choose to demonstrate the use of additional design patterns.
· Display menu
· Submit Order
· Display tab
SCENARIO (of the basic system)
In the basic system, we assume that all orders are from the same table (i.e., there is only one table in the restaurant). Therefore, a tab is generated by simply totaling all of the ordered items, and tabs are not stored.
The menu of the basic system will consist of just main entrees. It will not include appetizers, desserts, drinks, etc. The information for each entrée will just be the name of the dish ("Roast Beef", "Chicken Korma", "Jiaozi", etc.) and the price.
APPROACH
You should implement the Command design pattern. This includes the following:
· Text-based user interface
· SystemInterface class
· Invoker class
classes of the Command design pattern
· Command interface
· Command classes (one for each command)
· Aggregator class
· Menu class
· MenuItem Class
· Orders class
· OrderItem Class
· Tab class
The user interface should just be a text-based numbered list of options, implemented in the main method. (It can be a GUI if you desire and are familiar with the development of GUIs, but no extra points will be given for this).
The SystemInterface can be a class of all static methods – one for each of the three commands of the user interface, if it does not have any state in your extension of the program.
The Aggregator class maintains references to the Menu object and the Orders object. It should provide a getter method for retrieving the Menu and Orders objects (no setters are needed). The Menu and Orders classes store a collection of MenuItem and OrderItem objects, respectively. A MenuItem object will store the menu item #, the description, and its cost. An OrderItem object will store an order by its item number only (not its description).
The Invoker class has methods cooresponding to the methods of the system interface. Each method simply creates a Command object of the appropriate Command class (constructed with a reference to the Aggregator object), calls its execute method, and returns the results (as a single object) back to the system interface. (Execute methods should not be passed any parameter values - any values needed are passed to the constructor.)
A tab will be constructed from the Tab class containing all of the ordered items, returned as an array of strings for the user interface to display. Note that a tab needs information from both the Menu and the Orders objects. (The Orders object indicates what menu items were ordered, and the Menu class has the description of each item to include in the Tab.)
EXTENSION OF THE BASIC SYSTEM
You are to extend the design and capabilitities of the program in any ways that you wish ...
The document summarizes a stock portfolio optimization report that uses Gaussian quadrature to analyze stock market data and optimize a portfolio to minimize risk and maximize returns. It describes collecting stock market data, applying a Gaussian quadrature formula to analyze the data and calculate the probability of gains and expected returns. The results show probabilities of gains around 50% and expected returns between 0.081 to 0.132, indicating the difficulty of predicting stock market behaviors but some ability to modestly optimize returns and reduce risk.
I have the first program completed (not how request, but it works) a.pdffootworld1
I have the first program completed (not how request, but it works) and I am trying to get the
second portion together.
First Program requested (complete)**********************************************
(1) Create three files to submit:
ItemToPurchase.h - Class declaration
ItemToPurchase.cpp - Class definition
main.cpp - main() function
Build the ItemToPurchase class with the following specifications:
Default constructor
Public class functions (mutators & accessors)
SetName() & GetName() (2 pts)
SetPrice() & GetPrice() (2 pts)
SetQuantity() & GetQuantity() (2 pts)
Private data members
string itemName - Initialized in default constructor to \"none\"
int itemPrice - Initialized in default constructor to 0
int itemQuantity - Initialized in default constructor to 0
(2) In main(), prompt the user for two items and create two objects of the ItemToPurchase class.
Before prompting for the second item, call cin.ignore() to allow the user to input a new string. (2
pts)
Ex:
(3) Add the costs of the two items together and output the total cost. (2 pts)
Ex:
Second Portion I am on
now**************************************************************************
*******
7.19 Program: Online shopping cart (continued) (C++)
This program extends the earlier \"Online shopping cart\" program. (Consider first saving your
earlier program).
(1) Extend the ItemToPurchase class per the following specifications:
Parameterized constructor to assign item name, item description, item price, and item quantity
(default values of 0). (1 pt)
Public member functions
SetDescription() mutator & GetDescription() accessor (2 pts)
PrintItemCost() - Outputs the item name followed by the quantity, price, and subtotal
PrintItemDescription() - Outputs the item name and description
Private data members
string itemDescription - Initialized in default constructor to \"none\"
Ex. of PrintItemCost() output:
Ex. of PrintItemDescription() output:
(2) Create three new files:
ShoppingCart.h - Class declaration
ShoppingCart.cpp - Class definition
main.cpp - main() function (Note: main()\'s functionality differs from the warm up)
Build the ShoppingCart class with the following specifications. Note: Some can be function
stubs (empty functions) initially, to be completed in later steps.
Default constructor
Parameterized constructor which takes the customer name and date as parameters (1 pt)
Private data members
string customerName - Initialized in default constructor to \"none\"
string currentDate - Initialized in default constructor to \"January 1, 2016\"
vector < ItemToPurchase > cartItems
Public member functions
GetCustomerName() accessor (1 pt)
GetDate() accessor (1 pt)
AddItem()
Adds an item to cartItems vector. Has parameter ItemToPurchase. Does not return anything.
RemoveItem()
Removes item from cartItems vector. Has a string (an item\'s name) parameter. Does not return
anything.
If item name cannot be found, output this message: Item not found in cart. Nothing removed.
ModifyItem()
Modifies an it.
Super market billing system using webcam SahithBeats
This document presents a project on developing a supermarket billing system using a webcam. The system aims to make shopping easier for customers by allowing them to scan products using the webcam integrated into a smart shopping cart. This will generate bills in real-time and reduce wait times at checkouts. The system was created using Python programming language with Flask as the backend framework. It involves modules for adding product details, training a model for product recognition, and adding or removing items from the virtual cart.
Goal The goal of this assignment is to help students understand the.pdfarsmobiles
Goal: The goal of this assignment is to help students understand the use of JUnit to test Java
code.
Description: In this assignment you will create a set of unit tests, to test the behavior of the code
written for Assignment 1. To keep things consistent, please use the solution to assignment 1
provided by the instructor. You can find the solution on TRACS, under Resources >
Assignment-related material > Assignment
Solution
s.
A unit test is an automated piece of code that invokes a unit of work in the system and then
checks a single assumption about the behavior of that unit of work. A unit of work is a single
logical functional use case in the system that can be invoked by some public interface (in most
cases). A unit of work can span a single method, a whole class or multiple classes working
together to achieve one single logical purpose that can be verified.
Think of unit testing as a way to test the behavior of the code (or parts of the code) written,
without actually having to run the program. For example, in the case of assignments 1, assume
that the front-end (console user interface) part of the program and the back-end part of the
program (dealership database management) are written by two different developers. How would
the developer of the back-end be able to ensure that the code he/she has written does what it is
supposed to do without having access to the front-end?
A good unit test is:
• Able to be fully automated
• Has full control over all the pieces running.
• Can be run in any order, if part of many other tests
• Runs in memory (no DB or File access, for example)
• Consistently returns the same result (You always run the same test, so no random numbers, for
example.)
• Runs fast
• Tests a single logical concept in the system
• Readable
• Maintainable
• Trustworthy (when you see its result, you don’t need to debug the code just to be sure)
In this assignment, you are asked to create JUnit tests to test the classes and methods written for
assignment 1. First you should consider testing the behavior of theses classes/methods under
normal operation scenarios. For example, to test the method findCar(String vin) of the class
Dealership, you may need to create a test method, which creates a mock Car object and adds it to
the carList before the method findCar can be called to search for it. To ensure that everything
worked as planned, you can then search for the car using its VIN and see if the correct car is
found. Mock objects can be created either in the same test method or before any test methods are
run, using the @BeforeClass annotation.
Subsequently, you can consider creating test cases for unusual scenarios, e.g. when a certain
input or behavior is expected to cause an exception to be thrown, or when a user input is not as
expected.
At the end create a TestRunner class, which has a main method that runs the unit tests that you
have created, and prints out the test results.
Tasks:
1. Implement the JUnit tests to test only the.
The document describes a class diagram and use case diagram for a vending machine system. The class diagram models the vending machine, items for sale, and smart card reader. It shows the attributes and methods for each class. The use case diagram identifies the actors (customer, administrator, employee) and key use cases (choose item, buy, set up, check item, re-charge). It also includes a scenario describing a customer's successful purchase from the vending machine.
This document contains 23 exercises related to Java programming. The exercises cover a range of topics including sorting and filtering lists, working with maps and sets, implementing classes and interfaces, inheritance and polymorphism using abstract classes and interfaces, and working with enums. The goal of the exercises is to practice and demonstrate skills in object-oriented programming concepts in Java.
Serialization surrogates allow serialization of types that were not designed for serialization by defining a surrogate type that implements serialization and deserialization methods. The surrogate type registers with the formatter to handle serialization/deserialization for the target type. When serializing/deserializing the target type, the formatter calls methods on the surrogate type instead of the target type. This allows serialization of types without a Serializable attribute or implementation of ISerializable.
Similar to BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE H.pdf (14)
Biology Skin Color Questions1. How does high UV light affect folat.pdfaminaENT
Biology Skin Color Questions
1. How does high UV light affect folate storage?
2. Which skin color is favored in high UV light environments?
3. How does low UV light affect vitamin D production?
4. Which skin color is favored in low UV light environments?
5. What does it mean to say that skin color patterns are the result of convergent evolution?
6. Does similar skin color in a human race indicate all members of the race share a single
common ancestor separate from other races?.
Bicoid (bcd) is a maternal-effect gene in Drosophilarequired for nor.pdfaminaENT
Bicoid (bcd) is a maternal-effect gene in Drosophilarequired for normal embryo development.
What would be the phenotypes of offspring from a homozygous mutant mother (bcd-/bcd-) and a
heterozygous father with one normal allele and one mutant allele (bcd+/bcd-)?
a. All offspring would be mutant.
b. All offspring would be normal.
c. of the offspring would be mutant and would be normal.
d. of the offspring would be mutant and would be normal..
BHP is setting up a lithium mine that costs $120 million today to op.pdfaminaENT
BHP is setting up a lithium mine that costs $120 million today to open. It will generate $20
million in revenue for the next 10 years with operating costs being 10% of annual revenue. After
that, the mine is leased out to Rio Tinto which will pay rent of $2 million a year in perpetuity.
This rent starts in year 11. BHP has a cost of capital of 10%. Calculate the NPV of this project.
a. -$1,926,926.31
b. -$1,866,926.31
c. $1,686,926.31
d. -$1,686,926.31
e. $1,866,926.31.
Bill Nye goes to the beach to collect data on certain types of nonli.pdfaminaENT
Bill Nye goes to the beach to collect data on certain types of nonlinear waves. To estimate the
phase speed of the waves he wants to use the classic relation d=vt - Create an estimator for v. -
He makes 40 observations of the course of an afternoon and uses these to estimate v. Assume
that his measurements of distance have d =10 meters and d=0.3 meters. Moreover, assume his
time measurements have t=2.5 seconds and t =0.1 seconds. Use the Delta Method to find the
mean and standard deviation of the distributions of estimates for v..
Bianca Genova has worked hard to make networking events for LinkedB2.pdfaminaENT
Bianca Genova has worked hard to make networking events for LinkedB2B more attractive to
members (see Exercises 10.18, 10.19, and 11.13 for background). She developed a speaker series
as one strategy to attract members to attend the events. Several months ago, she invited a
prominent author and speaker, Madison Avery, to an event on September 4. On August 21,
Madison sent the following note:
SUBJECT: Speaking Cancellation
Dear Bianca, I regret to inform you that I cannot speak at your September 4 networking event. I
will return the $2,000 advance that you sent me. In the past month, I have suffered some health
issues. I anticipated recovering more quickly. My doctor has advised that I avoid all travel for
several months to avoid some of these problems. On top of that, my father-in-law died two
weeks ago. As a result, Ive spent most of my time attempting to help my husband deal with this
tragic time. I appreciate your understanding.
Madison
At this time, 179 professionals have signed up for the event. Bianca needs to write a message to
all professionals who have RSVPd and paid for the event. She will explain that she will find a
fill-in speaker on the same topic and she will offer refunds to any person who no longer wants to
attend the event
Complete the following tasks:
a. Evaluate how well madison delivers bad news.
b. Rewrite madisons note to more effectively deliver bad news.
c. Assume the role of samantha and write a message to members that delivers the bad news and
also helps promote the networking event even in the absence of madison as a speaker..
Berth Vader is a Canadian citizen who has always lived in London, On.pdfaminaENT
Berth Vader is a Canadian citizen who has always lived in London, Ontario. He has a spouse and
two school(cid:2)aged children. As of May 2020, he accepts a permanent employment in Akron, Ohio
(in the USA). On October 1, 2020, he moves to Akron to locate housing for his family. In order
for his children to finish the school term, his family remains in London until January 1, 2021.
When they move, Berth severs all residential ties with Canada other than the family home. The
home is put up for sale in January, 2021. However, it remains unsold as of December 31, 2021.
While Berth was scheduled to begin working in the U.S. in early 2021, he is unable to obtain the
required residency documents until July 1, 2021.
Explain Berth's Canadian residency status for 2020 and 2021..
Berlisle Inc. is a manufacturer of sails for small boats. The manage.pdfaminaENT
Berlisle Inc. is a manufacturer of sails for small boats. The management is trying to get a better
understanding of their costs and are concerned with the variances that they have seen between
budgets and actual results. The budget is prepared each November at Berlisle and standards are
updated at that time, which stay in use for the next year.
A new quality initiative launched by management resulted in Berlisle deciding to go to a new
supplier to attain the material they are using in production, and recent political changes have
resulted in new tariffs of $0.20 per meter. This is the first month that the tariffs have come into
effect. Labour costs seem to be too high, and the company is considering replacing some of the
more senior workers with younger workers and part-time workers that they feel they could pay
less money to. The following information is available for Berlisle Inc for the month of March.
During the month, 12,000 good units of product were produced:
Standard: (budgeted expected usage per unit developed in the prior year)
Material: 7.0 meters per unit at $8.00 per meter
Labour: 1.8 hours per unit at $24.00 per hour
Actual usage for March 2019
Material purchases: 85,000 meters at $8.35 per meter (landed cost)
Material used: 81,500 meters
Direct labour: 20,700 hours at $25.30 per hour
What is the material price and quantity variance? Is it favourable or unfavourable.[3 marks]
What is the labour rate and usage variance? Is it favourable or unfavourable. [3 marks]
Based on your analysis, what recommendations would you make to the management of Berlisle?
[3 marks].
below you will find the condensed finacial statements for Koko Inc. .pdfaminaENT
below you will find the condensed finacial statements for Koko Inc. and Suz Inc. for 2022.
Intructions 1. Compute the following ratios for each company. a. Rate of return on net sales b.
Rate of return on total assets at year-end c. Rate of return on stockholder's equity at year-end d.
Earnings per share of common stock e. Ratio of Stockholder's equity to total equities f. Current
ratio g. Asset turnover h. Boook value per share of common stock 2. Comment on any
similarities or differences in two companies ratios. 3. From investor's point of view, is one
company more at risk than the other? 4. Would you grant a five -year loan to either company?
Explain..
Below is the January operating budget for Casey Corp., a retailer.pdfaminaENT
Below is the January operating budget for Casey Corp., a retailer:
Budgeted sales are $200,000 for January
Collections of sales are 50% in the month of sale and 50% the next month Cost of goods sold
averages 70% of sales
Merchandise purchases total $150,000 in January
Marketing costs are $3,000 each month
Distribution costs are $5,000 each month
Administrative costs are $10,000 each month
For January, what is the budgeted operating income?.
Below you have the following directory structure. At the top there i.pdfaminaENT
Below you have the following directory structure. At the top there is the root directory denoted
by a backslash "\". CLASSES, DOS, WINDOWS, BOOK, FINANCE, etc. are the names of
subdirectories residing under the root directory; CONFIG.SYS is the name of a file residing in
the root directory, and chkdsk.exe, CHAPTER1.DOC, Q.EXE, etc. are the names of the files
stored in the subdirectories. The system prompt displays"C:\>" which means that the
current/default drive is C and the current/default directory is the root directory "\". The root
directory "\" is just the origin for other directories/subdirectories.
A. Look at the diagram. Assume that prompt "C:\FINANCE>" is displayed, meaning that the
current/default drive is C and the current/default directory is \FINANCE. Write two separate
SORT commands. Each of the two commands would accept input from file PERSONAL.
However, the first command would route the output to file PERSONAL1, and the second one
would append the output to file PERSONAL2.
_____________________________________________________________________________
___________________________________________________________________
B. You are still in directory \FINANCE. Assume that PERSONAL is a large file. What
command that uses a piping operation would you use to display the contents of the file one
screen at a time (to prevent the output from scrolling off the screen)?
______________________________________________
C. Look at the diagram. Assume that prompt "C:\FINANCE>" is displayed. Write the command
which would change the current directory to the root directory.
_____________________________________
D. Look at the diagram. Assume that prompt "C:\BOOK>" is displayed. In the space provided,
sketch the directory structure with the subdirectory and file names which would command TREE
/F generate. _______________________
E. Now assume that the "C:\ " prompt is displayed. Using a piping operation | and then the output
redirection >, write a single command that would pass the output from the DIR command as an
input to the SORT command and the output from the SORT command would be directed to a file
named Sorted_Directory.
___________________________________________.
Basic SEIR1. What is the equation that describes R0 for this model.pdfaminaENT
Basic SEIR
1. What is the equation that describes R0 for this model?
2. Compare the dynamics of the SIR and SEIR models by running both with the same
transmission rate, , recovery rate, and population size. Then, vary the parameter . How does the
introduction of the E class and the length of the incubation period change the resulting epidemic?
Consider the timing and magnitude of peak caseload, as well as the proportion of the population
that is infected by the end of the epidemic.
3.Run the model with values: N = 500, = 0.02, = 0.2 and = 0.1. How many people have
become, or are currently sick (either infectious or not) by day 20? On what day does the
epidemic peak?.
Be familiar with1.The main events which affected fashion ~ refer.pdfaminaENT
Be familiar with:
1.The main events which affected fashion? ~ refer to your chapter chronologies including those
at the transition for the 18th to the 19th century.
2. What is the French Revolution and the styles that are connected with it?
3. What is the headwear of the Romantic period for men and women?
4. What is Godeys Ladys Book?
5. What are the inventions and technology of the era?
6. Recognize the flow of fashion during this era for men and women.
Earlier to later
7. What are the influences of the Romantic Movement in the arts on fashion?
8. What is the difference between dress and undress?
9. What are Kashmir shawls/ Paisley shawls and their history?
DIRECTOIRE (dir-ecktwa) and EMPIRE PERIOD 1790-1820
1. Bonnet rouge (bon-nehrooje)
2. Carmagnole (car-man-yole)
3. Sans culottes
4. Cossacks
5. Incroyables (an-kwai-ab-leh)
6. Merveilleuse (mer-vay-use)
7. Muff
8. Indispensable
9. Reticule (ret-ih-kewl) also known as?
10. Pantaloons
11. Pelisse (pe-lisse)
12. Petticoat
13. Round gowns
14. Spencer (What is it and who wore it?)
15. Tail coat
16. Cravat
17. Trousers
18. Victimes a` la Titus
ROMANTIC PERIOD 1820-1850
1. Derby / Bowler
2. Top hat
3. Bustle
4. Corsets and who wore them?
5. Chatelaine (shat-eh-lane)
6. Womens headdress day and night Describe both
7. Mitts
8. Jeanette
9. En Coeur (ahn kour)
10. Bertha
11. Skeleton suit
12. Eton suit
13.Tunic suit
14. Fichu pelerine ( feesh u pel-er-reen)
15. Pelerine (pel-er-reen)
16. Gilet Corsage ~ What is it and it was adopted from mens what?
17. Hussar front
18. Juliet sleeves
19. Imbecile sleeves
20. Gigot sleeve/ Leg-of Mutton sleeves
21. Marie sleeves
22. Chesterfield
23. Mackintosh
24. Newmarket
25. Paletot (pal-tow or pal-ah-tow)
26. Ruching (roosh-ing)
27. Spatterdashers or spats
28. Galoshes.
Based on the above Project Charter and the planning meeting, develop.pdfaminaENT
Based on the above Project Charter and the planning meeting, develop a project network with
nodes representing activities and arrows representing precedence relationships between
activities. Once you have completed the network diagram, complete the initial project estimation
(ES, EF, LS, LF, TS) for each activity. Also identify the projects Critical Path. (Use a Project
Start Activity and Project End Activity with no duration to connect your activities at each end of
your diagram).TC11 Proieet Plannina Maatina I Cohadule Calaulation A eoinwman.
Belinda decided to adopt a Pit Bull (Buddy) to save him from being.pdfaminaENT
Belinda decided to adopt a Pit Bull ("Buddy") to save him from being euthanized (killed).
Belinda hired her neighbor Clint, a dog trainer, to help Belinda to train Buddy to be more
sociable and to follow basic commands like "sit," "stay" and "down." During the first training
session Buddy attacked Clint, causing serious injuries. Clint sues Belinda for strict liability.
What will be the result under the Third Restatement?
A. Belinda will prevail because she paid Clint for the lessons
B. Belinda will prevail because Clint was contributorily negligent
C. Clint will prevail because Pit Bull dogs are generally classified as "abnormally dangerous"
animals
D. Clint will prevail because Belinda failed to warn him of the dog's dangerous nature.
Before you begin this assignment, take a moment to collect the names.pdfaminaENT
Before you begin this assignment, take a moment to collect the names of the entities that provide
two essential utilities for your residence for example: electricity, Internet, phone service, gas,
and water. Identify and briefly describe these two entities, and then analyze the market for each
of these two services. Be sure to address each of the following questions in your discussion
response: Does the local government influence the operations of this business? How many (if
any) suitable.
Beer menu. Your twelve (12) beeralecider selections will include t.pdfaminaENT
Beer menu. Your twelve (12) beer/ale/cider selections will include the name of thebeverage, the
name of the brewery or press, the type of beer/ale (lager, pilsner, stout, Kolsch, etc.) and its
ABV..
Broxton Group, a consumer electronics conglomerate, is reviewing.pdfaminaENT
Broxton Group, a consumer electronics conglomerate, is reviewing its annual budget in wireless
technology. It is considering investments in three different technologies to develop wireless
communication devices. Consider the following cash flows of the three independent projects.
Assume the discount rate is 9 percent. Further, the company has only $29 million to invest in
new projects this year..
Based on the information provided by the LEFS, I can track Toms pro.pdfaminaENT
Based on the information provided by the LEFS, I can track Tom's progress over time and know
if he is making a positive change if his score improves. If Tom reports less difficulty or
limitation in the functional activities he rates on the LEFS, such as walking, squatting, and
running, then it can indicate that he is making progress towards his goals and improving his
functional ability..
Bruce Banner was exposed to high levels of radiation (10-5 nm) durin.pdfaminaENT
Bruce Banner was exposed to high levels of radiation (10-5 nm) during a DARPA experiment,
while Jennifer Walters was subjected to continuous directional pulses of radiation (109 nm)
during a meteorology experiment. Who potentially sustained the most cellular damage?
Unable to tell
Jennifer Walters
Bruce Banner
They were both exposed to equivalent levels of radiation..
Briefly describe andor draw the phospolipase C-beta induction pathw.pdfaminaENT
Briefly describe and/or draw the phospolipase C-beta induction pathway, starting with ligand
binding and ending with activation of enzymes and Ca++ release. If you draw the pathway, label
each molecule..
How to Setup Default Value for a Field in Odoo 17Celine George
In Odoo, we can set a default value for a field during the creation of a record for a model. We have many methods in odoo for setting a default value to the field.
How to Manage Reception Report in Odoo 17Celine George
A business may deal with both sales and purchases occasionally. They buy things from vendors and then sell them to their customers. Such dealings can be confusing at times. Because multiple clients may inquire about the same product at the same time, after purchasing those products, customers must be assigned to them. Odoo has a tool called Reception Report that can be used to complete this assignment. By enabling this, a reception report comes automatically after confirming a receipt, from which we can assign products to orders.
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumMJDuyan
(𝐓𝐋𝐄 𝟏𝟎𝟎) (𝐋𝐞𝐬𝐬𝐨𝐧 𝟏)-𝐏𝐫𝐞𝐥𝐢𝐦𝐬
𝐃𝐢𝐬𝐜𝐮𝐬𝐬 𝐭𝐡𝐞 𝐄𝐏𝐏 𝐂𝐮𝐫𝐫𝐢𝐜𝐮𝐥𝐮𝐦 𝐢𝐧 𝐭𝐡𝐞 𝐏𝐡𝐢𝐥𝐢𝐩𝐩𝐢𝐧𝐞𝐬:
- Understand the goals and objectives of the Edukasyong Pantahanan at Pangkabuhayan (EPP) curriculum, recognizing its importance in fostering practical life skills and values among students. Students will also be able to identify the key components and subjects covered, such as agriculture, home economics, industrial arts, and information and communication technology.
𝐄𝐱𝐩𝐥𝐚𝐢𝐧 𝐭𝐡𝐞 𝐍𝐚𝐭𝐮𝐫𝐞 𝐚𝐧𝐝 𝐒𝐜𝐨𝐩𝐞 𝐨𝐟 𝐚𝐧 𝐄𝐧𝐭𝐫𝐞𝐩𝐫𝐞𝐧𝐞𝐮𝐫:
-Define entrepreneurship, distinguishing it from general business activities by emphasizing its focus on innovation, risk-taking, and value creation. Students will describe the characteristics and traits of successful entrepreneurs, including their roles and responsibilities, and discuss the broader economic and social impacts of entrepreneurial activities on both local and global scales.
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxOH TEIK BIN
(A Free eBook comprising 3 Sets of Presentation of a selection of Puzzles, Brain Teasers and Thinking Problems to exercise both the mind and the Right and Left Brain. To help keep the mind and brain fit and healthy. Good for both the young and old alike.
Answers are given for all the puzzles and problems.)
With Metta,
Bro. Oh Teik Bin 🙏🤓🤔🥰
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...TechSoup
Whether you're new to SEO or looking to refine your existing strategies, this webinar will provide you with actionable insights and practical tips to elevate your nonprofit's online presence.
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.pptHenry Hollis
The History of NZ 1870-1900.
Making of a Nation.
From the NZ Wars to Liberals,
Richard Seddon, George Grey,
Social Laboratory, New Zealand,
Confiscations, Kotahitanga, Kingitanga, Parliament, Suffrage, Repudiation, Economic Change, Agriculture, Gold Mining, Timber, Flax, Sheep, Dairying,
SWOT analysis in the project Keeping the Memory @live.pptx
BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE H.pdf
1. BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE
HELP ME CORRECTTHE CODE
Implement the class and methods according to the UML and specifications below.
Part 1 - Create Product.java and ProductTest.java
The Product class models an individual item type in a vending machine. Each product has a
name, cost. and price. Note that cost is the cost of the product to the vending machine company.
Price is the price that the vending machine will charge the customer. Violet has said that she is
unwilling to deal with anything but quarters, dollar bills, and debit cards so all prices are kept
divisible by 25 cents. Costs to the vending machine company can be any penny value. All of the
get methods perform the expected operation.
Data
Note: cost and price are both integers. All money in the vending machine is represented as cents
to enable simpler math and eliminate rounding issues.
ROUND_PRICE: int - the value in cents to which all prices will be rounded
name: String - the name of the product type
cost: int
price: int
Product()
The default constructor will create an instance of a product with a name of "Generic", a cost of
ROUND_PRICE = 25 cents and a price of twice the ROUND_PRICE.
Product(String name, int cost, int price) throws IllegalArgumentException
This constructor takes the name, cost, and price as parameters and sets the instance variables
appropriately. Null string names or negative cost or price should throw an
IllegalArgumentException. Prices should be rounded to the next ROUND_PRICE cents above
the amount given if the amount given if not already divisible by ROUND_PRICE. Note: if the
price given is not greater than the cost, the price should be the next ROUND_PRICE-divisible-
value that is greater than the cost.
toString()
The toString() method will return a String of the instance variables of the class exactly as shown
below. Assuming a name of "M&Ms", cost of $1.02, and a price of $1.25, toString() would
return:
Note: the cost and price are kept in cents so the toString() method will need to transform the
values into the right format.
Part 2 - Create Slot.java and SlotTest.java
The Slot class models a slot in the vending machine. Slots are loaded from the rear, and
2. purchases are removed from the front. This ensures that the items that have been in the machine
the longest are sold before newly added items.
Data
SLOT_SIZE: int = 10 - the maximum number of products that a slot in the vending machine can
hold.
products: ArrayList - models the actual products that are in the slot. Removing the one at the
front models buying one of the products in the slot and all of the others are moved forward
similar to an actual vending machine.
Slot()
The Slot() constructor creates an empty array list of products.
Slot(Product product)
This constructor creates a new slot that is filled with SLOT_SIZE of product.
load(Product product)
This method loads the slot with however many new products are required to make sure it is full
and returns the number of products it took to fill the slot.
load(Product product, int count)
This method loads the slot with up to count new products in an attempt to fill the slot and returns
the number of products it used.
nextProduct()
This method returns a reference to the next product available for purchase. If the slot is empty
this method will return null.
buyOne()
This method simulates the purchase of one item from the perspective of the slot. That means no
money is dealt with here, rather the slot is checked to make sure there is product to buy and then
one product is removed from the front of the ArrayList modeling the slot. If a product is
successfully removed from the slot, it is returned, otherwise null is returned.
toString()
The toString() method returns a String exactly like the one below for a slot with 10 M&M
products. Items should start with the front slot and end with the rear slot.
Hint
Hint: Dont forget to make use of other toString() methods.
Part 3 - Create VendingMachine.java and test it.
The VendingMachine class is a simple vending machine. Exact change is required so it is
assumed if someone is buying something they have inserted the right amount of money or have
used a debit card. The get methods return the appropriate instance variable values.
Data
3. DEFAULT_SIZE: int = 15 the default size for a VendingMachine, used primarily by the default
constructor
totalProfit: int this models the total profit for all of the VendingMachines together. It is the sum
of the price of every product bought from all of the machines minus the sum of the cost of all the
products ever put in all of the machines. Note that it is protected in the UML diagram so it is
accessible to classes that inherit from this class.
machineProfit: int this models the long term profit for this particular machine. It is the sum of
the price of every product bought from this machine minus the sum of the cost of all the products
ever put in this machine. Note that it is protected in the UML diagram so it is accessible to
classes that inherit from this class.
slots: Slot[] this array models the array of slots in the VendingMachine.
VendingMachine()
The default constructor creates a VendingMachine with DEFAULT_SIZE empty Slots.
VendingMachine(int size)
Creates a VendingMachine with the indicated number of empty Slots.
VendingMachine(int size, Product product)
Creates a VendingMachine with size Slots each full of product.
load()
Loads an empty or partially empty VendingMachine with a Generic product (i.e. the product
obtained using the default constructor of the Product class.) Makes appropriate adjustments to
machineProfit and totalProfit by subtracting costs from profit values.
load(int slotNum, int count, Product product)throws IllegalArgumentException
Loads the slot indicated by slotNum with product until it is full or until count is reached. Makes
appropriate adjustments to machineProfit and totalProfit by subtracting costs from profit values.
Throws an IllegalArgumentException if the slotNum is out of bounds, the count is less than or
equal to zero, or if the product is null.
nextProduct(int slotNum)throws IllegalArgumentException
Returns a reference to the next available product in the indicated slot or null if the slot is empty.
Throws an IllegalArgumentException if the slotNum is out of bounds.
buy(int slotNum)throws IllegalArgumentException
Models buying one item from the slot number indicated. Makes appropriate adjustments to
machineProfit and totalProfit by adding the price to the profit values. Throws an
IllegalArgumentException if the slotNum is out of bounds. Returns false if there is no product to
buy.
resetTotalProfit()
This method resets the totalProfit static instance variable to zero. This is useful when testing to
4. make sure that different method tests start out in a known state for the static variable so the final
value can be computed without knowing the order of the test runs.
toString()
Returns a String representing the VendingMachine, each slot, the machineProfit and totalProfit
exactly as shown below for a 2-slot VendingMachine filled with Generic product where nothing
has been bought (so the profits are negative).
Part 4 - Create DrinkMachine.java and test it.
The drink machine inherits from the general VendingMachine described above. The only
additions are a constant for the cooling charge and a different buy method which will affect the
profit for the machine and the total profit differently than in the general VendingMachine.
DrinkMachines will assess a charge for keeping the drink cold when the drink is purchased. This
charge impacts the cost of the product to the vending machine company. It does not impact the
price for the customer.
Data
COOLING_CHARGE: int = 10 this models the ten-cent charge assessed to each drink when it is
purchased to account for the refrigeration costs of the drink machine.
DrinkMachine()
Performs the same action for the DrinkMachine as VendingMachine().
DrinkMachine(int size, Product product)
Performs the same action for the DrinkMachine as VendingMachine(int size, Product product).
buy(int slotNum) throws IllegalArgumentException
Models buying one item from the slot number indicated. Throws an IllegalArgumentException if
the slotNum is out-of-bounds. Makes appropriate adjustments to machineProfit and totalProfit by
adding the price
Hint
use a public method) minus the COOLING_CHARGE to the profit values.
Part 5 - Create ChangeMakingMachine.java and test it.
The change-making machine will add the functionality of being able to pay with cash and
potentially get change back. The change will just be returned as an integer value in cents, but the
amount paid in will be determined by the number of quarters and dollars that are entered.
ChangeMakingMachine()
Performs the same action for the ChangeMakingMachine as VendingMachine()
ChangeMakingMachine(int size)
Performs the same action for the ChangeMakingMachine as VendingMachine(int size).
ChangeMakingMachine(int size, Product product)
Performs the same action for the ChangeMakingMachine as VendingMachine(int size, Product
5. product)
buy(int slotNum, int quarters, int dollars)throws IllegalArgumentException
Models buying one item from the slot number indicated. Throws an IllegalArgumentException if
the slotNum is out of bounds or if quarters or dollars are negative. Computes the amount of
money put into the machine in quarters and dollars, returning -1 if there is not enough money to
buy the product and returning the positive difference or change if there is any. Makes appropriate
adjustments to machineProfit and totalProfit by adding the price to the profit values if the buy is
successful.
Note
Use a public method to accomplish this.
Part 6 - Create SnackMachine.java and test it.
The snack machine will inherit from the ChangeMakingMachine. The difference is it will have
an additional instance variable of an array list of products which will indicate the type of product
each slot should contain and its load method will fill each slot completely with the particular
product the slot contains, making appropriate adjustments to the profit tallies.
Data
productList: ArrayList contains the list of products for each slot in the SnackMachine. The first
position in the productList corresponds to the product in the first slot in the slots array.
SnackMachine(ArrayList pList)
This constructor initializes the productList of the SnackMachine and creates a new snack
machine where each slot is full of the product indicated in the matching position in the
productList. The size of the snack machine is just the length of the productList.
load()
This load method completely fills each slot in the snack machine with the appropriate product.
As a slot is filled, the total cost of the items is subtracted from the profit tallies.
Part 7 - Create Simulator.java and test it.
The simulator will provide a means of simulating a small business of vending machines. The
vending machines of the business are stored in an array list. Vending machines can be added to
the list using the provided method to simulate the growth of a business. Simulation of the
business running and selling product is done by simulating a specific number of products being
bought from every slot of every vending machine in the business and returning the totalProfit of
all of the vending machines in cents.
Data
vmList: ArrayList models the list of vending machines owned by the company
Simulator(ArrayList vmList)
Instantiates a Simulator
6. addVM(VendingMachine vm)
Adds the VendingMachine indicated by vm to the end of the list of vending machines owned by
the company.
simulate(int pCount)
Simulates buying pCount products from every slot of every VendingMachine owned by the
company. Returns the totalProfit of all of the VendingMachines.
public class VendingMachine {
public static final int DEFAULT_SIZE = 15;
protected static int totalProfit;
protected int machineProfit;
private Slot[] slots;
/**
* Construct a Vending Machine with default.
*/
public VendingMachine() {
this(DEFAULT_SIZE);
}
/**
* Construct a Vending Machine.
* @param size number
*/
public VendingMachine(int size) {
this.slots = new Slot[size];
for (int i = 0; i < size; i++) {
slots[i] = new Slot(new Product());
}
}
/**
* Construct a Vending Machine.
* @param size number
* @param product number
*/
7. public VendingMachine(int size, Product product) {
this.slots = new Slot[size];
for (int i = 0; i < size; i++) {
slots[i] = new Slot(product);
machineProfit += product.getPrice() - product.getCost();
}
totalProfit += machineProfit;
}
/**
* the method load the slots.
*
*/
public void load() {
Product product = new Product();
for (int i = 0; i < slots.length; i++) {
if (i < DEFAULT_SIZE) {
slots[i] = new Slot(new Product());
machineProfit -= product.getCost();
totalProfit -= product.getCost();
}
}
}
/**
* the method load the slots..
* @param slotNum number
* @param count number
* @param product number
*/
public void load(int slotNum, int count, Product product) throws IllegalArgumentException {
if (slotNum < 0 || slotNum >= slots.length) {
throw new IllegalArgumentException("Invalid slot number: " + slotNum);
}
if (count <= 0) {
8. throw new IllegalArgumentException("Count must be greater than zero: " + count);
}
if (product == null) {
throw new IllegalArgumentException("Product cannot be null.");
}
Slot slot = slots[slotNum];
int remainingCapacity = slot.load(product, count);
int actualCount = Math.min(count, remainingCapacity);
for (int i = 0; i < actualCount; i++) {
slot.nextProduct();
machineProfit -= product.getCost();
totalProfit -= product.getCost();
}
}
/**
* the method next Product.
* @param slotNum number
* @return Product
*/
public Product nextProduct(int slotNum) throws IllegalArgumentException {
if (slotNum < 0 || slotNum >= slots.length) {
throw new IllegalArgumentException("Invalid slot number: " + slotNum);
}
return slots[slotNum].nextProduct();
}
/**
* the method buy.
* @param slotNum number
* @return true
*/
public boolean buy(int slotNum) throws IllegalArgumentException {
if (slotNum < 0 || slotNum >= slots.length) {
throw new IllegalArgumentException("Invalid slot number: " + slotNum);
}
9. Slot slot = slots[slotNum];
Product product = slot.nextProduct();
if (product == null) {
return false;
}
machineProfit += product.getPrice() - product.getCost();
totalProfit += product.getPrice() - product.getCost();
return true;
}
/**
* the method return Slot Count.
* @return SlotCount
*/
public int getSlotCount() {
return slots.length;
}
/**
* the method get the value and return total Profit.
* @return totalProfit
*/
public static int getTotalProfit() {
return totalProfit;
}
/**
* the method reset Total Profit.
*/
public static void resetTotalProfit() {
totalProfit = 0;
}
/**
10. * the method get the value and return Machine Profit.
* @return getMachineProfit
*/
public int getMachineProfit() {
int cost = 0;
int price = 0;
int i = 0;
for (Slot slot : slots) {
cost += i * slot.nextProduct().getCost();
price += i * slot.nextProduct().getPrice();
i++;
}
machineProfit = price - cost;
return machineProfit;
}
/**
* the method get the value and return String.
* @return return String
*/
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Vending Machinen SlotCount: ").append(slots.length).append(" of n");
for (int i = 0; i < slots.length; i++) {
sb.append("Product: ").append(slots[i].nextProduct().getName()).append("Cost: ").
append(slots[i].nextProduct().getCost()).append("Price: ").
append(slots[i].nextProduct().getPrice()).append(".");
}
sb.append("Total Profit: ").append(totalProfit / 100.0).
append(". Machine Profit: ").append(machineProfit / 100.0).append(".");
return sb.toString();
}
}
=====================================================================
11. ==================
public class SnackMachine extends ChangeMakingMachine {
private ArrayList productList;
private Slot[] slots;
/**
* Construct a Snack Machine.
* @param pList number
*/
public SnackMachine(ArrayList pList) {
super(pList.size());
this.productList = pList;
Product product = new Product();
for (int i = 0; i < pList.size(); i++) {
this.slots[i] = new Slot(pList.get(i));
}
this.machineProfit -= product.getCost() * pList.size();
VendingMachine.totalProfit -= product.getCost() * pList.size();
}
/**
* the method load.
*/
public void load() {
Product product = new Product();
this.machineProfit -= product.getCost() * this.productList.size();
VendingMachine.totalProfit -= product.getCost() * this.productList.size();
for (int i = 0; i < this.productList.size(); i++) {
this.slots[i] = new Slot(this.productList.get(i));
}
}
}
=======================================================
public class Simulator {
private ArrayList vmList;
/**
12. * Construct a Snack Machine.
* @param vmList number
*/
public Simulator(ArrayList vmList) {
this.vmList = vmList;
}
/**
* Construct a Snack Machine.
* @param vm number
*/
public void addVM(VendingMachine vm) {
vmList.add(vm);
}
/**
* the method simulate.
* @param pCount number
* @return total Profit Product
*/
public int simulate(int pCount) {
int totalProfit = 0;
for (VendingMachine vm : vmList) {
totalProfit += vm.nextProduct(pCount).getPrice();
}
return totalProfit;
}
}
=====================================================================
===
public class ChangeMakingMachine extends VendingMachine {
/**
* Construct a Change Making Machine with default.
*/
public ChangeMakingMachine() {
13. super();
}
/**
* Construct a Change Making Machine.
* @param size number
*/
public ChangeMakingMachine(int size) {
super(size);
}
/**
* Change Making Machine method.
* @param size number
* @param product
*
*/
public ChangeMakingMachine(int size, Product product) {
super(size, product);
}
/**
* Change Making Machine method.
* @param slotNum number
* @param quarters number
* @param dollars number
* @return int
*/
public int buy(int slotNum, int quarters, int dollars) throws IllegalArgumentException {
if (slotNum < 0 || slotNum > slotNum) {
throw new IllegalArgumentException("Invalid slot number.");
}
if (quarters < 0 || dollars < 0) {
throw new IllegalArgumentException("Invalid number of quarters or dollars.");
}
14. int price = nextProduct(slotNum).getPrice();
int totalPaid = 25 * quarters + 100 * dollars;
if (totalPaid < price) {
return -1;
}
int change = totalPaid - price;
return change;
}
}