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.
C++ help finish my code Topics class definitions, arrays of objec.pdfinfo189835
C++ help finish my code
Topics: class definitions, arrays of objects, static variables, friends, public member functions,
class
composition, transaction processing
Overview: Develop code that reads a supplied input file and populates a set of Grocery objects.
Once the
input process is complete, the code reads user transactions from the console to query and report
on the
grocery items in several ways.
Data structures: Grocery items are stored in a static array of 100 Grocery objects. Your code
reads a file, one
record per grocery item, and builds the array. You dont know in advance how many Grocery
items there will
be. Each Grocery item may have had multiple selling prices during its lifetime. The selling
prices are recorded
in an array of PriceHistory objects contained in each Grocery object. The price histories are
added by the user
after the initial data has been read. The number of price histories per item could vary, from
none, up to 25.
Class definitions
Create a class, called Grocery, that defines a Grocery item.
Members:
UPC - int
description - string
cost - float
selling price - float
inventory - int
status - char
price history - array of 25 PriceHistory objects
number of used history elements - int
Public member functions:
as needed
Static members:
number of Grocery items - int
Create a class, called PriceHistory, that defines a price that was used for a grocery item.
Private members:
date - date price went into effect. YYYY-MM-DD format.
historical price - float
Your main routine has two parts.
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.
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.
Please the following is the currency class of perious one- class Curre.pdfadmin463580
Please the following is the currency class of perious one.
class Currency {
protected:
int whole;
int fraction;
virtual std::string get_name() = 0;
public:
Currency() {
whole = 0;
fraction = 0;
}
Currency(double value) {
if (value < 0)
throw "Invalid value";
whole = int(value);
fraction = std::round(100 * (value - whole));
}
Currency(const Currency& curr) {
whole = curr.whole;
fraction = curr.fraction;
}
/* This algorithm gets the whole part or fractional part of the currency
Pre: whole, fraction - integer numbers
Post:
Return: whole or fraction
*/
int get_whole() { return whole; }
int get_fraction() { return fraction; }
/* This algorithm adds an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void set_whole(int w) {
if (w >= 0)
whole = w;
}
void set_fraction(int f) {
if (f >= 0 && f < 100)
fraction = f;
}
/* This algorithm adds an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void add(const Currency* curr) {
whole += curr->whole;
fraction += curr->fraction;
if (fraction > 100) {
whole++;
fraction %= 100;
}
}
/* This algorithm subtracts an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void subtract(const Currency* curr) {
if (!isGreater(*curr))
throw "Invalid Subtraction";
whole -= curr->whole;
if (fraction < curr->fraction) {
fraction = fraction + 100 - curr->fraction;
whole--;
}
else {
fraction -= curr->fraction;
}
}
/* This algorithm compares the an object of the same currency for equality or inequality
Pre: object (same currency)
Post:
Return: whole/fraction
*/
bool isEqual(const Currency& curr) {
return curr.whole == whole && curr.fraction == fraction;
}
/* This algorithm compares the an object of the same currency to determine which is greater or
smaller
Pre: object (same currency)
Post:
Return: true/false
*/
bool isGreater(const Currency& curr) {
if (whole < curr.whole)
return false;
if (whole == curr.whole && fraction < curr.fraction)
return false;
return true;
}
/* This algorithm prints the name and value of the currency object
Pre: value of whole, fraction, and the name
Post: whole, fraction, get_name()
Return:
*/
void print() {
std::cout << whole << "." << fraction << " " << get_name() << std::endl;
}
};
class Krone : public Currency {
protected:
/*
This algorithm gets the name for the Currency.
Pre: name - declared as string and initialized as Krone
Post:
Return: name
*/
std::string name = "Krone";
std::string get_name() {
return name;
}
public:
Krone() : Currency() { }
Krone(double value) : Currency(value) { }
Krone(Krone& curr) : Currency(curr) { }
};
class Soum : public Currency {
protected:
/* This algorithm gets the name for the Currency.
Pre: name - declared as string and initialized as Soum
Post:
Return: name
*/
std::string name = "Soum";
std::string get_name() {
return name;
}
public:
Soum() : Currency() { }
Soum(double value) : Currency(value) { }
Soum(Krone& curr) : Currency(curr) { }
};
A LinkNode structure or class which will have two attrib.
Please solve the following problem using C++- Thank you Instructions-.docxPeterlqELawrenceb
Please solve the following problem using C++. Thank you
Instructions: ----
A LinkNode structure or class which will have two attributes -
a data attribute, and
a pointer attribute to the next node.
The data attribute of the LinkNode should be a reference/pointer of the Currency class of Lab 2.
Do not make it an inner class or member structure to the SinglyLinkedList class of #2 below.
A SinglyLinkedList class which will be composed of three attributes -
a count attribute,
a LinkNode pointer/reference attribute named as and pointing to the start of the list and
a LinkNode pointer/reference attribute named as and pointing to the end of the list.
Since this is a class, make sure all these attributes are private.
The class and attribute names for the node and linked list are the words in bold in #1 and #2.
For the Linked List, implement the following linked-list behaviors as explained in class -
getters/setters/constructors/destructors, as needed, for the attributes of the class.
createList method in addition to the constructor - this is optional for overloading purposes.
destroyList method in place of or in addition to the destructor - this is optional for overloading purposes,
addCurrency method which takes a Currency object and a node index value as parameters to add the Currency to the list at that index.
removeCurrency method which takes a Currency object as parameter and removes that Currency object from the list and may return a copy of the Currency.
removeCurrency overload method which takes a node index as parameter and removes the Currency object at that index and may return a copy of the Currency.
findCurrency method which takes a Currency object as parameter and returns the node index at which the Currency is found in the list.
getCurrency method which takes an index values as a parameter and returns the Currency object.
printList method which returns a string of all the Currency objects in the list in the order of index, tab spaced.
isListEmpty method which returns if a list is empty or not.
countCurrency method which returns a count of Currency nodes in the list.
Any other methods you think would be useful in your program.
A Stack class derived from the SinglyLinkedList but with no additional attributes and the usual stack methods -
constructor and createStack (optional) methods,
push which takes a Currency object as parameter and adds it to the top of the stack.
pop which takes no parameter and removes and returns the Currency object from the top of the stack.
peek which takes no parameter and returns a copy of the Currency object at the top of the stack.
printStack method which returns a string signifying the contents of the stack from the top to bottom, tab spaced.
destructor and/or destroyStack (optional) methods.
Ensure that the Stack objects do not allow Linked List functions to be used on them.
A Queue class derived from the SinglyLinkedList but with no additional attributes and the usual queue methods -
constructor and creat.
hello- please dont just copy from other answers- the following is the.docxIsaac9LjWelchq
hello. please dont just copy from other answers, the following is the code that is already have and can u modified it for the following instructions.
instructions ----A LinkNode structure or class which will have two attributes -
a data attribute, and
a pointer attribute to the next node.
The data attribute of the LinkNode should be a reference/pointer of the Currency class of Lab 2.
Do not make it an inner class or member structure to the SinglyLinkedList class of #2 below.
A SinglyLinkedList class which will be composed of three attributes -
a count attribute,
a LinkNode pointer/reference attribute named as and pointing to the start of the list and
a LinkNode pointer/reference attribute named as and pointing to the end of the list.
Since this is a class, make sure all these attributes are private.
The class and attribute names for the node and linked list are the words in bold in #1 and #2.
For the Linked List, implement the following linked-list behaviors as explained in class -
getters/setters/constructors/destructors, as needed, for the attributes of the class.
createList method in addition to the constructor - this is optional for overloading purposes.
destroyList method in place of or in addition to the destructor - this is optional for overloading purposes,
addCurrency method which takes a Currency object and a node index value as parameters to add the Currency to the list at that index.
removeCurrency method which takes a Currency object as parameter and removes that Currency object from the list and may return a copy of the Currency.
removeCurrency overload method which takes a node index as parameter and removes the Currency object at that index and may return a copy of the Currency.
findCurrency method which takes a Currency object as parameter and returns the node index at which the Currency is found in the list.
getCurrency method which takes an index values as a parameter and returns the Currency object.
printList method which returns a string of all the Currency objects in the list in the order of index, tab spaced.
isListEmpty method which returns if a list is empty or not.
countCurrency method which returns a count of Currency nodes in the list.
Any other methods you think would be useful in your program.
A Stack class derived from the SinglyLinkedList but with no additional attributes and the usual stack methods -
constructor and createStack (optional) methods,
push which takes a Currency object as parameter and adds it to the top of the stack.
pop which takes no parameter and removes and returns the Currency object from the top of the stack.
peek which takes no parameter and returns a copy of the Currency object at the top of the stack.
printStack method which returns a string signifying the contents of the stack from the top to bottom, tab spaced.
destructor and/or destroyStack (optional) methods.
Ensure that the Stack objects do not allow Linked List functions to be used on them.
A Queue class derived from the SinglyLink.
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.
ObjectivesMore practice with recursion.Practice writing some tem.docxvannagoforth
Objectives
More practice with recursion.
Practice writing some template functions.
Use stack ADT to implement given algorithms.
Look at some common applications of stacks.Description
In this assignment, you will be using the Stack abstract data type we developed this week and discussed in our weeks lectures, to implement 4 functions that use a stack data type to accomplish their algorithms. The functions range from relatively simple, straight forward use of a stack, to a bit more complex. But in all 4 cases, you should only need to use the abstract stack interface functions push(), pop(), top(), and isEmpty() in order to successfully use our Stack type for this assignment and the function you are asked to write.
For this assignment you need to perform the following tasks.
1. In the rst task, we will write a function that will check if a string of parenthesis is matching. Strings will be given to the function of the format "(()((())))", using only opening "(" and closing ")". Your function should be named doParenthesisMatch(). It takes a single string as input, and it returns a boolean result of true if the parenthesis match, and false otherwise.
The algorithm to check for matching parenthesis using a stack is fairly simple. A pseudo-code description migth be
for each charcter c in expression do
if c is an open paren ’(’ push it on stack
if c is a close paren ’)’:
do
if stack is empty
answer is false, because we can’t match the current ’)’
else pop stack, because we just matched an open ’(’ with a close ’)’
done
done
Your function will be given a C++ string class as input. It is relatively simple to parse each character of a C++ string. Here is an example for loop to do this:
s = "(())";
for (size_t index = 0; index < s.length(); index++)
{ char c = s[index];
// handle char c of the string expression s here }
2. In the next task, we will also write a function that decodes a string expression. Given a sequence consisting of ’I’ and ’D’ characters, where ’I’ denotes increasing and ’D’ denotes decreasing, decode the given sequence to construct a "minimum number" without repeated digits.
An example of some inputs and outputs will make it clear what is meant by a "minimal number".
sequence
output
IIII
->
12345
DDDD
->
54321
ID
->
132
IDIDII
->
1325467
IIDDIDID
->
125437698
If you are given 4 characters in the input sequence, the result will be a number with 5 characters, and further only the digits ’12345’ would be in the "minimal number" output. Each ’I’ and ’D’ in the input denotes that the next digit in the output should go up (increase) or go down (decrease) respectively. As you can see for the input sequence "IDI" you have to accommodate the sequence, thus the output goes from 1 to 3 for the initial increase, becase in order to then decrease, and also only have the digits ’123’, we need 3 for the second digit so the third can decrease to 2.
Take a moment to think how you might write an algorithm to solve this problem? It may be di cult to thi ...
C++ help finish my code Topics class definitions, arrays of objec.pdfinfo189835
C++ help finish my code
Topics: class definitions, arrays of objects, static variables, friends, public member functions,
class
composition, transaction processing
Overview: Develop code that reads a supplied input file and populates a set of Grocery objects.
Once the
input process is complete, the code reads user transactions from the console to query and report
on the
grocery items in several ways.
Data structures: Grocery items are stored in a static array of 100 Grocery objects. Your code
reads a file, one
record per grocery item, and builds the array. You dont know in advance how many Grocery
items there will
be. Each Grocery item may have had multiple selling prices during its lifetime. The selling
prices are recorded
in an array of PriceHistory objects contained in each Grocery object. The price histories are
added by the user
after the initial data has been read. The number of price histories per item could vary, from
none, up to 25.
Class definitions
Create a class, called Grocery, that defines a Grocery item.
Members:
UPC - int
description - string
cost - float
selling price - float
inventory - int
status - char
price history - array of 25 PriceHistory objects
number of used history elements - int
Public member functions:
as needed
Static members:
number of Grocery items - int
Create a class, called PriceHistory, that defines a price that was used for a grocery item.
Private members:
date - date price went into effect. YYYY-MM-DD format.
historical price - float
Your main routine has two parts.
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.
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.
Please the following is the currency class of perious one- class Curre.pdfadmin463580
Please the following is the currency class of perious one.
class Currency {
protected:
int whole;
int fraction;
virtual std::string get_name() = 0;
public:
Currency() {
whole = 0;
fraction = 0;
}
Currency(double value) {
if (value < 0)
throw "Invalid value";
whole = int(value);
fraction = std::round(100 * (value - whole));
}
Currency(const Currency& curr) {
whole = curr.whole;
fraction = curr.fraction;
}
/* This algorithm gets the whole part or fractional part of the currency
Pre: whole, fraction - integer numbers
Post:
Return: whole or fraction
*/
int get_whole() { return whole; }
int get_fraction() { return fraction; }
/* This algorithm adds an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void set_whole(int w) {
if (w >= 0)
whole = w;
}
void set_fraction(int f) {
if (f >= 0 && f < 100)
fraction = f;
}
/* This algorithm adds an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void add(const Currency* curr) {
whole += curr->whole;
fraction += curr->fraction;
if (fraction > 100) {
whole++;
fraction %= 100;
}
}
/* This algorithm subtracts an object to the same currency
Pre: object (same currency)
Post:
Return:
*/
void subtract(const Currency* curr) {
if (!isGreater(*curr))
throw "Invalid Subtraction";
whole -= curr->whole;
if (fraction < curr->fraction) {
fraction = fraction + 100 - curr->fraction;
whole--;
}
else {
fraction -= curr->fraction;
}
}
/* This algorithm compares the an object of the same currency for equality or inequality
Pre: object (same currency)
Post:
Return: whole/fraction
*/
bool isEqual(const Currency& curr) {
return curr.whole == whole && curr.fraction == fraction;
}
/* This algorithm compares the an object of the same currency to determine which is greater or
smaller
Pre: object (same currency)
Post:
Return: true/false
*/
bool isGreater(const Currency& curr) {
if (whole < curr.whole)
return false;
if (whole == curr.whole && fraction < curr.fraction)
return false;
return true;
}
/* This algorithm prints the name and value of the currency object
Pre: value of whole, fraction, and the name
Post: whole, fraction, get_name()
Return:
*/
void print() {
std::cout << whole << "." << fraction << " " << get_name() << std::endl;
}
};
class Krone : public Currency {
protected:
/*
This algorithm gets the name for the Currency.
Pre: name - declared as string and initialized as Krone
Post:
Return: name
*/
std::string name = "Krone";
std::string get_name() {
return name;
}
public:
Krone() : Currency() { }
Krone(double value) : Currency(value) { }
Krone(Krone& curr) : Currency(curr) { }
};
class Soum : public Currency {
protected:
/* This algorithm gets the name for the Currency.
Pre: name - declared as string and initialized as Soum
Post:
Return: name
*/
std::string name = "Soum";
std::string get_name() {
return name;
}
public:
Soum() : Currency() { }
Soum(double value) : Currency(value) { }
Soum(Krone& curr) : Currency(curr) { }
};
A LinkNode structure or class which will have two attrib.
Please solve the following problem using C++- Thank you Instructions-.docxPeterlqELawrenceb
Please solve the following problem using C++. Thank you
Instructions: ----
A LinkNode structure or class which will have two attributes -
a data attribute, and
a pointer attribute to the next node.
The data attribute of the LinkNode should be a reference/pointer of the Currency class of Lab 2.
Do not make it an inner class or member structure to the SinglyLinkedList class of #2 below.
A SinglyLinkedList class which will be composed of three attributes -
a count attribute,
a LinkNode pointer/reference attribute named as and pointing to the start of the list and
a LinkNode pointer/reference attribute named as and pointing to the end of the list.
Since this is a class, make sure all these attributes are private.
The class and attribute names for the node and linked list are the words in bold in #1 and #2.
For the Linked List, implement the following linked-list behaviors as explained in class -
getters/setters/constructors/destructors, as needed, for the attributes of the class.
createList method in addition to the constructor - this is optional for overloading purposes.
destroyList method in place of or in addition to the destructor - this is optional for overloading purposes,
addCurrency method which takes a Currency object and a node index value as parameters to add the Currency to the list at that index.
removeCurrency method which takes a Currency object as parameter and removes that Currency object from the list and may return a copy of the Currency.
removeCurrency overload method which takes a node index as parameter and removes the Currency object at that index and may return a copy of the Currency.
findCurrency method which takes a Currency object as parameter and returns the node index at which the Currency is found in the list.
getCurrency method which takes an index values as a parameter and returns the Currency object.
printList method which returns a string of all the Currency objects in the list in the order of index, tab spaced.
isListEmpty method which returns if a list is empty or not.
countCurrency method which returns a count of Currency nodes in the list.
Any other methods you think would be useful in your program.
A Stack class derived from the SinglyLinkedList but with no additional attributes and the usual stack methods -
constructor and createStack (optional) methods,
push which takes a Currency object as parameter and adds it to the top of the stack.
pop which takes no parameter and removes and returns the Currency object from the top of the stack.
peek which takes no parameter and returns a copy of the Currency object at the top of the stack.
printStack method which returns a string signifying the contents of the stack from the top to bottom, tab spaced.
destructor and/or destroyStack (optional) methods.
Ensure that the Stack objects do not allow Linked List functions to be used on them.
A Queue class derived from the SinglyLinkedList but with no additional attributes and the usual queue methods -
constructor and creat.
hello- please dont just copy from other answers- the following is the.docxIsaac9LjWelchq
hello. please dont just copy from other answers, the following is the code that is already have and can u modified it for the following instructions.
instructions ----A LinkNode structure or class which will have two attributes -
a data attribute, and
a pointer attribute to the next node.
The data attribute of the LinkNode should be a reference/pointer of the Currency class of Lab 2.
Do not make it an inner class or member structure to the SinglyLinkedList class of #2 below.
A SinglyLinkedList class which will be composed of three attributes -
a count attribute,
a LinkNode pointer/reference attribute named as and pointing to the start of the list and
a LinkNode pointer/reference attribute named as and pointing to the end of the list.
Since this is a class, make sure all these attributes are private.
The class and attribute names for the node and linked list are the words in bold in #1 and #2.
For the Linked List, implement the following linked-list behaviors as explained in class -
getters/setters/constructors/destructors, as needed, for the attributes of the class.
createList method in addition to the constructor - this is optional for overloading purposes.
destroyList method in place of or in addition to the destructor - this is optional for overloading purposes,
addCurrency method which takes a Currency object and a node index value as parameters to add the Currency to the list at that index.
removeCurrency method which takes a Currency object as parameter and removes that Currency object from the list and may return a copy of the Currency.
removeCurrency overload method which takes a node index as parameter and removes the Currency object at that index and may return a copy of the Currency.
findCurrency method which takes a Currency object as parameter and returns the node index at which the Currency is found in the list.
getCurrency method which takes an index values as a parameter and returns the Currency object.
printList method which returns a string of all the Currency objects in the list in the order of index, tab spaced.
isListEmpty method which returns if a list is empty or not.
countCurrency method which returns a count of Currency nodes in the list.
Any other methods you think would be useful in your program.
A Stack class derived from the SinglyLinkedList but with no additional attributes and the usual stack methods -
constructor and createStack (optional) methods,
push which takes a Currency object as parameter and adds it to the top of the stack.
pop which takes no parameter and removes and returns the Currency object from the top of the stack.
peek which takes no parameter and returns a copy of the Currency object at the top of the stack.
printStack method which returns a string signifying the contents of the stack from the top to bottom, tab spaced.
destructor and/or destroyStack (optional) methods.
Ensure that the Stack objects do not allow Linked List functions to be used on them.
A Queue class derived from the SinglyLink.
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.
ObjectivesMore practice with recursion.Practice writing some tem.docxvannagoforth
Objectives
More practice with recursion.
Practice writing some template functions.
Use stack ADT to implement given algorithms.
Look at some common applications of stacks.Description
In this assignment, you will be using the Stack abstract data type we developed this week and discussed in our weeks lectures, to implement 4 functions that use a stack data type to accomplish their algorithms. The functions range from relatively simple, straight forward use of a stack, to a bit more complex. But in all 4 cases, you should only need to use the abstract stack interface functions push(), pop(), top(), and isEmpty() in order to successfully use our Stack type for this assignment and the function you are asked to write.
For this assignment you need to perform the following tasks.
1. In the rst task, we will write a function that will check if a string of parenthesis is matching. Strings will be given to the function of the format "(()((())))", using only opening "(" and closing ")". Your function should be named doParenthesisMatch(). It takes a single string as input, and it returns a boolean result of true if the parenthesis match, and false otherwise.
The algorithm to check for matching parenthesis using a stack is fairly simple. A pseudo-code description migth be
for each charcter c in expression do
if c is an open paren ’(’ push it on stack
if c is a close paren ’)’:
do
if stack is empty
answer is false, because we can’t match the current ’)’
else pop stack, because we just matched an open ’(’ with a close ’)’
done
done
Your function will be given a C++ string class as input. It is relatively simple to parse each character of a C++ string. Here is an example for loop to do this:
s = "(())";
for (size_t index = 0; index < s.length(); index++)
{ char c = s[index];
// handle char c of the string expression s here }
2. In the next task, we will also write a function that decodes a string expression. Given a sequence consisting of ’I’ and ’D’ characters, where ’I’ denotes increasing and ’D’ denotes decreasing, decode the given sequence to construct a "minimum number" without repeated digits.
An example of some inputs and outputs will make it clear what is meant by a "minimal number".
sequence
output
IIII
->
12345
DDDD
->
54321
ID
->
132
IDIDII
->
1325467
IIDDIDID
->
125437698
If you are given 4 characters in the input sequence, the result will be a number with 5 characters, and further only the digits ’12345’ would be in the "minimal number" output. Each ’I’ and ’D’ in the input denotes that the next digit in the output should go up (increase) or go down (decrease) respectively. As you can see for the input sequence "IDI" you have to accommodate the sequence, thus the output goes from 1 to 3 for the initial increase, becase in order to then decrease, and also only have the digits ’123’, we need 3 for the second digit so the third can decrease to 2.
Take a moment to think how you might write an algorithm to solve this problem? It may be di cult to thi ...
please code in c#- please note that im a complete beginner- northwind.docxAustinaGRPaigey
please code in c#.
please note that im a complete beginner.
northwind.mdf.
northwind_log.ldf
OrderDetailsMaintenance.zip
1. Include the two above files in the root of your OrderDetailsMaintenance project.
2. Make sure to mark them as "Content" and "Copy Always" or "Copy if newer" in the properties window of those two files.
3. Run the Scaffold-DbContext command to create a context class as well as a class to encapsulate the Orders objects from the associated table in the mdf file. Make sure to include the parameters for -Tables Customers (only worry about the attributes associated with the text boxes, you don't need to worry about any other rows from the table)
4. Once you have ran the command, include an app.config file and add a connection string element. Make sure to copy the connection string from your Context class to your app.config. Then edit your context to grab the connection string from the app.config (ConfigurationManager.ConnectionString["Northwind"].ConnectionString)
5. Code the Find button to Find the customer id and populate the details in the below text boxes.
1. If no order is found, display a message box.
6. Code the exit button
7. Code the Save button to update its attributes and call Update and SaveChanges() on that particular entity.
1. Note: If you close the program, reopen it, and search for the entity you recently updated. You may not see the changes depending on how you setup the mdf file in your project (because it copies a new version to the bin directory each time you run the program). So, if you don't see your changes, don't be alarmed.
============
HERE IS WHAT I HAVE SO FAR
frmCustomerMaintenance.cs
namespace OrderDetailsMaintenance
{
public partial class frmCustomerMaintenance : Form
{
public frmCustomerMaintenance()
{
InitializeComponent();
}
}
}
frmCustomerMaintenance.resx
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name".
I am Arnold H. I am a C++ Programming Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Sheffield, UK. I have been helping students with their homework for the past 6 years. I solve homework related to C++ Programming.
Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Programming Homework.
Below is my code- I have an error that I still have difficulty figurin.pdfarmanuelraj
Below is my code. I have an error that I still have difficulty figuring out. Please explain and
teach me the solution to fix it specifically (e.g. changing which line in the code). Thank you!
main.cpp
/*
Overloaded stream insertion operator <<
- used to display reports and write data to file.
Overloaded relational operator (<)
- used to sort the array in ascending order by name (insertion sort)
*/
#include "Sales.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
const int MAX_SIZE = 30;
/* Write your code here:
declare the function you are going to call in this program
*/
void readData(string fileName, Sales *salesArr, int &size);
void insertSort(Sales *salesArr, int size);
double calcSalesAvg(Sales *salesArr, int size);
void displayOverAvg(Sales *salesArr, int size, double avg);
void writeReport(Sales *salesArr, int size, string fileName);
void showReport(string fileName);
int main() {
Sales salesArr[MAX_SIZE];
int size = 0;
string fileName;
cout << "Please enter the input file's name: ";
getline(cin, fileName);
readData(fileName, salesArr, size);
insertSort(salesArr, size);
double avg = calcSalesAvg(salesArr, size);
displayOverAvg(salesArr, size, avg);
writeReport(salesArr, size, fileName);
string option;
cout << "Show report?" << endl;
getline(cin, option);
if (option == "Y" || option == "y")
showReport(fileName);
return 0;
}
// function definitions
void readData(string fileName, Sales *salesArr, int &size) {
string temp;
int i = 0;
fstream ptr;
ptr.open(fileName, ios::in);
while (getline(ptr, temp)) {
size++;
stringstream chk(temp);
string t2;
int id, year, amountSold;
string fname, lname;
int j = 0;
while (getline(chk, t2, ' ')) {
if (j == 0) {
id = stoi(t2);
}
if (j == 1) {
year = stoi(t2);
}
if (j == 2) {
fname = t2;
}
if (j == 3) {
lname = t2;
}
if (j == 4) {
amountSold = stoi(t2);
}
j++;
}
string gg = fname + " " + lname;
gg[gg.size() - 1] = 0;
Sales ss(id, year, gg, amountSold);
salesArr[i] = ss;
i++;
}
ptr.close();
}
void insertSort(Sales *salesArr, int size) {
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (salesArr[j] < salesArr[i]) {
Sales temp(salesArr[i]);
salesArr[i] = salesArr[j];
salesArr[j] = temp;
}
}
}
}
double calcSalesAvg(Sales *salesArr, int size) {
double d = 0;
for (int i = 0; i < size; i++) {
d += (salesArr[i].getAmountSold());
}
return (double) d / size;
}
void displayOverAvg(Sales *salesArr, int size, double avg) {
cout << "Average Sales: " << avg << endl;
string nm ;
cout << "Salespeople with above average sales:" << endl;
for (int i = 0; i < size; i++) {
if (salesArr[i].getAmountSold() > avg) {
cout << salesArr[i];
}
}
}
void writeReport(Sales *salesArr, int size, string fileName) {
fileName.insert(fileName.find("."), "Report");
fstream ptr;
ptr.open(fileName, ios::out);
for (int i = 0; i < size; i++) {
ptr << salesArr[i];
}
ptr.close();
}
/*
This function receives the name of a file and
displays its contents to the s.
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.
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxbradburgess22840
In Class Assignmetz/CST280W13a-1.pdf
CST 280 In-Class Practice – Week 13
Manually determine the configuration of the priority queue (stored as a heap) created
by the following operations. Trace the following logic and define the output:
enqueue(7);
enqueue(17);
enqueue(2);
enqueue(5);
enqueue(22);
enqueue(19);
enqueue(6);
enqueue(11);
enqueue(13);
write the queue contents
dequeue and write front item
enqueue(15);
enqueue(8);
dequeue and write front item
dequeue and write front item
enqueue(24);
enqueue(14);
write the queue contents
Part 2
Then, verify the output by implementing the algorithm by rewriting the priority
queue demonstration program discussed in class. Files needed:
testPQueue.cpp pqType.h heap.cpp
Deliverables
• This cover sheet (with your names on it)
• Driver source code and output for verification program exectution.
In Class Assignmetz/CST280W13b.pdf
CST 280 In-Class Practice – Week 13
Use this page as a worksheet to sketch the progression of the elements up to the first
split for the QuickSort algorithm. Use the middle array element as the split value:
15 34 99 42 11 41 66 23 55 93 48
Next, access the file quickSort.cpp from the course web page. Tailor the program
by entering the array values above in place of the integer values used for an in-class
demonstration. Be sure to adjust the index range to match the size of this array.
Remember that the parameters to the QuickSort algorithm are starting and ending index
values, not the size of the array.
Next, insert code to demonstrate the state of the array after the first split. This should
verify what you did by hand above. Insert the following code at various points within
the partition function to “see” the array at various stages of processing:
for (int i = start; i <= end; i++) // <== ADD
cout << set[i] << ' ';
cout << endl;
Insert the code at these positions:
int partition(int set[], int start, int end)
{
int pivotValue, pivotIndex, mid;
mid = (start + end) / 2;
swap(set[start], set[mid]);
pivotIndex = start;
pivotValue = set[start];
ç HERE
for (int scan = start + 1; scan <= end; scan++)
{
if (set[scan] < pivotValue)
{
pivotIndex++;
swap(set[pivotIndex], set[scan]);
}
ç HERE
}
swap(set[start], set[pivotIndex]);
ç HERE
return pivotIndex;
}
Finally, identify the line that matches what you concluded above.
Deliverables:
Deliver the following for this assignment:
• This work sheet with a sketch of the array first split
• Program source code with required change
• Program output demonstrating array configuration after first split .
The objective of the Level 5 Diploma in Information Technology is to provide learners with an excellent foundation for a career in a range of organisations. It designed to ensure that each learner is ‘business ready’: a confident, independent thinker with a detailed knowledge of Information Technology, and equipped with the skills to adapt rapidly to change.
So I already have most of the code and now I have to1. create an .pdfarjuncollection
So I already have most of the code and now I have to:
1. create an index file to keep track of all the inventory IDs and their locations
2. modify my class to be able to display any record with a given ID without searching through
the entire file
// This program displays the contents of the inventory file.
#include
#include
#include
using namespace std;
class DB{
// Declaration of InventoryItem structure
class InventoryItem
{
public:
char Id[5];
char desc[31];
int qty;
float price;
};
string DBname;
fstream inventory;// (DBname, ios::in | ios::binary);
public: DB(string N){ DBname = N; }// constructor
private:void Input(InventoryItem &Inv)
{
cout << \"Please type Id\" << endl;
cin >> Inv.Id;
cout << \"Please type Desc\" << endl;
cin >> Inv.desc;
cout << \"Please type qty\" << endl;
cin >> Inv.qty;
cout << \"Please type price\"<> Inv.price;
}
public: void Create(int Nrec)
{
inventory.open(DBname, ios::out | ios::binary);
// fstream inventory(\"Inventory.dat\", ios::out | ios::binary);
InventoryItem record = { \"\", \" \", 0, 0.0 };
// Write the blank records
for (int count = 0; count < Nrec; count++)
{
Input(record);
cout << \"Now writing record \" << count << endl;
inventory.write(reinterpret_cast(&record), sizeof(record));
}
// Close the file.
inventory.close();
return ;
}
public: void Display()
{
inventory.open(DBname, ios::in | ios::binary);
InventoryItem record = { \"\",\"\", 0, 0.0 };
// Now read and display the records
inventory.read(reinterpret_cast(&record),
sizeof(record));
while (!inventory.eof())
{
cout << \"Inventory Id: \";
cout << record.Id << endl;
cout << \"Description: \";
cout << record.desc << endl;
cout << \"Quantity: \";
cout << record.qty << endl;
cout << \"Price: \";
cout << record.price << endl << endl;
inventory.read(reinterpret_cast(&record), sizeof(record));
}
// Close the file.
inventory.close();
return;
}
};
int main()
{
DB Mydb(\"Inventory.dat\"); // declare a database
Mydb.Create(3); // load data
cout << \"***** display ***\" << endl;
Mydb.Display(); // print entire database
// implement the following function
// Mydb.Show(\"AB001\"); // display record with given ID
char C; cin >> C; return 0;
}
Solution
Programming Code in C++
#include
#include
#include
#include
#include
#include
using namespace std;
//Structure.
struct InvStruct
{
string iName;
int iQuantity;
double iPrice;
};
const int MAXSIZE = 9;
void addToInventory(InvStruct aList[], int& aSize);
void displayInventory(const InvStruct aList[], int aSize);
void saveToFile(const InvStruct aList[], int aSize);
void openAFile(InvStruct aList[], int& aSize);
char menuResponse();
int main(int argc, char *argv[])
{
InvStruct iRecords[MAXSIZE];
int noOfRec = 0;
bool reRun = true;
do
{
cout << \"Inventory has \" << noOfRec << \" items\" << endl;
switch (menuResponse())
{
case \'A\':
addToInventory(iRecords, noOfRec);
break;
case \'D\':
displayInventory(iRecords, noOfRec);
break;
case \'O\':
openAFile(iRecords, noOfRec);
break;
case \'S\':
saveToFile(iRecords, noOfRe.
Can someone help with the implementation of these generic ArrayList .pdfinfo189835
Can someone help with the implementation of these generic ArrayList methods in java
public class ArrayList implements List
public boolean isEmpty()
public boolean contains(Object o)
public Iterator iterator()
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public void clear()
public E get(int index)
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
public List subList(int fromIndex, int toIndex).
can someone help with the implementation of these generic DoublyLink.pdfinfo189835
can someone help with the implementation of these generic DoublyLinkedList methods
public boolean isEmpty()
public boolean contains(Object o)
public Iterator iterator()
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public void clear()
public E get(int index)
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
public List subList(int fromIndex, int toIndex)
Each method MUST validate the arguments it receives. If an index received is not valid, it
should throw an IndexOutOfBoundsException and if an Object argument is null it should throw
a NullPointerException..
More Related Content
Similar to C++ help finish my code Phase 1 - input phase. Main reads the fi.pdf
please code in c#- please note that im a complete beginner- northwind.docxAustinaGRPaigey
please code in c#.
please note that im a complete beginner.
northwind.mdf.
northwind_log.ldf
OrderDetailsMaintenance.zip
1. Include the two above files in the root of your OrderDetailsMaintenance project.
2. Make sure to mark them as "Content" and "Copy Always" or "Copy if newer" in the properties window of those two files.
3. Run the Scaffold-DbContext command to create a context class as well as a class to encapsulate the Orders objects from the associated table in the mdf file. Make sure to include the parameters for -Tables Customers (only worry about the attributes associated with the text boxes, you don't need to worry about any other rows from the table)
4. Once you have ran the command, include an app.config file and add a connection string element. Make sure to copy the connection string from your Context class to your app.config. Then edit your context to grab the connection string from the app.config (ConfigurationManager.ConnectionString["Northwind"].ConnectionString)
5. Code the Find button to Find the customer id and populate the details in the below text boxes.
1. If no order is found, display a message box.
6. Code the exit button
7. Code the Save button to update its attributes and call Update and SaveChanges() on that particular entity.
1. Note: If you close the program, reopen it, and search for the entity you recently updated. You may not see the changes depending on how you setup the mdf file in your project (because it copies a new version to the bin directory each time you run the program). So, if you don't see your changes, don't be alarmed.
============
HERE IS WHAT I HAVE SO FAR
frmCustomerMaintenance.cs
namespace OrderDetailsMaintenance
{
public partial class frmCustomerMaintenance : Form
{
public frmCustomerMaintenance()
{
InitializeComponent();
}
}
}
frmCustomerMaintenance.resx
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name".
I am Arnold H. I am a C++ Programming Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Sheffield, UK. I have been helping students with their homework for the past 6 years. I solve homework related to C++ Programming.
Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Programming Homework.
Below is my code- I have an error that I still have difficulty figurin.pdfarmanuelraj
Below is my code. I have an error that I still have difficulty figuring out. Please explain and
teach me the solution to fix it specifically (e.g. changing which line in the code). Thank you!
main.cpp
/*
Overloaded stream insertion operator <<
- used to display reports and write data to file.
Overloaded relational operator (<)
- used to sort the array in ascending order by name (insertion sort)
*/
#include "Sales.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
const int MAX_SIZE = 30;
/* Write your code here:
declare the function you are going to call in this program
*/
void readData(string fileName, Sales *salesArr, int &size);
void insertSort(Sales *salesArr, int size);
double calcSalesAvg(Sales *salesArr, int size);
void displayOverAvg(Sales *salesArr, int size, double avg);
void writeReport(Sales *salesArr, int size, string fileName);
void showReport(string fileName);
int main() {
Sales salesArr[MAX_SIZE];
int size = 0;
string fileName;
cout << "Please enter the input file's name: ";
getline(cin, fileName);
readData(fileName, salesArr, size);
insertSort(salesArr, size);
double avg = calcSalesAvg(salesArr, size);
displayOverAvg(salesArr, size, avg);
writeReport(salesArr, size, fileName);
string option;
cout << "Show report?" << endl;
getline(cin, option);
if (option == "Y" || option == "y")
showReport(fileName);
return 0;
}
// function definitions
void readData(string fileName, Sales *salesArr, int &size) {
string temp;
int i = 0;
fstream ptr;
ptr.open(fileName, ios::in);
while (getline(ptr, temp)) {
size++;
stringstream chk(temp);
string t2;
int id, year, amountSold;
string fname, lname;
int j = 0;
while (getline(chk, t2, ' ')) {
if (j == 0) {
id = stoi(t2);
}
if (j == 1) {
year = stoi(t2);
}
if (j == 2) {
fname = t2;
}
if (j == 3) {
lname = t2;
}
if (j == 4) {
amountSold = stoi(t2);
}
j++;
}
string gg = fname + " " + lname;
gg[gg.size() - 1] = 0;
Sales ss(id, year, gg, amountSold);
salesArr[i] = ss;
i++;
}
ptr.close();
}
void insertSort(Sales *salesArr, int size) {
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (salesArr[j] < salesArr[i]) {
Sales temp(salesArr[i]);
salesArr[i] = salesArr[j];
salesArr[j] = temp;
}
}
}
}
double calcSalesAvg(Sales *salesArr, int size) {
double d = 0;
for (int i = 0; i < size; i++) {
d += (salesArr[i].getAmountSold());
}
return (double) d / size;
}
void displayOverAvg(Sales *salesArr, int size, double avg) {
cout << "Average Sales: " << avg << endl;
string nm ;
cout << "Salespeople with above average sales:" << endl;
for (int i = 0; i < size; i++) {
if (salesArr[i].getAmountSold() > avg) {
cout << salesArr[i];
}
}
}
void writeReport(Sales *salesArr, int size, string fileName) {
fileName.insert(fileName.find("."), "Report");
fstream ptr;
ptr.open(fileName, ios::out);
for (int i = 0; i < size; i++) {
ptr << salesArr[i];
}
ptr.close();
}
/*
This function receives the name of a file and
displays its contents to the s.
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.
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxbradburgess22840
In Class Assignmetz/CST280W13a-1.pdf
CST 280 In-Class Practice – Week 13
Manually determine the configuration of the priority queue (stored as a heap) created
by the following operations. Trace the following logic and define the output:
enqueue(7);
enqueue(17);
enqueue(2);
enqueue(5);
enqueue(22);
enqueue(19);
enqueue(6);
enqueue(11);
enqueue(13);
write the queue contents
dequeue and write front item
enqueue(15);
enqueue(8);
dequeue and write front item
dequeue and write front item
enqueue(24);
enqueue(14);
write the queue contents
Part 2
Then, verify the output by implementing the algorithm by rewriting the priority
queue demonstration program discussed in class. Files needed:
testPQueue.cpp pqType.h heap.cpp
Deliverables
• This cover sheet (with your names on it)
• Driver source code and output for verification program exectution.
In Class Assignmetz/CST280W13b.pdf
CST 280 In-Class Practice – Week 13
Use this page as a worksheet to sketch the progression of the elements up to the first
split for the QuickSort algorithm. Use the middle array element as the split value:
15 34 99 42 11 41 66 23 55 93 48
Next, access the file quickSort.cpp from the course web page. Tailor the program
by entering the array values above in place of the integer values used for an in-class
demonstration. Be sure to adjust the index range to match the size of this array.
Remember that the parameters to the QuickSort algorithm are starting and ending index
values, not the size of the array.
Next, insert code to demonstrate the state of the array after the first split. This should
verify what you did by hand above. Insert the following code at various points within
the partition function to “see” the array at various stages of processing:
for (int i = start; i <= end; i++) // <== ADD
cout << set[i] << ' ';
cout << endl;
Insert the code at these positions:
int partition(int set[], int start, int end)
{
int pivotValue, pivotIndex, mid;
mid = (start + end) / 2;
swap(set[start], set[mid]);
pivotIndex = start;
pivotValue = set[start];
ç HERE
for (int scan = start + 1; scan <= end; scan++)
{
if (set[scan] < pivotValue)
{
pivotIndex++;
swap(set[pivotIndex], set[scan]);
}
ç HERE
}
swap(set[start], set[pivotIndex]);
ç HERE
return pivotIndex;
}
Finally, identify the line that matches what you concluded above.
Deliverables:
Deliver the following for this assignment:
• This work sheet with a sketch of the array first split
• Program source code with required change
• Program output demonstrating array configuration after first split .
The objective of the Level 5 Diploma in Information Technology is to provide learners with an excellent foundation for a career in a range of organisations. It designed to ensure that each learner is ‘business ready’: a confident, independent thinker with a detailed knowledge of Information Technology, and equipped with the skills to adapt rapidly to change.
So I already have most of the code and now I have to1. create an .pdfarjuncollection
So I already have most of the code and now I have to:
1. create an index file to keep track of all the inventory IDs and their locations
2. modify my class to be able to display any record with a given ID without searching through
the entire file
// This program displays the contents of the inventory file.
#include
#include
#include
using namespace std;
class DB{
// Declaration of InventoryItem structure
class InventoryItem
{
public:
char Id[5];
char desc[31];
int qty;
float price;
};
string DBname;
fstream inventory;// (DBname, ios::in | ios::binary);
public: DB(string N){ DBname = N; }// constructor
private:void Input(InventoryItem &Inv)
{
cout << \"Please type Id\" << endl;
cin >> Inv.Id;
cout << \"Please type Desc\" << endl;
cin >> Inv.desc;
cout << \"Please type qty\" << endl;
cin >> Inv.qty;
cout << \"Please type price\"<> Inv.price;
}
public: void Create(int Nrec)
{
inventory.open(DBname, ios::out | ios::binary);
// fstream inventory(\"Inventory.dat\", ios::out | ios::binary);
InventoryItem record = { \"\", \" \", 0, 0.0 };
// Write the blank records
for (int count = 0; count < Nrec; count++)
{
Input(record);
cout << \"Now writing record \" << count << endl;
inventory.write(reinterpret_cast(&record), sizeof(record));
}
// Close the file.
inventory.close();
return ;
}
public: void Display()
{
inventory.open(DBname, ios::in | ios::binary);
InventoryItem record = { \"\",\"\", 0, 0.0 };
// Now read and display the records
inventory.read(reinterpret_cast(&record),
sizeof(record));
while (!inventory.eof())
{
cout << \"Inventory Id: \";
cout << record.Id << endl;
cout << \"Description: \";
cout << record.desc << endl;
cout << \"Quantity: \";
cout << record.qty << endl;
cout << \"Price: \";
cout << record.price << endl << endl;
inventory.read(reinterpret_cast(&record), sizeof(record));
}
// Close the file.
inventory.close();
return;
}
};
int main()
{
DB Mydb(\"Inventory.dat\"); // declare a database
Mydb.Create(3); // load data
cout << \"***** display ***\" << endl;
Mydb.Display(); // print entire database
// implement the following function
// Mydb.Show(\"AB001\"); // display record with given ID
char C; cin >> C; return 0;
}
Solution
Programming Code in C++
#include
#include
#include
#include
#include
#include
using namespace std;
//Structure.
struct InvStruct
{
string iName;
int iQuantity;
double iPrice;
};
const int MAXSIZE = 9;
void addToInventory(InvStruct aList[], int& aSize);
void displayInventory(const InvStruct aList[], int aSize);
void saveToFile(const InvStruct aList[], int aSize);
void openAFile(InvStruct aList[], int& aSize);
char menuResponse();
int main(int argc, char *argv[])
{
InvStruct iRecords[MAXSIZE];
int noOfRec = 0;
bool reRun = true;
do
{
cout << \"Inventory has \" << noOfRec << \" items\" << endl;
switch (menuResponse())
{
case \'A\':
addToInventory(iRecords, noOfRec);
break;
case \'D\':
displayInventory(iRecords, noOfRec);
break;
case \'O\':
openAFile(iRecords, noOfRec);
break;
case \'S\':
saveToFile(iRecords, noOfRe.
Can someone help with the implementation of these generic ArrayList .pdfinfo189835
Can someone help with the implementation of these generic ArrayList methods in java
public class ArrayList implements List
public boolean isEmpty()
public boolean contains(Object o)
public Iterator iterator()
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public void clear()
public E get(int index)
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
public List subList(int fromIndex, int toIndex).
can someone help with the implementation of these generic DoublyLink.pdfinfo189835
can someone help with the implementation of these generic DoublyLinkedList methods
public boolean isEmpty()
public boolean contains(Object o)
public Iterator iterator()
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public void clear()
public E get(int index)
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
public List subList(int fromIndex, int toIndex)
Each method MUST validate the arguments it receives. If an index received is not valid, it
should throw an IndexOutOfBoundsException and if an Object argument is null it should throw
a NullPointerException..
can someone help with the implementation of these generic LinkedList.pdfinfo189835
can someone help with the implementation of these generic LinkedList methods
public boolean isEmpty()
public boolean contains(Object o)
public Iterator iterator()
public boolean add(E e)
public boolean remove(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public void clear()
public E get(int index)
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
public List subList(int fromIndex, int toIndex)
I have the implementation using only a head node, but need to add a tail to the code and it would
be awesome if you could show me how to do that.
Can someone explain me the steps pleaseTake the provided files.pdfinfo189835
Can someone explain me the steps please?
Take the provided files:
a single C++ file (helloWorld.cpp)
a set of C++ files (main.cpp, greeting.h, greeting.cpp)
a single python file (helloWorld.py)
Create a makefile that will compile the set of C++ files. Then, screen record yourself compiling
and running: the single C++ file and the set of C++ files (using make for this set!). Additionally,
screen record yourself interpreting and running the Python file.
the single C++ file must be run WITHOUT a makefile
the set of C++ files must be run WITH a makefile
This must be done through the command line. You cannot use a program to run your code for
you. This means any program where something is run through a green arrow or anything
equivalent. You must be seen typing and running the commands through the command line
FROM SCRATCH. There will be zero points awarded if you don't run through command line.
greeting.h is as follows:
#include
using std::string;
#ifndef GREETING_H
#define GREETING_H
class Greeting
{
private:
string name;
public:
Greeting();
// setter
void setName(string name);
// getter
string getName();
};
#endif // GREETING_H
greeting.cpp is as follows:
#include "greeting.h"
Greeting::Greeting()
{
}
// setter
void Greeting::setName(string name)
{
this->name = name;
}
// getter
string Greeting::getName()
{
return name;
}
helloworld.cpp is as follows:
// library includes
#include
#include
// using statements
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::getline;
int main()
{
cout << "Hello World" << endl << endl;
string name;
cout << "What's your name? ";
getline(cin, name);
cout << "Hello, " << name << endl;
return 0;
}
hellloWorld.py is as follows:
print("Hello World\n")
name = input("What is your name? ")
print("Hello,", name)
main.cpp is a s follows:
#include
#include
#include "greeting.h"
using namespace std;
int main()
{
cout << "A more complicated Hello World" << endl << endl;
Greeting temp;
string name;
cout << "What's your name? ";
getline(cin, name);
temp.setName(name);
cout << "Your name is: " << temp.getName() << endl;
cout << endl << "End the needlessly complicated code." << endl;
return 0;
}
Deliverables:
Your makefile
if Canvas yells at you submitting a makefile (it happens) compress into a .zip and submit
A screen recording covering all of the above -- you can do it in one recording, or have a
recording for each item
Recordings can only be of mp4, mkv, and mov file types
Anything else will not be guaranteed to be readable
Grading:
5pts - makefile present / contents
5pts - single C++ compiled and ran
without a makefile
5pts - set of C++ compiled and ran
5pts - Python file, interpreted and ran.
can someone briefly answer these questions please1) how socia.pdfinfo189835
can someone briefly answer these questions please?
1) how social presence can strengthen a brands persona?
2)discuss buyers journey in digital marketing?
3)how to choose the right social media platform for your marketing campaigns?
1) how social presence can strengthen a brands persona?
2)discuss buyers journey in digital marketing?
3)how to choose the right social media platform for your marketing campaigns?.
Can anyone help me to understand why Consider a two way ANOVA model.pdfinfo189835
Can anyone help me to understand why? Consider a two way ANOVA model with two factors, ,
of threc levels, and of two levels, with the following regression form:
Yi=01i,22i,33i,24i,2i,25i,3i,2i where the typical definitions of the indicator variables hold (e.g.,
i,21 when the ith unit is in the second level of and i,20 otherwise). Suppose that there is, in fact,
an interaction between factors. Then the mean of the response for units in the first level of the
factor and the first level of the factor is: 1,11,11,1=0=0+4=045 There is not enough information
about the nature of the interaction to answer this question..
can anyone help Prokaryotes are highly successful biological organi.pdfinfo189835
can anyone help? Prokaryotes are highly successful biological organisms found throughout the
world. Their success may be largely attributed to which characteristic? Mutations do not occur in
microbes; thus, they can replicate very quickly. They have cell walls for protection instead of
only cell membranes. They are highly adaptable to a wide variety of environments. They have a
very rapid process for converting DNA into proteins. They have a unique process for converting
DNA into RNA..
Cambios en los Activos y Pasivos Operativos Actuales�M�todo Indirect.pdfinfo189835
Cambios en los Activos y Pasivos Operativos ActualesMtodo Indirecto
El balance general comparativo de Huluduey Corporation para activos y pasivos circulantes fue
el siguiente:
Ajuste la utilidad neta de $75,800 por cambios en los activos y pasivos operativos para llegar al
flujo de efectivo neto de las actividades operativas.
ps31 de diciembre, ao 231 de diciembre, ao 1 Cuentas por cobrar $17,500 $12,500 Inventario
51,650 44,200 Cuentas por pagar 8,480 5,100 Dividendos pagables 9,480 6,100.
California condors (Gymnogyps californianus) are listed on the IUCN .pdfinfo189835
California condors (Gymnogyps californianus) are listed on the IUCN Red List as being
critically endangered. Since 2003, the California Condor Recovery Program has been reporting
their demographic data. In 2021 they estimated the number of individuals living in the wild to be
334. If their intrinsic rate of natural increase is 0.04 ind/year, predict the size of the California
condor population in 2031. (write answer in box and show work).
California continues to face a water shortage. The quantity of water.pdfinfo189835
California continues to face a water shortage. The quantity of water demanded by California
households and businesses far exceeds the quantity supplied. To deal with the situation
California has limited building permits and has installed restrictions on activiites such as
watering lawns and gardens. The best economic explanation of the water shortage is Select one:
A. California has not done enough to find new sources of water B. the price of water is too low
C. there.
Calculate the various ratios based on the following informationCa.pdfinfo189835
Calculate the various ratios based on the following information:
Cash 90,000
Marketable Securities 110,000
Accounts Receivable 232,000
Inventory 140,000
Building (net) 450,000
Other Assets 60,000
Mortgage payable (due in 3 years) 408,000
Notes Payable (due in 6 months) 162,000
Accounts Payable 51,000
Capital Stock 314,500
Retained Earnings 146,500
(1) Current assets: $_______
(2) Current liabilities: $______
(3) The current ratio: ______ to 1
(4) Working capital: $______
(5) Quick ratio: ________to 1.
calculate the return on assets calculate the return on equity ca.pdfinfo189835
calculate the return on assets
calculate the return on equity
calculate ghe net profit margin Example Corporation Income Statement For the year ended
December 31, 2018 Sales (all on credit) Cost of goods sold Gross profit
$500,000380,000120,000 Operating expenses Selling expenses Administrative expenses Total
operating expenses Operating income Interest expense Income before taxes Income tax expense
28,000 Net income after taxes $23,000
BALANCE SHEET.
Calculate the Earnings Per Share (EPS) and Dividends Per Share (DPS).pdfinfo189835
Calculate the Earnings Per Share (EPS) and Dividends Per Share (DPS) for the current year and
explain what occurs to the difference between the EPS value and the DPS value. (6) Please show
the calculation in detail. Your answer makes no sense Daily Corporation Ltd's Statement of
Financial Position for 2020 and 2021 are provided below: Their abbreviated Statement of
Comprehensive Income for the year ended 2021 appeared as follc Note: Their shares are
currently trading at R3 per share..
Cada vez es m�s dif�cil mantenerse al d�a con los problemas tecnol�g.pdfinfo189835
Cada vez es ms difcil mantenerse al da con los problemas tecnolgicos relacionados con la
privacidad. El captulo sobre privacidad en nuestro libro de texto est prcticamente obsoleto ya que
se est entregando a la imprenta. Pgina 320: Cuando creemos errneamente que uno est mirando,
podemos participar en actividades que de otro modo nos abstendramos de hacer.
El 23 de enero de 2017, Wall Street Journal public un artculo: "Los minoristas se estn volviendo
personales: los especialistas en marketing combinan datos y tecnologa para mantener a los
clientes en los sitios y en sus tiendas" por Laura Stevens. En parte, el artculo deca: Sunglass Hut
est empleando tecnologa de aprendizaje profundo y reconocimiento de imgenes de Sentient
Technologies Holdings Ltd., con sede en San Francisco, para su sitio de comercio electrnico.
Cuando un comprador hace clic en un par de gafas de sol, la opcin 'ver estilos similares' utiliza el
reconocimiento de imgenes para mostrar otras opciones de gafas de sol, en lugar de predecir lo
que la persona podra querer en funcin de lo que otras personas han comprado. Adems: El gigante
de la tecnologa SAP SE est trabajando con los minoristas en tecnologa para ayudar a identificar a
los clientes y sus gustos y aversiones tan pronto como ingresan a una tienda, creando ms
experiencia de compra, dijo Lori Mitchell-Keller, gerente general global de industrias de
consumo. . Y, por ltimo, La transformacin digital est sobre ti, lo quieras o no.
El 15 de enero de 2015, el Wall Street Journal public un artculo: La tecnologa que desenmascara
tus emociones ocultas: uso de software de psicologa y reconocimiento facial para estudiar a las
personas mientras compran, miran anuncios; Engendrando miedos a la privacidad por Elizabeth
Dwoskin y Evelyn M. Rusli. Citando brevemente: Paul Ekman, quizs el lector de rostros ms
famoso del mundo, teme haber creado un monstruo.
La psicloga de 80 aos fue pionera en el estudio de las expresiones faciales en la dcada de 1970,
creando un catlogo de ms de 5.000 movimientos musculares para mostrar cmo el ms sutil arrugar
la nariz o levantar una ceja revelan emociones ocultas.
Ahora, un grupo de empresas jvenes con nombres como Emotient Inc., Affectiva Inc. y Eyeris
estn utilizando la investigacin del Dr. Eckman como la columna vertebral de una tecnologa que
se basa en algoritmos para analizar los rostros de las personas y potencialmente descubrir sus
sentimientos ms profundos. Colectivamente, estn acumulando una enorme base de datos visual
de emociones humanas, buscando patrones que puedan predecir reacciones emocionales y
comportamiento a gran escala...
Un minorista est comenzando a probar el software integrado en las cmaras de seguridad que
pueden escanear los rostros de las personas y adivinar sus emociones al entrar y salir de sus
tiendas. Eyeris, con sede en Mountain View, California, dice que ha vendido su software a
agencias policiales federales para su uso en interrogatorios...
La gente podra intentar us.
Cada una de las siguientes cuentas se reporta como pasivo a largo pl.pdfinfo189835
Cada una de las siguientes cuentas se reporta como pasivo a largo plazo excepto
Los intereses a pagar.
Obligaciones con el pblico.
Descuento en Bonos por Pagar.
Prima sobre Bonos por Pagar.
Los intereses a pagar.
Obligaciones con el pblico.
Descuento en Bonos por Pagar.
Prima sobre Bonos por Pagar..
C coding into MIPS coding (Make sure this code works on Qtmips) Ho.pdfinfo189835
C coding into MIPS coding (Make sure this code works on Qtmips)
How can I store arr[1] element into final array[4] position?
How can I store arr[2] element into final array[1] position?
final array is in $t2, array is in $s0, i is in $t4.
ex)
for(i=n-1; i>-0; i--){
final[,,] = arr[i]
}
for(i=0; i.
C++ help !!!!Sally wants to write a program to help with her kee.pdfinfo189835
C++ help !!!!
Sally wants to write a program to help with her keeping track of her Girl Scout cookie sales. The
types of cookies Sally is selling are: Thin Mints, Do-Si-Dos, Samoas, and Adventurefuls. Using
a do while, write the code to print a menu, ask for the type of cookie being sold (T, D, S, or A)
and validate for the input. The code should keep printing the menu and asking for the type of
cookie until a valid code has been entered. Remember to indent..
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
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.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
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!
C++ help finish my code Phase 1 - input phase. Main reads the fi.pdf
1. 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
2. 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
. . .
H upc date price
Add a price history to the grocery item with UPC code upc. The upc, date, and price fields are
fixed in size and
3. separated by blanks. Perform a linear search for the item. If its found, add the history and
display a success
message. If the UPC isnt found, display a not found message. You may assume that you will
never add
more than 25 history items per grocery item.
C upc1 upc2
Compares the number of price history elements for the two items specified by upc1 and upc2. If
the number
of elements is equal, display a message saying they are equal. Otherwise, display a message
saying they are
not equal. Use an operator== overload to implement the comparison. If either upc is not found,
display an
error message.
X
Clean up and exit.
Source code file structure
Separate your code into five source files:
main.cpp main
Grocery.hpp class definition
Grocery.cpp class definition for any member functions
Phistory.hpp class definition
Phistory.cpp class definition for any member functions
My code so far:
main:
//====================================================================
========
// Name :cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//====================================================================
========
#include "Grocery.hpp"
#include "Phistory.hpp"
#include
4. #include
#include
#include
using namespace std;
int main()
{
Grocery groceries[100];
int num_groceries = 0;
// Read input file and populate the Grocery array
ifstream infile;
infile.open("a4data.txt");
if (!infile)
{
cout << "Error: could not open filen";
return 0;
}
string line;
while (getline(infile, line))
{
int upc;
string description;
float cost;
float sellingPrice;
int inventory;
char status;
int priceHistory[25];
int numPriceHistories;
// Read each field from the line
string sub;
int start = 0;
int length = 6;
sub = line.substr(start, length);
upc = stoi(sub);
start += length + 1;
length = 20;
sub = line.substr(start, length);
9. void Grocery::setStatus(char status)
{
this->status = status;
}
void Grocery::displayCH() const
{
cout << "Price history: ";
if (numUsed == 0)
cout << "there is no price history for this item." << endl;
else
{
for (int i = 0; i < numUsed; i++)
cout << priceHistory[i].date << " " << priceHistory[i].historicalPrice << endl;
}
}
Phistory.hpp
#pragma once
#include
#include
using namespace std;
class PriceHistory {
private:
string date;
float price;
public:
// Constructor
PriceHistory(string d, float p) {
date = d;
price = p;
}
// Getter functions
string getDate();
float getPrice();
};
Phistory.cpp
#pragma once
10. #include "Phistory.hpp"
string PriceHistory::getDate() {
return date;
}
float PriceHistory::getPrice() {
return price;
}
the errors I get:
../src/Grocery.cpp:8:10: error: constructor for 'Grocery' must explicitly initialize the member
'price_history' which does not have a default constructor
Grocery::Grocery(int upc, string description, float cost, float selling_price, int inventory, char
status)
^
../src/Grocery.hpp:19:15: note: member is declared here
PriceHistory price_history[25];
^
../src/Grocery.cpp:98:6: error: use of undeclared identifier 'numUsed'
if (numUsed == 0)
^
../src/Grocery.cpp:102:23: error: use of undeclared identifier 'numUsed'
for (int i = 0; i < numUsed; i++)
^
../src/Grocery.cpp:103:12: error: use of undeclared identifier 'priceHistory'; did you mean
'price_history'?
cout << priceHistory[i].date << " " << priceHistory[i].historicalPrice << endl;
^~~~~~~~~~~~
price_history
../src/Grocery.hpp:19:15: note: 'price_history' declared here
PriceHistory price_history[25];
^
../src/Grocery.cpp:103:28: error: 'date' is a private member of 'PriceHistory'
cout << priceHistory[i].date << " " << priceHistory[i].historicalPrice << endl;
^
11. ../src/Phistory.hpp:11:12: note: declared private here
string date;
^
../src/Grocery.cpp:103:43: error: use of undeclared identifier 'priceHistory'; did you mean
'price_history'?
cout << priceHistory[i].date << " " << priceHistory[i].historicalPrice << endl;
^~~~~~~~~~~~
price_history
../src/Grocery.hpp:19:15: note: 'price_history' declared here
PriceHistory price_history[25];
^
../src/Grocery.cpp:103:59: error: no member named 'historicalPrice' in 'PriceHistory'
cout << priceHistory[i].date << " " << priceHistory[i].historicalPrice << endl;