I finished most of the program, but having trouble with some key features. I bolded and italicized
the parts I can\'t figure out, and included them below. I included my code at the bottom. Thanks!
1. I can\'t get my RemoveItem() and ModifyItem() functions to work.
2. GetNumItemsInCart() is returning the wrong value. For example, my cart has 5 chocolate chip
cookies, 1 headphone, and 2 sneakers. GetNumItemsInCart() returns 3 instead of 8 when I output
my shopping cart.
3. When PrintDescriptions() is called, the first letter of my item description is missing. For
example, for the chocolate chip cookies, the description is Semi-sweet. When PrintDescriptions()
is called, it returns emi-sweet, with the S gone.
4. Shopping Cart improperly initialized with default constructor , and I don\'t know why.
12.9 Program: Online shopping cart (continued) (C++)
This program extends the earlier \"Online shopping cart\" 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 item\'s description, price, and/or quantity. Has parameter ItemToPurchase. Does not
return anything.
If item can be found (by name) in cart, check if parameter has default values for description,
price, and quantity. If not, modify item in cart.
If item cannot be found (by name) in cart, output this message: Item not found in cart. Nothing
modified.
GetNumItemsInCart() (2 pts)
Returns quantity of all items .
12.9 Program Online shopping cart (continued) (C++)This program e.pdffasttracksunglass
12.9 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 item\'s description, price, and/or quantity. Has parameter ItemToPurchase. Does not
return anything.
If item can be found (by name) in cart, check if parameter has default values for description,
price, and quantity. If not, modify item in cart.
If item cannot be found (by name) in cart, output this message: Item not found in cart. Nothing
modified.
GetNumItemsInCart() (2 pts)
Returns quantity of all items in cart. Has no parameters.
GetCostOfCart() (2 pts)
Determines and returns the total cost of items in cart. Has no parameters.
PrintTotal()
Outputs total of objects in cart.
If cart is empty, output this message: SHOPPING CART IS EMPTY
PrintDescriptions()
Outputs each item\'s description.
Ex. of PrintTotal() output:
Ex. of PrintDescriptions() output:
(3) In main(), prompt the user for a customer\'s name and today\'s date. Output the name and
date. Create an object of type ShoppingCart. (1 pt)
Ex.
(4) Implement the PrintMenu() function. PrintMenu() has a ShoppingCart parameter, and
outputs a menu of options to manipulate the shopping cart. Each option is represented by a single
character. Build and output the menu within the function.
If the an inval.
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.
Write a program that mimics the operations of several vending machin.pdfeyebolloptics
Write a program that mimics the operations of several vending machines. More specifically, the
program simulates what happens when the user chooses one of the vending machines, inputs
money and picks an item from the vending machine. Assume there are two vending machines:
one for drinks and one for snacks. Each vending machine contains several items. The name,
price, and quantity of each item is given in two text files; one named “drinks.txt” for the drinks
vending machine and the other named “snacks.txt” for the snacks vending machine.
The format of the input values is comma-separated. The items listed should be organized in the
file with the following order: name, price, quantity. Here are some example items:
The actual reading and parsing of the input file is already handled in the class supplied to you
(see code on BlackBoard). You are given the variables as individual values. You will need to
create the .txt files for creating and testing your vending machines.
You will need to create/complete three classes for this homework assignment: Item,
VendingMachine, and VendingMachineDriver.
Problem Description
Milk,2.00,1
Within your VendingMachine class, include these methods:
VendingMachineThisconstructormethodwilltakeinthenameoftheinputfileand create a vending
machine object. A vending machine object will contain an array of Item objects called stock and
an amount of revenue earned. This constructor method has been completed for you and should
work appropriately once you have completed the rest of this class and the other class definitions.
vendThismethodwillsimulatethevendingtransactionafteravalidamountofmoney and an item
selection are entered. This method will decide if the transaction is successful (enough money or
item) and update the vending machine appropriately.
outputMessage This method will print an appropriate message depending on the success of the
transaction. If the user does not have enough money to buy the chosen item, the vending machine
should prompt the user to enter more money or exit the machine. If the vending machine is out of
the chosen item, the program will print an apology message and prompt the user to choose
another item or exit the machine. If there is enough money for the item selected, then the
vending machine will give the user the item and return the change.
printMenuThismethodprintsthemenuofitemsforthechosenvendingmachine. The Item class needs
to include the following data variables:
• description as a String
• price as a double
• quantity as an int
Within your VendingMachineDriver class, include a main method as the starting point for your
solution that creates the vending machine objects appropriately and then use a loop that
continues interacting with the vending machines until the user enters “X” to exit. See the sample
session for details.
As you implement your solution, you might find that some methods contain some repeated
coding logic. To avoid unnecessary redundancies in your code, have these method.
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.
12.9 Program Online shopping cart (continued) (C++)This program e.pdffasttracksunglass
12.9 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 item\'s description, price, and/or quantity. Has parameter ItemToPurchase. Does not
return anything.
If item can be found (by name) in cart, check if parameter has default values for description,
price, and quantity. If not, modify item in cart.
If item cannot be found (by name) in cart, output this message: Item not found in cart. Nothing
modified.
GetNumItemsInCart() (2 pts)
Returns quantity of all items in cart. Has no parameters.
GetCostOfCart() (2 pts)
Determines and returns the total cost of items in cart. Has no parameters.
PrintTotal()
Outputs total of objects in cart.
If cart is empty, output this message: SHOPPING CART IS EMPTY
PrintDescriptions()
Outputs each item\'s description.
Ex. of PrintTotal() output:
Ex. of PrintDescriptions() output:
(3) In main(), prompt the user for a customer\'s name and today\'s date. Output the name and
date. Create an object of type ShoppingCart. (1 pt)
Ex.
(4) Implement the PrintMenu() function. PrintMenu() has a ShoppingCart parameter, and
outputs a menu of options to manipulate the shopping cart. Each option is represented by a single
character. Build and output the menu within the function.
If the an inval.
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.
Write a program that mimics the operations of several vending machin.pdfeyebolloptics
Write a program that mimics the operations of several vending machines. More specifically, the
program simulates what happens when the user chooses one of the vending machines, inputs
money and picks an item from the vending machine. Assume there are two vending machines:
one for drinks and one for snacks. Each vending machine contains several items. The name,
price, and quantity of each item is given in two text files; one named “drinks.txt” for the drinks
vending machine and the other named “snacks.txt” for the snacks vending machine.
The format of the input values is comma-separated. The items listed should be organized in the
file with the following order: name, price, quantity. Here are some example items:
The actual reading and parsing of the input file is already handled in the class supplied to you
(see code on BlackBoard). You are given the variables as individual values. You will need to
create the .txt files for creating and testing your vending machines.
You will need to create/complete three classes for this homework assignment: Item,
VendingMachine, and VendingMachineDriver.
Problem Description
Milk,2.00,1
Within your VendingMachine class, include these methods:
VendingMachineThisconstructormethodwilltakeinthenameoftheinputfileand create a vending
machine object. A vending machine object will contain an array of Item objects called stock and
an amount of revenue earned. This constructor method has been completed for you and should
work appropriately once you have completed the rest of this class and the other class definitions.
vendThismethodwillsimulatethevendingtransactionafteravalidamountofmoney and an item
selection are entered. This method will decide if the transaction is successful (enough money or
item) and update the vending machine appropriately.
outputMessage This method will print an appropriate message depending on the success of the
transaction. If the user does not have enough money to buy the chosen item, the vending machine
should prompt the user to enter more money or exit the machine. If the vending machine is out of
the chosen item, the program will print an apology message and prompt the user to choose
another item or exit the machine. If there is enough money for the item selected, then the
vending machine will give the user the item and return the change.
printMenuThismethodprintsthemenuofitemsforthechosenvendingmachine. The Item class needs
to include the following data variables:
• description as a String
• price as a double
• quantity as an int
Within your VendingMachineDriver class, include a main method as the starting point for your
solution that creates the vending machine objects appropriately and then use a loop that
continues interacting with the vending machines until the user enters “X” to exit. See the sample
session for details.
As you implement your solution, you might find that some methods contain some repeated
coding logic. To avoid unnecessary redundancies in your code, have these method.
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.
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.
Header file for an array-based implementation of the ADT bag. @f.pdfsudhirchourasia86
/** Header file for an array-based implementation of the ADT bag. @file ArrayBag.h */
#ifndef _ARRAY_BAG
#define _ARRAY_BAG
#include \"BagInterface.h\"
template class ArrayBag : public BagInterface
{
private:
static const int DEFAULT_CAPACITY = 6; // Small size to test for a full bag
ItemType items[DEFAULT_CAPACITY]; // Array of bag items
int itemCount; // Current count of bag items
int maxItems; // Max capacity of the bag
// Returns either the index of the element in the array items that // contains the given target or -1,
if the array does not contain // the target.
int getIndexOf(const ItemType& target) const;
public:
ArrayBag();
int getCurrentSize() const;
bool isEmpty() const;
bool add(const ItemType& newEntry);
bool remove(const ItemType& anEntry);
void clear();
bool contains(const ItemType& anEntry) const;
int getFrequencyOf(const ItemType& anEntry) const;
vector toVector() const;
}; // end ArrayBag
//#include \"ArrayBag.cpp\" // /** Implementation file for the class ArrayBag. @file
ArrayBag.cpp */
#include \"ArrayBag.h\"
#include template
ArrayBag::ArrayBag(): itemCount(0), maxItems(DEFAULT_CAPACITY)
{ } // end default constructor
template int ArrayBag::getCurrentSize() const { return itemCount; } // end getCurrentSize
template bool ArrayBag::isEmpty() const { return itemCount == 0; } // end isEmpty
template bool ArrayBag::add(const ItemType& newEntry)
{
bool hasRoomToAdd = (itemCount < maxItems);
if (hasRoomToAdd)
{
items[itemCount] = newEntry; itemCount++;
} // end if return hasRoomToAdd;
} // end add
/* // STUB template bool ArrayBag::remove(const ItemType& anEntry) { return false; // STUB
} // end remove
*/ template bool ArrayBag::remove(const ItemType& anEntry)
{
int locatedIndex = getIndexOf(anEntry);
bool canRemoveItem = !isEmpty() && (locatedIndex > -1);
if (canRemoveItem)
{
itemCount--;
items[locatedIndex] = items[itemCount];
} // end if return
canRemoveItem;
} // end remove /*
// STUB template void ArrayBag::clear() { // STUB } // end clear
*/ template void ArrayBag::clear() { itemCount = 0; } // end clear
template int ArrayBag::getFrequencyOf(const ItemType& anEntry) const
{
int frequency = 0;
int curIndex = 0; // Current array index
while (curIndex < itemCount)
{
if (items[curIndex] == anEntry)
{
frequency++;
} // end if
curIndex++; // Increment to next entry
} // end while
return frequency;
} // end getFrequencyOf
template bool ArrayBag::contains(const ItemType& anEntry) const
{
return getIndexOf(anEntry) > -1;
} // end contains
/* ALTERNATE 1: First version
template bool ArrayBag::contains(const ItemType& target) const
{
return getFrequencyOf(target) > 0;
} // end contains
// ALTERNATE 2: Second version
template bool ArrayBag::contains(const ItemType& anEntry) const
{
bool found = false;
int curIndex = 0; // Current array index
while (!found && (curIndex < itemCount))
{
if (anEntry == items[curIndex])
{
found = true;
} // end if
curIndex++; // Increment to next entry
} // end while
return found;
} // end contains
*/ temp.
Amusement Park Programming ProjectProject Outcomes1. Use the Jav.docxcullenrjzsme
Amusement Park Programming Project
Project Outcomes
1. Use the Java selection constructs (if and if else).
2. Use the Java iteration constructs (while, do, for).
3. Use Boolean variables and expressions to control iterations.
4. Use arrays or ArrayList for storing objects.
5. Proper design techniques.
Project Requirements
Your job is to implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop. The information system consists of three classes including a class to model tickets, a class to model gift shop merchandise, the amusement park, and the amusement park tester. The gift shop supports access to specific merchandise in the park’s gift shop and to purchase the merchandise or to order new merchandise for the gift shop. The UML diagram for each class (except the tester class) is given below.
1) Develop a simple class that models admission tickets. Each admission is described by several instance fields:
a. A ticket number as a long integer to identify the unique ticket,
b. A ticket category represented as a String to store the category of the ticket (i.e. adult, child, senior),
c. A ticket holder represented as a String to store the name of the person who purchased the ticket,
d. A date represented as a Date to store the admission date for the ticket,
e. A price represented as a double to store the price of the ticket,
f. A purchase status represented as a boolean to indicate if the ticket has been purchased (or is reserved).
Ticket
-number : long
-category : String
-holder : String
-date : Date
-price : double
In addition to these fields, the class has the following constructors and
methods:
a. A parameterized constructor that initializes the attributes of a ticket.
b. setPrice(double price) to change the price of a textbook.
c. changePurchaseStatus(boolean newStatus) to change the
purchase status of the ticket.
d. Accessor methods for all instance fields.
e. toString() to return a neatly formatted string that contains all the
information stored in the instance fields.
2) Develop a simple class that models merchandise available in the gift shop
such as t-shirts, sweatshirts, and stuffed animals. The class has several
instance fields:
a. An ID as a long integer to identify the specific merchandise item,
b. A category as a String to store the specific type of merchandise,
c. A description as a String to store the description of the merchandise,
d. A price represented as a double to store the price of the merchandise,
e. An instock as a boolean to indicate if the merchandise is instock or onorder.
Valid values for category include "T-Shirt", "Sweatshirt", and "Stuffed Animal",
as well as any additional category you choose to support. If invalid values are
entered, an error message must be printed and the category instance field
must be set to "UNKNOWN".
In addition to these attributes, the class has the following constructors and
methods:
f. A parameterized constructor that initi.
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.
import entity.Product;
012.
import java.util.*;
013.
014.
/**
015.
*
016.
* author tgiunipero
017.
*/
018.
public category ShoppingCart
029.
030.
/**
031.
* Adds a <code>ShoppingCartItem</code> to the <code>ShoppingCart</code>\'s
032.
* <code>items</code> list. If item of the desired <code>product</code>
033.
* already exists in go-cart list, the number of that item is
034.
* incremented.
035.
*
036.
* param product the <code>Product</code> that defines the kind of go-cart item
037.
* see ShoppingCartItem
038.
*/
039.
public synchronised void addItem(Product product)
050.
}
051.
052.
if (newItem)
056.
}
057.
058.
/**
059.
* Updates the <code>ShoppingCartItem</code> of the desired
060.
* <code>product</code> to the desired amount. If \'<code>0</code>\'
061.
* is that the given amount, the <code>ShoppingCartItem</code> is removed
062.
* from the <code>ShoppingCart</code>\'s <code>items</code> list.
063.
*
064.
* param product the <code>Product</code> that defines the kind of go-cart item
065.
* param amount the amount that the <code>ShoppingCartItem</code> is updated to
066.
* see ShoppingCartItem
067.
*/
068.
public synchronised void update(Product product, String quantity) forged amount as short
073.
qty = Short.parseShort(quantity);
074.
075.
if (qty >= 0) {
076.
077.
ShoppingCartItem item = null;
078.
079.
for (ShoppingCartItem scItem : items) {
080.
081.
if (scItem.getProduct().getId() == product.getId()) {
082.
083.
if (qty != 0) {
084.
// set item amount to new price
085.
scItem.setQuantity(qty);
086.
} else {
087.
// if amount equals zero, save item and break
088.
item = scItem;
089.
break;
090.
}
091.
}
092.
}
093.
094.
if (item != null) take away from cart
096.
items.remove(item);
097.
}
098.
}
099.
}
100.
101.
/**
102.
* Returns the list of <code>ShoppingCartItems</code>.
103.
*
104.
* return the <code>items</code> list
105.
* see ShoppingCartItem
106.
*/
107.
public synchronised List<ShoppingCartItem> getItems()
111.
112.
/**
113.
* Returns the total of quantities for all things maintained in go-cart
114.
* <code>items</code> list.
115.
*
116.
* return the amount of things in go-cart
117.
* see ShoppingCartItem
118.
*/
119.
public synchronised int getNumberOfItems()
127.
128.
return numberOfItems;
129.
}
130.
131.
/**
132.
* Returns the total of the merchandise worth increased by the number for all
133.
* things in go-cart list. this is often the overall price excluding the surcharge.
134.
*
135.
* return the price of all things times their quantities
136.
* see ShoppingCartItem
137.
*/
138.
public synchronised double getSubtotal() quantity = 0;
141.
142.
for (ShoppingCartItem scItem : items)
147.
148.
return amount;
149.
}
150.
151.
/**
152.
* Calculates the overall price of the order. This methodology adds the subtotal to
153.
* the selected surcharge and sets the <code>total</code> instance variable
154.
* with the result.
155.
*
156.
* param surcharge the selected surcharge for all orders
157.
* see ShoppingCartItem
158.
*/
159..
I really need help with this Assignment Please in C programming not .pdfpasqualealvarez467
I really need help with this Assignment Please in C programming not C++ or C#, just C. Thank
you!
Hello , Choose please one of the following program types:
The assignment is to write a menu driven program that manages a small business inventory,
collection or list. You pick the topic. The focus of your program is up to you.
The Menu commands must include:
P....Display all records (on the screen/monitor) S....Create a current report (save it to a file)
A....Add a new entry
D....Delete an item from the list (inventory) C....Clear all records
Q...Quit
You must add (1) additional menu option that you choose. It may be a menu option that allows
the inventory to be modified. i.e. add inventory quantities, change price/cost, change dates, etc.
You will use structs and an array to organize the data in the program. Your struct must contain
at least the following kinds of information: o Minimum of 2 strings (character arrays)
Suggestions include: item name, manufacturer, etc o Minimum of 2 integers – 1 must be product
id
Product id, qty in stock o Minimum of 2 double values
Suggestions include: cost, price, average inventory:
When you add new item the program will ask the user for each of the fields on a separate line.
When you delete an item from inventory the program will ask you for the integer id of the entry
to be deleted, locate the entry in the array and remove all of the data for that entry. – The list
does not need to be sorted – to remove an entry, you may move the last item in the list to the
location of the deleted entry
When you display the records on the screen, all of the information stored for each entry will be
labeled and displayed.
Creating a current inventory report copies the current entries in the array to an output file. This
must include labeling all of the information so that it is clear what information is being provided.
Clearing the records deletes all of the information in the array.
When you add new item the program will ask the user for each of the fields on a separate line.
When you delete a question from the list, the program will ask you for the question id of the
entry to be deleted, locate the entry in the array and remove all of the data for that entry. – The
list does not need to be sorted – to remove an entry, you may move the last item in the list to the
location of the deleted entry
When you play the game, you must display the question, the possible answers and the point
value. If the player answers correctly the point value will be added to the game total. If answered
incorrectly, the correct answer will be displayed. Creating a current report copies the current
content of the question array to an output file. This must include labeling all of the information
so that it is clear what information is being provided.
Clearing all questions deletes all of the information in the array.
Instructions:
You should use at least 10 user-defined functions (plus main) to appropriately break the problem
up into smaller piece.
BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE H.pdfaminaENT
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.
Fixing Magento Core for Better Performance - Ivan ChepurnyiMeet Magento Spain
The performance optimization of Magento webshop, it is not only writing your module in the clean way, it is also optimization of core code.
During the session, you will learn how to deal with optimization of most common Magento bottlenecks at catalog, shopping cart and checkout pages.
Processing more than 10 orders per second, serving category, product and checkout pages within 800 milliseconds (and even less) without front cache is possible.
C++ help finish my code Phase 1 - input phase. Main reads the fi.pdfinfo189835
C++ help finish my code
Phase 1 - input phase. Main reads the file and populates one Grocery element in the array for
each input
record. This is a standard .txt file and is delimited by new line (\n) characters at the end of every
input record.
This allows you to use getline. See the Canvas assignment and copy the file named a4data.txt to
your
machine. Do not change the name of the file it must be a4data.txt. Assume that the input will be
correct.
The input record format is:
6 characters - item UPC
20 characters - item description
6 characters - cost (999.99 format)
6 characters - selling price (999.99 format)
3 characters - inventory on hand
1 character - status (o on order; d discontinued; s on shelf)
Use correct read loop logic as discussed in class.
There is no constructor. The Grocery array is statically allocated, so if there was a constructor, it
would be
executed when the array was first defined, once per element.
The maximum number of grocery items is 100, and youll need a counter to keep track of how
many there
actually are. Define that counter as a static variable in the Grocery class, and use it throughout
your code as
needed.
At the end of phase 1, main has built a set of Grocery objects.
Next, main should display all the Grocery objects to ensure that the array has been built
correctly. Examine
the input data and determine if your code is processing all the records, and each record correctly.
Display
them after you have processed the input file; do not list each object as its created within the read
loop. Use
some appropriate column formatting so that you can make sense of the output, and so that you
can verify
that the objects have all been created and populated correctly. At this point, there is no price
history data,
that will be added in the next phase. Your display should look something like this:
=====================================================================
=
UPC Description Cost Price Inventory Status
=====================================================================
=
123456 Peas, canned, 12 oz 1.23 1.89 100 s
234567 Tomatoes, sundried 2.25 3.75 25 s
345676 Pineapple, whole 2.99 4.25 0 o
Phase 2 Transaction processing phase. Main asks the console user for transactions. Use getline;
do
not use some other form of input. There are four different types of transactions. Assume the
transaction data
is valid (no error checking needed). There are four types of transactions:
D
Display a list of all Grocery items, one item at a time, something like this:
=====================================================================
=
UPC Description Cost Price Inventory Status
=====================================================================
=
123456 Peas, canned, 12 oz 1.23 1.89 100 s
Price history: 2021-03-17 1.11
2021-04-17 1.45
2022-06-14 1.89
234567 Tomatoes, sundried 2.25 3.75 25 s
Price history: 2021-03-17 1.98
2021-04-17 2.25
345676 Pineapple, whole 2.99 4.25 0 o
Price history: there is no price history for this item.
Migrating One of the Most Popular eCommerce Platforms to MongoDBMongoDB
Is it worthwhile to migrate a heavy SQL application to MongoDB? In this talk we show our insights and positive outcomes on the migration of a popular open source eCommerce platform (Magento) to MongoDB. The talk covers interesting migration challenges and techniques both from a data and software point of view.
This is a C# project . I am expected to create as this image shows. .pdfindiaartz
This is a C# project . I am expected to create as this image shows. If the image isnot clearly
showing , it\'s the Chegg\'s system. Please , if you see it quit long, assist me with the starting and
hinting bulltes point or functions that may simplify. Thannks...
The design of the Calculator form
Operation
· To clear the contents of memory, the user clicks the MC button. To save the value that’s
currently displayed in memory, the user clicks the MS button. To recall the value that’s currently
in memory and display it in the calculator, the user clicks the MR button. And to add the value
that’s currently displayed to the value in memory, the user clicks the M+ button.
· An M is displayed in the box above the MC button whenever the memory contains a value.
· See project 12-1 for additional details.
Specifications
· Create a class named MemoryCalculator that inherits the Calculator class described in
project 12-1. The MemoryCalculator class should add properties and methods as needed to
implement the memory function.
Note:
· MemoryCalculator class design:
Method Description
MemoryStore Stores the calculator’s current value in memory.
MemoryRecall Sets the calculator’s current value to the value stored in memory.
MemoryAdd Adds the calculator’s current value to the value currently stored in
memory.
MemoryClear Clears the current memory value.
Solution
Calculator.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Calculator
{
public class Calculator
{
public decimal currentValue;
private decimal operand1;
public decimal operand2;
private Operator op;
public enum Operator { Addd, Subtract, Multiply, Divide, None };
//Needed to be changed from private to public
public Calculator()
{
this.currentValue = 0;
this.operand1 = 0;
this.operand2 = 0;
this.op = Operator.None;
}
public decimal CurrentValue
{
get { return this.currentValue; }
}
public void Clear()
{
this.currentValue = 0;
this.operand1 = 0;
this.operand2 = 0;
this.op = Operator.None;
}
public void Add(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Addd;
}
public void Subtract(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Subtract;
}
public void Multiply(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Multiply;
}
public void Divide(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Divide;
}
public void Equals(decimal val)
{
operand2 = val;
switch (this.op)
{
case Operator.Addd:
currentValue = operand1 + operand2;
break;
case Operator.Subtract:
currentValue = operand1 - operand2;
break;
case Operator.Multiply:
currentValue = operand1 * operand2;
break;
case Operator.Divide:
//Try catch to prevent dividing by zero
try
{
currentValue = operand1 / operand2;
}
catch (DivideByZeroException)
{
MessageBox.Show(\"You cannot divide by zero\", \"Error!\");
}
break;
case Opera.
For Beginners
Demo Projects:
• Employee Information Form (Using advance controls)
What will you learn?
• Using following controls:
o Masked Textbox
o Multiline Textbox
o ComboBox, ListBox, CheckBoxList
o DateTimePicker
o NumericUpDown
o RadioButton
• Adding Items to ComboBox, ListBox and CheckBoxList Statically and Dynamically
• Enabling Autocomplete feature in ComboBox
• Getting Selected items form ComboBox, ListBox and CheckBoxList
• Clearing or resetting all these controls to default values.
[Quantum Mechanics] In my class we are talking about the quantum har.pdfhardjasonoco14599
[Quantum Mechanics] In my class we are talking about the quantum harmonic oscillator and I
have a question.
Does parity have a generator? If so, what is it? If not, how is the condition of parity symmetry
expressed in terms of the operators?
Solution
The parity transformation, P, is a unitary operator, acting on a state as follows: P(r) = ei/2(r).
Also, P2(r) =ei(r), since an overall phase is unobservable. The operatorP2, which reverses the
parity of a state twice, leaves the spacetime invariant, and so is an internal symmetry which
rotates its eigenstates by phasesei. IfP2is an elementeiQof a continuous U(1) symmetry group of
phase rotations, theneiQ/2is part of this U(1) and so is also a symmetry. We can defineP=PeiQ/2,
which is also a symmetry, and so we can choose to callPour parity operator, instead ofP. Note
thatP2= 1 and soPhas eigenvalues ±1. However, when no such symmetry group exists, it may be
that all parity transformations have some eigenvalues which are phases other than ±1..
Write a function which return a list of all of the n element subset .pdfhardjasonoco14599
Write a function which return a list of all of the n element subset of a given set
Implement in JAVA Question 3 Write a function that returns a list of all of the n-element subsets
of a given set. For example, if the given set is [1,2,3] and n is 2, then the returned list should
contain [1,2], [1,3], and [2,3]. The order of the elements is not important.
Solution
The program for this problem is as follows:
Comments are included in the program for explaining the steps.
A sample output is attached below the program.
package com.temp;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Program to find sublists of a list.
* @author Rohit Phatak
*
*/
public class subset {
/**
* This list will contain the resultant sublists.
*/
static List list = new ArrayList<>();
public static void main(String arg[]){
/**
* Input a list comma separated.
*/
System.out.println(\"Enter a list : \");
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
String[] sArr = s.split(\",\");
/**
* Input a value of n.
*/
System.out.println(\"Enter value of n : \");
Integer n = scanner.nextInt();
/**
* Check if value of n is greater than entered list.
*/
if(sArr.length < n){
System.out.println(\"Length of list is less than value of n\");
} else if(sArr.length > 0){
getSubsetList(sArr,n);
System.out.println(\"List is as :\");
/**
* Printing the sublists.
*/
for(String[] str : list){
String printVar = \"\";
for(String temps : str)
printVar+=temps+\",\";
System.out.println(\"[\"+printVar.substring(0, printVar.length()-1)+\"]\");
}
} else {
System.out.println(\"Please enter atleast one element:\");
}
scanner.close();
}
/**
* This method calls the recursive function which is used to obtain the sublists.
* @param sArr
* @param n
* @return
*/
public static List getSubsetList(String[] sArr,Integer n){
List lista = new ArrayList<>();
sublist(sArr, 0, n, new String[n]);
return lista;
}
/**
* This is a recursive function.
* This function will iterate over itself for finding the sublist.
*
* Parameters are as follows:
*
* @param arr -> List entered by the user.
* @param n -> Value of sublist entered by user.
* @param startPosition -> index to start creating the sublist.
* @param result -> resultant sublist
*/
public static void sublist(String[] arr, int startPosition, int n, String[] result){
/**
* Check for the value of n ==0.
* If n==0 break from the recursion.
*/
if (n == 0){
/**
* Add the sublist \'result\' in the list.
*/
list.add(result.clone());
return;
}
/**
* Iterate through for loop starting from startPosition till length of list minus entered value
n.
*/
for (int i = startPosition; i <= arr.length-n; i++){
/**
* Here result is a temporary sublist.
* This for loop adds an element to the temporary sublist in each iteration.
* The element is added from the complete list entered by user.
* Location of element is iTh index.
*/
result[result.length - n] = arr[i];
/**
* After adding the element to the temporary sublist, the sublist an.
More Related Content
Similar to I finished most of the program, but having trouble with some key fea.pdf
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.
Header file for an array-based implementation of the ADT bag. @f.pdfsudhirchourasia86
/** Header file for an array-based implementation of the ADT bag. @file ArrayBag.h */
#ifndef _ARRAY_BAG
#define _ARRAY_BAG
#include \"BagInterface.h\"
template class ArrayBag : public BagInterface
{
private:
static const int DEFAULT_CAPACITY = 6; // Small size to test for a full bag
ItemType items[DEFAULT_CAPACITY]; // Array of bag items
int itemCount; // Current count of bag items
int maxItems; // Max capacity of the bag
// Returns either the index of the element in the array items that // contains the given target or -1,
if the array does not contain // the target.
int getIndexOf(const ItemType& target) const;
public:
ArrayBag();
int getCurrentSize() const;
bool isEmpty() const;
bool add(const ItemType& newEntry);
bool remove(const ItemType& anEntry);
void clear();
bool contains(const ItemType& anEntry) const;
int getFrequencyOf(const ItemType& anEntry) const;
vector toVector() const;
}; // end ArrayBag
//#include \"ArrayBag.cpp\" // /** Implementation file for the class ArrayBag. @file
ArrayBag.cpp */
#include \"ArrayBag.h\"
#include template
ArrayBag::ArrayBag(): itemCount(0), maxItems(DEFAULT_CAPACITY)
{ } // end default constructor
template int ArrayBag::getCurrentSize() const { return itemCount; } // end getCurrentSize
template bool ArrayBag::isEmpty() const { return itemCount == 0; } // end isEmpty
template bool ArrayBag::add(const ItemType& newEntry)
{
bool hasRoomToAdd = (itemCount < maxItems);
if (hasRoomToAdd)
{
items[itemCount] = newEntry; itemCount++;
} // end if return hasRoomToAdd;
} // end add
/* // STUB template bool ArrayBag::remove(const ItemType& anEntry) { return false; // STUB
} // end remove
*/ template bool ArrayBag::remove(const ItemType& anEntry)
{
int locatedIndex = getIndexOf(anEntry);
bool canRemoveItem = !isEmpty() && (locatedIndex > -1);
if (canRemoveItem)
{
itemCount--;
items[locatedIndex] = items[itemCount];
} // end if return
canRemoveItem;
} // end remove /*
// STUB template void ArrayBag::clear() { // STUB } // end clear
*/ template void ArrayBag::clear() { itemCount = 0; } // end clear
template int ArrayBag::getFrequencyOf(const ItemType& anEntry) const
{
int frequency = 0;
int curIndex = 0; // Current array index
while (curIndex < itemCount)
{
if (items[curIndex] == anEntry)
{
frequency++;
} // end if
curIndex++; // Increment to next entry
} // end while
return frequency;
} // end getFrequencyOf
template bool ArrayBag::contains(const ItemType& anEntry) const
{
return getIndexOf(anEntry) > -1;
} // end contains
/* ALTERNATE 1: First version
template bool ArrayBag::contains(const ItemType& target) const
{
return getFrequencyOf(target) > 0;
} // end contains
// ALTERNATE 2: Second version
template bool ArrayBag::contains(const ItemType& anEntry) const
{
bool found = false;
int curIndex = 0; // Current array index
while (!found && (curIndex < itemCount))
{
if (anEntry == items[curIndex])
{
found = true;
} // end if
curIndex++; // Increment to next entry
} // end while
return found;
} // end contains
*/ temp.
Amusement Park Programming ProjectProject Outcomes1. Use the Jav.docxcullenrjzsme
Amusement Park Programming Project
Project Outcomes
1. Use the Java selection constructs (if and if else).
2. Use the Java iteration constructs (while, do, for).
3. Use Boolean variables and expressions to control iterations.
4. Use arrays or ArrayList for storing objects.
5. Proper design techniques.
Project Requirements
Your job is to implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop. The information system consists of three classes including a class to model tickets, a class to model gift shop merchandise, the amusement park, and the amusement park tester. The gift shop supports access to specific merchandise in the park’s gift shop and to purchase the merchandise or to order new merchandise for the gift shop. The UML diagram for each class (except the tester class) is given below.
1) Develop a simple class that models admission tickets. Each admission is described by several instance fields:
a. A ticket number as a long integer to identify the unique ticket,
b. A ticket category represented as a String to store the category of the ticket (i.e. adult, child, senior),
c. A ticket holder represented as a String to store the name of the person who purchased the ticket,
d. A date represented as a Date to store the admission date for the ticket,
e. A price represented as a double to store the price of the ticket,
f. A purchase status represented as a boolean to indicate if the ticket has been purchased (or is reserved).
Ticket
-number : long
-category : String
-holder : String
-date : Date
-price : double
In addition to these fields, the class has the following constructors and
methods:
a. A parameterized constructor that initializes the attributes of a ticket.
b. setPrice(double price) to change the price of a textbook.
c. changePurchaseStatus(boolean newStatus) to change the
purchase status of the ticket.
d. Accessor methods for all instance fields.
e. toString() to return a neatly formatted string that contains all the
information stored in the instance fields.
2) Develop a simple class that models merchandise available in the gift shop
such as t-shirts, sweatshirts, and stuffed animals. The class has several
instance fields:
a. An ID as a long integer to identify the specific merchandise item,
b. A category as a String to store the specific type of merchandise,
c. A description as a String to store the description of the merchandise,
d. A price represented as a double to store the price of the merchandise,
e. An instock as a boolean to indicate if the merchandise is instock or onorder.
Valid values for category include "T-Shirt", "Sweatshirt", and "Stuffed Animal",
as well as any additional category you choose to support. If invalid values are
entered, an error message must be printed and the category instance field
must be set to "UNKNOWN".
In addition to these attributes, the class has the following constructors and
methods:
f. A parameterized constructor that initi.
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.
import entity.Product;
012.
import java.util.*;
013.
014.
/**
015.
*
016.
* author tgiunipero
017.
*/
018.
public category ShoppingCart
029.
030.
/**
031.
* Adds a <code>ShoppingCartItem</code> to the <code>ShoppingCart</code>\'s
032.
* <code>items</code> list. If item of the desired <code>product</code>
033.
* already exists in go-cart list, the number of that item is
034.
* incremented.
035.
*
036.
* param product the <code>Product</code> that defines the kind of go-cart item
037.
* see ShoppingCartItem
038.
*/
039.
public synchronised void addItem(Product product)
050.
}
051.
052.
if (newItem)
056.
}
057.
058.
/**
059.
* Updates the <code>ShoppingCartItem</code> of the desired
060.
* <code>product</code> to the desired amount. If \'<code>0</code>\'
061.
* is that the given amount, the <code>ShoppingCartItem</code> is removed
062.
* from the <code>ShoppingCart</code>\'s <code>items</code> list.
063.
*
064.
* param product the <code>Product</code> that defines the kind of go-cart item
065.
* param amount the amount that the <code>ShoppingCartItem</code> is updated to
066.
* see ShoppingCartItem
067.
*/
068.
public synchronised void update(Product product, String quantity) forged amount as short
073.
qty = Short.parseShort(quantity);
074.
075.
if (qty >= 0) {
076.
077.
ShoppingCartItem item = null;
078.
079.
for (ShoppingCartItem scItem : items) {
080.
081.
if (scItem.getProduct().getId() == product.getId()) {
082.
083.
if (qty != 0) {
084.
// set item amount to new price
085.
scItem.setQuantity(qty);
086.
} else {
087.
// if amount equals zero, save item and break
088.
item = scItem;
089.
break;
090.
}
091.
}
092.
}
093.
094.
if (item != null) take away from cart
096.
items.remove(item);
097.
}
098.
}
099.
}
100.
101.
/**
102.
* Returns the list of <code>ShoppingCartItems</code>.
103.
*
104.
* return the <code>items</code> list
105.
* see ShoppingCartItem
106.
*/
107.
public synchronised List<ShoppingCartItem> getItems()
111.
112.
/**
113.
* Returns the total of quantities for all things maintained in go-cart
114.
* <code>items</code> list.
115.
*
116.
* return the amount of things in go-cart
117.
* see ShoppingCartItem
118.
*/
119.
public synchronised int getNumberOfItems()
127.
128.
return numberOfItems;
129.
}
130.
131.
/**
132.
* Returns the total of the merchandise worth increased by the number for all
133.
* things in go-cart list. this is often the overall price excluding the surcharge.
134.
*
135.
* return the price of all things times their quantities
136.
* see ShoppingCartItem
137.
*/
138.
public synchronised double getSubtotal() quantity = 0;
141.
142.
for (ShoppingCartItem scItem : items)
147.
148.
return amount;
149.
}
150.
151.
/**
152.
* Calculates the overall price of the order. This methodology adds the subtotal to
153.
* the selected surcharge and sets the <code>total</code> instance variable
154.
* with the result.
155.
*
156.
* param surcharge the selected surcharge for all orders
157.
* see ShoppingCartItem
158.
*/
159..
I really need help with this Assignment Please in C programming not .pdfpasqualealvarez467
I really need help with this Assignment Please in C programming not C++ or C#, just C. Thank
you!
Hello , Choose please one of the following program types:
The assignment is to write a menu driven program that manages a small business inventory,
collection or list. You pick the topic. The focus of your program is up to you.
The Menu commands must include:
P....Display all records (on the screen/monitor) S....Create a current report (save it to a file)
A....Add a new entry
D....Delete an item from the list (inventory) C....Clear all records
Q...Quit
You must add (1) additional menu option that you choose. It may be a menu option that allows
the inventory to be modified. i.e. add inventory quantities, change price/cost, change dates, etc.
You will use structs and an array to organize the data in the program. Your struct must contain
at least the following kinds of information: o Minimum of 2 strings (character arrays)
Suggestions include: item name, manufacturer, etc o Minimum of 2 integers – 1 must be product
id
Product id, qty in stock o Minimum of 2 double values
Suggestions include: cost, price, average inventory:
When you add new item the program will ask the user for each of the fields on a separate line.
When you delete an item from inventory the program will ask you for the integer id of the entry
to be deleted, locate the entry in the array and remove all of the data for that entry. – The list
does not need to be sorted – to remove an entry, you may move the last item in the list to the
location of the deleted entry
When you display the records on the screen, all of the information stored for each entry will be
labeled and displayed.
Creating a current inventory report copies the current entries in the array to an output file. This
must include labeling all of the information so that it is clear what information is being provided.
Clearing the records deletes all of the information in the array.
When you add new item the program will ask the user for each of the fields on a separate line.
When you delete a question from the list, the program will ask you for the question id of the
entry to be deleted, locate the entry in the array and remove all of the data for that entry. – The
list does not need to be sorted – to remove an entry, you may move the last item in the list to the
location of the deleted entry
When you play the game, you must display the question, the possible answers and the point
value. If the player answers correctly the point value will be added to the game total. If answered
incorrectly, the correct answer will be displayed. Creating a current report copies the current
content of the question array to an output file. This must include labeling all of the information
so that it is clear what information is being provided.
Clearing all questions deletes all of the information in the array.
Instructions:
You should use at least 10 user-defined functions (plus main) to appropriately break the problem
up into smaller piece.
BELOW IS MY CODE FOR THIS ASSIGMENT BUT IT NOT WORKING WELL PLEASE H.pdfaminaENT
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.
Fixing Magento Core for Better Performance - Ivan ChepurnyiMeet Magento Spain
The performance optimization of Magento webshop, it is not only writing your module in the clean way, it is also optimization of core code.
During the session, you will learn how to deal with optimization of most common Magento bottlenecks at catalog, shopping cart and checkout pages.
Processing more than 10 orders per second, serving category, product and checkout pages within 800 milliseconds (and even less) without front cache is possible.
C++ help finish my code Phase 1 - input phase. Main reads the fi.pdfinfo189835
C++ help finish my code
Phase 1 - input phase. Main reads the file and populates one Grocery element in the array for
each input
record. This is a standard .txt file and is delimited by new line (\n) characters at the end of every
input record.
This allows you to use getline. See the Canvas assignment and copy the file named a4data.txt to
your
machine. Do not change the name of the file it must be a4data.txt. Assume that the input will be
correct.
The input record format is:
6 characters - item UPC
20 characters - item description
6 characters - cost (999.99 format)
6 characters - selling price (999.99 format)
3 characters - inventory on hand
1 character - status (o on order; d discontinued; s on shelf)
Use correct read loop logic as discussed in class.
There is no constructor. The Grocery array is statically allocated, so if there was a constructor, it
would be
executed when the array was first defined, once per element.
The maximum number of grocery items is 100, and youll need a counter to keep track of how
many there
actually are. Define that counter as a static variable in the Grocery class, and use it throughout
your code as
needed.
At the end of phase 1, main has built a set of Grocery objects.
Next, main should display all the Grocery objects to ensure that the array has been built
correctly. Examine
the input data and determine if your code is processing all the records, and each record correctly.
Display
them after you have processed the input file; do not list each object as its created within the read
loop. Use
some appropriate column formatting so that you can make sense of the output, and so that you
can verify
that the objects have all been created and populated correctly. At this point, there is no price
history data,
that will be added in the next phase. Your display should look something like this:
=====================================================================
=
UPC Description Cost Price Inventory Status
=====================================================================
=
123456 Peas, canned, 12 oz 1.23 1.89 100 s
234567 Tomatoes, sundried 2.25 3.75 25 s
345676 Pineapple, whole 2.99 4.25 0 o
Phase 2 Transaction processing phase. Main asks the console user for transactions. Use getline;
do
not use some other form of input. There are four different types of transactions. Assume the
transaction data
is valid (no error checking needed). There are four types of transactions:
D
Display a list of all Grocery items, one item at a time, something like this:
=====================================================================
=
UPC Description Cost Price Inventory Status
=====================================================================
=
123456 Peas, canned, 12 oz 1.23 1.89 100 s
Price history: 2021-03-17 1.11
2021-04-17 1.45
2022-06-14 1.89
234567 Tomatoes, sundried 2.25 3.75 25 s
Price history: 2021-03-17 1.98
2021-04-17 2.25
345676 Pineapple, whole 2.99 4.25 0 o
Price history: there is no price history for this item.
Migrating One of the Most Popular eCommerce Platforms to MongoDBMongoDB
Is it worthwhile to migrate a heavy SQL application to MongoDB? In this talk we show our insights and positive outcomes on the migration of a popular open source eCommerce platform (Magento) to MongoDB. The talk covers interesting migration challenges and techniques both from a data and software point of view.
This is a C# project . I am expected to create as this image shows. .pdfindiaartz
This is a C# project . I am expected to create as this image shows. If the image isnot clearly
showing , it\'s the Chegg\'s system. Please , if you see it quit long, assist me with the starting and
hinting bulltes point or functions that may simplify. Thannks...
The design of the Calculator form
Operation
· To clear the contents of memory, the user clicks the MC button. To save the value that’s
currently displayed in memory, the user clicks the MS button. To recall the value that’s currently
in memory and display it in the calculator, the user clicks the MR button. And to add the value
that’s currently displayed to the value in memory, the user clicks the M+ button.
· An M is displayed in the box above the MC button whenever the memory contains a value.
· See project 12-1 for additional details.
Specifications
· Create a class named MemoryCalculator that inherits the Calculator class described in
project 12-1. The MemoryCalculator class should add properties and methods as needed to
implement the memory function.
Note:
· MemoryCalculator class design:
Method Description
MemoryStore Stores the calculator’s current value in memory.
MemoryRecall Sets the calculator’s current value to the value stored in memory.
MemoryAdd Adds the calculator’s current value to the value currently stored in
memory.
MemoryClear Clears the current memory value.
Solution
Calculator.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Calculator
{
public class Calculator
{
public decimal currentValue;
private decimal operand1;
public decimal operand2;
private Operator op;
public enum Operator { Addd, Subtract, Multiply, Divide, None };
//Needed to be changed from private to public
public Calculator()
{
this.currentValue = 0;
this.operand1 = 0;
this.operand2 = 0;
this.op = Operator.None;
}
public decimal CurrentValue
{
get { return this.currentValue; }
}
public void Clear()
{
this.currentValue = 0;
this.operand1 = 0;
this.operand2 = 0;
this.op = Operator.None;
}
public void Add(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Addd;
}
public void Subtract(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Subtract;
}
public void Multiply(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Multiply;
}
public void Divide(decimal val)
{
this.operand1 = val;
this.currentValue = val;
this.op = Operator.Divide;
}
public void Equals(decimal val)
{
operand2 = val;
switch (this.op)
{
case Operator.Addd:
currentValue = operand1 + operand2;
break;
case Operator.Subtract:
currentValue = operand1 - operand2;
break;
case Operator.Multiply:
currentValue = operand1 * operand2;
break;
case Operator.Divide:
//Try catch to prevent dividing by zero
try
{
currentValue = operand1 / operand2;
}
catch (DivideByZeroException)
{
MessageBox.Show(\"You cannot divide by zero\", \"Error!\");
}
break;
case Opera.
For Beginners
Demo Projects:
• Employee Information Form (Using advance controls)
What will you learn?
• Using following controls:
o Masked Textbox
o Multiline Textbox
o ComboBox, ListBox, CheckBoxList
o DateTimePicker
o NumericUpDown
o RadioButton
• Adding Items to ComboBox, ListBox and CheckBoxList Statically and Dynamically
• Enabling Autocomplete feature in ComboBox
• Getting Selected items form ComboBox, ListBox and CheckBoxList
• Clearing or resetting all these controls to default values.
Similar to I finished most of the program, but having trouble with some key fea.pdf (20)
[Quantum Mechanics] In my class we are talking about the quantum har.pdfhardjasonoco14599
[Quantum Mechanics] In my class we are talking about the quantum harmonic oscillator and I
have a question.
Does parity have a generator? If so, what is it? If not, how is the condition of parity symmetry
expressed in terms of the operators?
Solution
The parity transformation, P, is a unitary operator, acting on a state as follows: P(r) = ei/2(r).
Also, P2(r) =ei(r), since an overall phase is unobservable. The operatorP2, which reverses the
parity of a state twice, leaves the spacetime invariant, and so is an internal symmetry which
rotates its eigenstates by phasesei. IfP2is an elementeiQof a continuous U(1) symmetry group of
phase rotations, theneiQ/2is part of this U(1) and so is also a symmetry. We can defineP=PeiQ/2,
which is also a symmetry, and so we can choose to callPour parity operator, instead ofP. Note
thatP2= 1 and soPhas eigenvalues ±1. However, when no such symmetry group exists, it may be
that all parity transformations have some eigenvalues which are phases other than ±1..
Write a function which return a list of all of the n element subset .pdfhardjasonoco14599
Write a function which return a list of all of the n element subset of a given set
Implement in JAVA Question 3 Write a function that returns a list of all of the n-element subsets
of a given set. For example, if the given set is [1,2,3] and n is 2, then the returned list should
contain [1,2], [1,3], and [2,3]. The order of the elements is not important.
Solution
The program for this problem is as follows:
Comments are included in the program for explaining the steps.
A sample output is attached below the program.
package com.temp;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Program to find sublists of a list.
* @author Rohit Phatak
*
*/
public class subset {
/**
* This list will contain the resultant sublists.
*/
static List list = new ArrayList<>();
public static void main(String arg[]){
/**
* Input a list comma separated.
*/
System.out.println(\"Enter a list : \");
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
String[] sArr = s.split(\",\");
/**
* Input a value of n.
*/
System.out.println(\"Enter value of n : \");
Integer n = scanner.nextInt();
/**
* Check if value of n is greater than entered list.
*/
if(sArr.length < n){
System.out.println(\"Length of list is less than value of n\");
} else if(sArr.length > 0){
getSubsetList(sArr,n);
System.out.println(\"List is as :\");
/**
* Printing the sublists.
*/
for(String[] str : list){
String printVar = \"\";
for(String temps : str)
printVar+=temps+\",\";
System.out.println(\"[\"+printVar.substring(0, printVar.length()-1)+\"]\");
}
} else {
System.out.println(\"Please enter atleast one element:\");
}
scanner.close();
}
/**
* This method calls the recursive function which is used to obtain the sublists.
* @param sArr
* @param n
* @return
*/
public static List getSubsetList(String[] sArr,Integer n){
List lista = new ArrayList<>();
sublist(sArr, 0, n, new String[n]);
return lista;
}
/**
* This is a recursive function.
* This function will iterate over itself for finding the sublist.
*
* Parameters are as follows:
*
* @param arr -> List entered by the user.
* @param n -> Value of sublist entered by user.
* @param startPosition -> index to start creating the sublist.
* @param result -> resultant sublist
*/
public static void sublist(String[] arr, int startPosition, int n, String[] result){
/**
* Check for the value of n ==0.
* If n==0 break from the recursion.
*/
if (n == 0){
/**
* Add the sublist \'result\' in the list.
*/
list.add(result.clone());
return;
}
/**
* Iterate through for loop starting from startPosition till length of list minus entered value
n.
*/
for (int i = startPosition; i <= arr.length-n; i++){
/**
* Here result is a temporary sublist.
* This for loop adds an element to the temporary sublist in each iteration.
* The element is added from the complete list entered by user.
* Location of element is iTh index.
*/
result[result.length - n] = arr[i];
/**
* After adding the element to the temporary sublist, the sublist an.
what is tax preferenceSolutionTax preferences are measures of .pdfhardjasonoco14599
what is tax preference
Solution
Tax preferences are measures of the government under which different items are exempted from
paying taxes. Tax preference items are that type of income that are tax free and hence triggers
AMT (alternative minimum tax) for the taxpayers.
Examples of tax preference items are deductions for accelerated depreciation, excess intangible
drilling costs, capital gains from exercise of stocks etc.
Tax preference items are added to the AMT..
Which of the following is true regarding homologous structuresA. .pdfhardjasonoco14599
Which of the following is true regarding homologous structures?
A. They have similar morphologies despite the possibility of having different functions
B. They are inherited from a common ancestor
C. Vertebrate forelimbs are homologous and provide evidence for descent with modification
D. Only A and B
E. A, B, and C
Solution
Answer E. Homologous structure evolved from common ancestor example forelimbs of humans
and bat . Hence answer e is correct..
Why is it reasonable to assume that Venus, Earth, and Mars started w.pdfhardjasonoco14599
Why is it reasonable to assume that Venus, Earth, and Mars started with roughly the same
primordial atmospheres?
Solution
Earth, Venus, and Mars all formed from the same material found in the Solar Nebula, but the
origin of the atmospheres was the volcanic outgassing of H2O, CO2, SO2, and N2. Since
volcanic activity was important on all three planets early in their evolution, Hence their
primordial atmospheres should have been very similar..
Which of the following is NOT a complication in development of an HIV.pdfhardjasonoco14599
Which of the following is NOT a complication in development of an HIV vaccine? Virus
attacks an important component of the immune system that is needed to create the immune
response to the virus Viral proteins do not trigger an immune response. Diversity of the virus
throughout the world, or even within a single person Short time from entry of the virus into a
human and the virus\' fusion with CD4 cells. Which of the following is NOT a target of current
HIV antiviral drugs? Fusion of the virus to CD4 cells The reverse transcriptase that copies viral
RNA into DNA Excision of the viral DNA from the human chromosomes. Protease involved in
maturation of the viral particle Which of the following is NOT true concerning home testing for
HIV infection? It tests for antibodies to the HIV virus The results are expressed as a viral load.
It can give many false positives (a positive test when the person is not HIV-positive) It is
relatively expensive (about $40)
Solution
Q.No 1
short time from entry of the virus into a human and the virus fusion with CD4 cells
Q.No 2
Excision of the viral DNA from human chromosome
Q.No 3
The results are expressed as viral load
HIV stands for human immunodeficiency virus. If left untreated, HIV can lead to the disease
AIDS (acquired immunodeficiency syndrome). HIV attacks the body\'s immunity system,
specifically the CD4 cells (T cells), which help the immune system fight off infections. If left
untreated, HIV reduces the amount of CD4 cells (T cells) in the body, making the person more
prone to get infections or infection-related cancers. With time, HIV can destroy so many of these
cells that the body can\'t fight off infections and disease..
Write a C++ program that implements a binary search tree (BST) to man.pdfhardjasonoco14599
Write a C++ program that implements a binary search tree (BST) to manage a number of integer
items with different priorities. In order to do so. you will need to maintain a queue as an item in
the tree. Each queue item is an integer. All items in a given queue will have the same priority. As
a new item with a user-specified priority comes in, it should be enqueued in the queue with items
of that priority. A new queue may need to created in case a queue with that priority does not
exist. Use dynamic memory to manage nodes in the queue and BST. Implement the following:
Constructor. Destructor. Overloaded copy constructor. Overloaded assignment operator.
Overloaded \"==\" operator to check if two trees are equal. A tree t1 is equal to t2 if for every
queue in t1, a corresponding queue with the same priority exists in t2 with the same set of
elements (the order of the elements in the queue docs not matter). Overloaded \"
Solution
program using namespace std;
#define width_unit 5
class BStree
{
private:
class Node
{
public:
int data;
Node *left, *right;
Node(int d=0)
:data(d), left(NULL), right(NULL) {}
};
Node *root;
Node * trav(int, Node * &);
void chop(Node * N);
void copy(Node * N);
void print(ostream &, Node *, int) const;
void print(Node *, int) const;
public:
BStree(void);
~BStree(void);
bool find(int);
void insert(int);
void remove(int);
bool empty(void) const;
Tree(const BStree &);
const BStree & operator=(const BStree &);
friend ostream & operator<<(ostream &, const BStree &);
};
BStree::BStree(void)
{
root=NULL;
}
bool Tree::empty(void) const
{
return !root;
}
BStree::Node * BStree::trav(int foo, Node * & par)
{
Node * curr=root;
par=NULL;
while(curr && curr->data != foo)
{
par=curr;
if(foo < curr->data)
curr=curr->left;
else
curr=curr->right;
}
return curr;
}
bool BStree::find(int foo)
{
Node * par=NULL;
Node * curr=trav(foo, par);
return curr;
}
void BStree::insert(int foo)
{
Node * par=NULL;
Node * curr=trav(foo,par);
if(!curr)
{
curr= new Node(foo);
if(!par)
root=curr;
else if(foo < par->data)
par->left=curr;
else
par->right=curr;
}
}
void BStree::remove(const int foo)
{
Node * par=NULL;
Node * curr=trav(foo,par);
if(curr)
{
if(curr->left && curr->right)
{
Node * tmp=curr;
par=curr;
curr=curr->left;
while(curr->right)
{
par=curr;
curr=curr->right;
}
tmp->data=curr->data;
}
Node *tmp=(curr->left ? curr->left : curr->right);
if(!par)
root=tmp;
else if(par->data < curr->data)
par->right=tmp;
else
par->left=tmp;
delete curr;
}
}
void BStree::chop(Node *N)
{
if(N)
{
chop(N->left);
chop(N->right);
delete N;
}
}
BStree::~BStree(void)
{
chop(root);
}
BStree::BStree(const BStree & T)
{
root=NULL;
copy(T.root);
}
void BStree::copy(Node * N)
{
if(N)
{
insert(N->data);
copy(N->left);
copy(N->right);
}
}
const BStree & BStree::operator=(const BStree & T)
{
if(this != &T)
{
chop(root);
root=NULL;
copy(T.root);
}
return *this;
}
void BStree::print(ostream & ost, Node * curr, int level) const
{
if(curr)
{
print(ost,curr->right,level+1);
ost<data<le.
Which of the following groups is responsible for the actual developm.pdfhardjasonoco14599
Which of the following groups is responsible for the actual development of new standards and
protocols such as RFC 1087.
A. IESG
B. ISOC
C. IAB
D. IETF
Solution
D. The actual development of new standards and protocols for the Internet is carried out by
working groups chartered by the IETF. Answers A, B, and C are incorrect..
Whats the role of the gastric caeca in a grasshopperSolutionGr.pdfhardjasonoco14599
Whats the role of the gastric caeca in a grasshopper
Solution
Grasshoper: Insects of the suborder Caelifera within the order Orthoptera.
Role of the gastric caeca in a grasshopper:
Gastric caeca are finger-like projections of the digestive tract found in many insects. These
pouches extend from the mid-gut and contain protozoa or bacteria that aid digestion,Gastric
caeca increase the surface area in the digestive tract increasing digestive enzyme secretion and
nutrient absorption.The gastric caeca project at the transition from foregut to mid-gut.
Insects feeding on difficult to digest materials, pouches called gastric caeca arise in the front of
the midgut. Each gastric caecum often contains protozoa and/or bacteria that aid in digestion..
what does it takes to be a living organ What does it take to be a l.pdfhardjasonoco14599
what does it takes to be a living organ? What does it take to be a living organism? Living things
share 8 characteristics that are listed in Chapter 1 of your textbook on page 19 Think of an
organism or cell in which all 8 characteristics are not obvious for example, coral looks like it
does not move, red blood cells do not reproduce and have no DNA. frogs freeze in the winter
therefore it seems as if they do not maintain homeostasis, and so on Focus your discussion on the
following Make comparisons between living things and nonliving things that have some of the
characteristics that define life Compare the following pairs and explain what the differences are
using the 8 criteria A rock to a snail A rock to a tree A dog to a TV Explain why electricity is
sometimes called line, or discuss some of the characteristics fire shares with living things (it can
grow, it metabolizes, and so on)
Solution
The 8 characteristics of living organisms are:
These 8 traits are generally used to classify organisms are either living or non-living. Things that
do not exhibit all 8 traits are scientifically classified as non-living. However, there are many
classified living things that do not visibly show all 8 characteristics. For example, trees are made
of cells, grow, evolve, reproduce, etc, but they do not physically move. Bacteria and other single
celled organisms do not show different levels of cellular organization. In ant colonies, only the
queen reproduces, yet even the non-reproducing worker ants are considered living. Viruses are
another hotly debated topic, as scientists continue to argue if they are living or non-living. While
outside the host body they may seem dead, when they enter the host they stir to life, using the
host\'s cellular machinery to reproduce, grow, assemble themselves before destroying the cell
and continuing the infection.
Sometimes, even non-living things seem to share a few traits of living things. For example,
icicles may be non-living, but in cold weather they can visibly \'grow\' as water freezes and the
icicle expands in size.
Comparing the following pairs:
Electricity and fire are often termed \'alive\' due to their behaviour, however, they are forms of
energy, not living organisms. Uncontrollable electricity is often termed \'live\', it travels through
conductive materials, it can even reproduce by distributing energy along various paths as it
travels. Similarly, fire, when provided with the right materials, can grow and spread. It
metabolizes fuel to maintain itself, and its movement and growth can be altered in response to
external stimuli. However, neither electricity nor fire consist of cells, nor do they evolve, and
being forms of energy, they cannot maintain homeostasis. Thus, they are classified as non-living..
ve targets. ball and sodket hinge joint condyloid joint saddle jo.pdfhardjasonoco14599
ve targets. ball and sodket hinge joint condyloid joint saddle joint Ch 05 HW Ch 08 HW pivot
joint
Solution
Ball and socket joint is between humerus and scapula.
Hinge joint is between the humerus of the upper arm and the ulna and radius of the forearm.
Pivot joint : Pivot joints allow for rotation, which can be external (for example when rotating an
arm outward), or internal (as in rotating an arm inward).Example is proximal and distal
radioulnar joint
Condyloid joint : Oval shaped condyle of one bone fits into elliptical cavity of other bone. These
joints allow biaxial movements i.e. forward-backward and side to side but not rotation. Example
is the wrist joint.
Saddle joint : The carpometacarpal joint of the thumb makes the human thumb opposable by
allowing it to move across the palm to contact the other four fingers of the hand.
Plane joint :Plane joints permit sliding movements in the plane of articular surfaces.
This one is for you - assume that this pedigree shows the inheritance.pdfhardjasonoco14599
This one is for you - assume that this pedigree shows the inheritance of a rare autosomal
condition. Note that the father (II-4) is a known carrier and that this couple has had 3 normal
children. What is the probability that she is a carrier?
Solution
The disease is rare autosomal. In other words it is autosomal recessive disorder. Now the male
and female in II-1 and II-2 have disease. Lets call their genotype as \"aa\". But Their parents in I
generation are normal. This means they are carriers of the disease with genotype Aa and Aa.
Their third daughter II-3 has no disease, Her genotype can be Aa or AA, so probability to carry a
recessive allee a is 1/2. If she had had a diseased child, her genotype would have been Aa with
100%probability. But as has all healthy kids, probability of her being carrier is 1/2..
There are 7 people in the elevator in a 10-story building. They are .pdfhardjasonoco14599
There are 7 people in the elevator in a 10-story building. They are allequally likely to exit on any
oor and they are independent of each other.What is the probability that 3 of them will exit on one
oor, 2 on another,and the last two on two dierent oors.
Solution
As the events are independent, probability can be calculated as below.
P(3)=3/7=0.43 that is 3 people exit on floor floor
P(2)=2/7=0.29 that is 2 people exit on another floor
P(1)=1/7=0.14 that is probability of last two person each who will exit on different floors.
Here events are independent so events are not affected by previous events and so we have
calculated probability for each one of them with same n=7..
safety Construction Safety-Quiz 1 According to OSHA, what must man.pdfhardjasonoco14599
safety Construction Safety-Quiz 1 According to OSHA, what must management provide for their
workers/employees? When and for what reason does OSHA require an employer to provide a
certified first aid responder on a construction site 1926 as compared to 1910? are moving signs,
provided by workers, such as flaggers, or devices, such as flashing lights, to warn of possible
existing hazards. ASHA are the warnings of hazard, temporarily or permanently affixed or
placed, at a person approved or assigned by the employer to perform a specific type of one who,
by possession of a recognized degree, certificate, or professional locations where hazards exist.
duty or to be at a specific location at a jobsite. standing......has successfully demonstrated his/her
ability to solve problems relating to the Name the four parts of a Safety and Health program:
Name to three type of citations OSHA issues to standards?Alashi What does the OSHA standard
5a1 cover or réter to Sape s that are non-compliant with OSHA harka to companies that fail to
comply with their standards. 18. OSHA issues 2 Discuss Direct and Indirect Costs involving an
employee injury/accident . What are the 4 elements of OSHA\'s Focus Four policy and discuss
what companies are required to have in place in order to qualify for a Focus 4 inspection as
compared to a comprehensive (wall to wall) project inspection. asing mo
Solution
Answer1. Under the OSHA law, employers have a responsibility to provide a safe workplace.
Provide a workplace free from serious recognized hazards and comply with standards, rules and
regulations issued under the OSHA Act.
Examine workplace conditions to make sure they conform to applicable OSHA standards.
Make sure employees have and use safe tools and equipment and properly maintain this
equipment.
Provide medical examinations and training when required by OSHA standards and many other
OSHA standards.
Answer2. OSHA\'s standard for first aid training at Construction site
In the absence of an infirmary, clinic, or hospital in near proximity to the workplace which is
used for the treatment of all injured employees, a person or persons shall be adequately trained to
render first aid. Adequate first aid supplies shall be readily available.
The primary requirement addressed by these standards is that an employer must ensure prompt
first aid treatment for injured employees, either by providing for the availability of a trained first
aid provider at the worksite, or by ensuring that emergency treatment services are within
reasonable proximity of the worksite.
Answer3. The OSHA standards are divided into four major categories based on the type of work
being performed:agriculture(1928), construction (Part 1926), general industry (Part 1910) and
maritime (Part 1918).
The construction standard states that fall protection is required when an employee is working on
a walking/working surface (horizontal and vertical surface) with an unprotected side or edge
which is six feet or more a.
Question 1 A ____________ is an intelligent device that controls the.pdfhardjasonoco14599
Question 1 A ____________ is an intelligent device that controls the flow or transmissions in
and out of a network. A. bridge B. gateway C. router D. switch 2.5 points
Question 2 A _____________________ provides a physical address to a device because it has a
unique ID written on a chip that is mounted in the card. A. network interface card B. sound card
C. repeater D. physical cable 2.5 points
Question 3 What type of network connects devices in a limited geographical area? A. MAN B.
LAN C. WAN D. PAN 2.5 points
Question 4 Each computer attached to a network or the Internet has a unique address called a(n)
________. A. local address B. IP address C. network address D. Internet address 2.5 points
Question 5 In February of 2011 the Internet Assigned Number Authority (IANA) assigned the
last block of IPv4 addresses. What is the new address standard? A. IPV5 B. IPv6 C. IPv7 D.
DARPA
Solution
Answer 1. A Router is an intelligent device that controls the flow or transmissions in and out of a
network.
the correct option is C. Router
Answer 2. A network interface card provides a physical address to a device because it has a
unique ID written on a chip that is mounted in the card.
the correct option is A. network interface card
Answer 3. What type of network connects devices in a limited geographical area?
Answer is LAN. option B. LAN
Answer 4. Option B. IP address
Answer 5. IPv6 option B..
In sliding window protocol the left wall of the sender sliding winod.pdfhardjasonoco14599
In sliding window protocol the left wall of the sender sliding winodow movws to the _____
when it ___ a data.
A.) right; receives
B.) right; sends
C.) left; receives
D.) left; sends
Solution
ans is A
In sliding window protocol the left wall of the sender sliding winodow movws to the __right___
when it _receives__ a data.
In mice, the black allele (B) is dominant to the recessive white all.pdfhardjasonoco14599
In mice, the black allele (B) is dominant to the recessive white allele (b). Two black mice of
unknown genotype are mated to each other, resulting in 6 black and 1 white . What is the
genotype of the mother?
Solution
Answer: genotype of the mother = Bb
Explanation:
The only possible genotype for parents are
P1: Bb (Black Mouse) X Bb (Black Mouse)
F1: BB (Black), Bb(Black), Bb(black), bb(Black).
How will the rate of diffusion of an interstitial i Impurity atom Inc.pdfhardjasonoco14599
How will the rate of diffusion of an interstitial i Impurity atom Increases? CIRCLE THE BEST
ANSWER Increase Decrease The rate of diffusion will be unaffected by changes In the size of
the impurity species. impurity species change as the size of the impurity species.
Solution
The rate of diffusion will decrease as the size of the impurity atoms increases because greater the
size of impurity atoms greater will be the difficulty in accomodating the impurity atoms at
interstitial sites and also larger size will decrease its mobility and provide hindrance during its
movement from one site to another. all these factors contribute in decrease in rate of diffusion..
Let R be an integral domain. Prove 1R and -1R are the only units of .pdfhardjasonoco14599
Let R be an integral domain. Prove 1R and -1R are the only units of R that are equal to their own
multiplicative inverses. Tip: Consider the equation x2 - 1R = 0R.
Solution
If x is its own inverse then
x^2-1 =0
(x-1)(x+1)=0
But, x is in R which is a domain
HEnce,
x-1=0 or x+1=0 as there are no zero divisors in R an integral domain
So, x=1 or -1.
Kevin Keller’s aunt’s husband and his girl cousin have died of heart.pdfhardjasonoco14599
Kevin Keller’s aunt’s husband and his girl cousin have died of heart attacks, but his mother,
sister, and brother are fine. Lisa Keller’s uncle is fine, but her aunt had multiple miscarriages
before she died. Her mother suffered from deep vein thrombosis, and her grandfather died of a
heart attack. Recall that Lisa has a brother with hemophilia C and an unaffected sister. Lisa and
Kevin Keller are husband and wife.
A) Create a pedigree diagramming these relationships.
B) Who do you think is more likely to carry the Factor V Leiden mutation?
Kevin Keller
Lisa Keller
Both
C) Looking at the Kellers and Morrisons, is it possible that Kevin Keller had an affair with
Cynthia Morrison and is Diana Morrison’s biological father? Show work.
D) What do you think happened with the Morrison’s and Keller’s when Olivia and Diana were
young? Lisa Keller Kevin Keller Cynthia Morrison Mr. Morrison O+ B+ Diana Morrison Olivia
Keller O- A+
Solution
B). Lisa killer carries the factor V Leiden mutation because her mother suffered from deep vein
thrombosis. Since this factor V Leiden mutation is a inherited genetic disorder of blood clotting,
this mutation is carried from mother to her child (Lisa).
C). Yes, the diagram is clearly showing that Kevin Keller had an affair with Cynthia morrison
and Diana Morrison\'s biological father because Diana Morrison has A+ blood group but none of
her parents is having A genotypic allele in their blood group, Whereas it is inherited from Lisa
Kellers..
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
I finished most of the program, but having trouble with some key fea.pdf
1. I finished most of the program, but having trouble with some key features. I bolded and italicized
the parts I can't figure out, and included them below. I included my code at the bottom. Thanks!
1. I can't get my RemoveItem() and ModifyItem() functions to work.
2. GetNumItemsInCart() is returning the wrong value. For example, my cart has 5 chocolate chip
cookies, 1 headphone, and 2 sneakers. GetNumItemsInCart() returns 3 instead of 8 when I output
my shopping cart.
3. When PrintDescriptions() is called, the first letter of my item description is missing. For
example, for the chocolate chip cookies, the description is Semi-sweet. When PrintDescriptions()
is called, it returns emi-sweet, with the S gone.
4. Shopping Cart improperly initialized with default constructor , and I don't know why.
12.9 Program: Online shopping cart (continued) (C++)
This program extends the earlier "Online shopping cart" 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"
2. 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 item's description, price, and/or quantity. Has parameter ItemToPurchase. Does not
return anything.
If item can be found (by name) in cart, check if parameter has default values for description,
price, and quantity. If not, modify item in cart.
If item cannot be found (by name) in cart, output this message: Item not found in cart. Nothing
modified.
GetNumItemsInCart() (2 pts)
Returns quantity of all items in cart. Has no parameters.
GetCostOfCart() (2 pts)
Determines and returns the total cost of items in cart. Has no parameters.
PrintTotal()
Outputs total of objects in cart.
If cart is empty, output this message: SHOPPING CART IS EMPTY
PrintDescriptions()
Outputs each item's description.
Ex. of PrintTotal() output:
Ex. of PrintDescriptions() output:
(3) In main(), prompt the user for a customer's name and today's date. Output the name and
date. Create an object of type ShoppingCart. (1 pt)
Ex.
3. (4) Implement the PrintMenu() function. PrintMenu() has a ShoppingCart parameter, and
outputs a menu of options to manipulate the shopping cart. Each option is represented by a single
character. Build and output the menu within the function.
If the an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit
before implementing other options. Call PrintMenu() in the main() function. Continue to execute
the menu until the user enters q to Quit. (3 pts)
Ex:
(5) Implement Output shopping cart menu option. (3 pts)
Ex:
(6) Implement Output item's description menu option. (2 pts)
Ex.
(7) Implement Add item to cart menu option. (3 pts)
Ex:
(8) Implement remove item menu option. (4 pts)
Ex:
(9) Implement Change item quantity menu option. Hint: Make new ItemToPurchase object and
use ItemToPurchase modifiers before using ModifyItem() function. (5 pts)
Ex:
My Program:
ItemToPurchase.h
#ifndef ITEMTOPURCHASE_H
#define ITEMTOPURCHASE_H
#include
#include
8. if(oldsize == cartItems.size()) {
cout << "Item not found in cart. Nothing removed." << endl;
}
return;
}
void ShoppingCart::ModifyItem(ItemToPurchase itemToChange){
bool itemToModify = false;
for (unsigned int i = 0; i < cartItems.size(); ++i){
if (cartItems.at(i).GetName() == itemToChange.GetName()) {
cartItems.at(i).SetQuantity(itemToChange.GetQuantity());
itemToModify = true;
}
}
if (itemToModify == false) {
cout << "Item not found in cart. Nothing modified.";
}
return;
}
int ShoppingCart::GetNumItemsInCart(){
int numItems = cartItems.size();
return numItems;
}
int ShoppingCart::GetCostOfCart() {
int sum = 0;
for (unsigned int i = 0; i < cartItems.size(); ++i){
sum = sum + (cartItems.at(i).GetPrice()*cartItems.at(i).GetQuantity());
}
return sum;
}
void ShoppingCart::PrintTotal(){
int total = 0;
cout << customerName << "'s Shopping Cart - " << currentDate << endl;