You are provided with a partial implementation of a templated singly-linked list in LinkedList.h, with some missing functionality. It contains a templated Node class and a templated LinkedList class. Do not modify the class definitions.
The linked list class contains the following methods:
• LinkedList – Constructor of a linked list with a head pointing to null (implemented).
• ~LinkedList – Destructor of a linked list.
• deleteFromHead – Removes and returns content of the first node of the list. (If the list is empty, does nothing.)
• deleteFromTail – Removes and returns content of last node of the list. (If the list is empty, does nothing.)
• deleteNode – Removes node with provided data from the list.
• InsertToHead – Inserts node with provided data at the head (implemented).
• InsertToTail – Inserts node with provided data at the tail. • getSize – Returns the number of nodes in the linked list.
• print - Prints the linked list (implemented).
Notice that while the declaration and implementation of classes are typically split between .cpp and .h files, some compilers cannot handle templates in separate files, which is why we include both the declaration and implementation in a single .h file. The main.cpp file consists of sample test code for each of the tasks below. Your code, which should be added to the provided LinkedList.h will be compiled and run with variations of this file. Submit your modified LinkedList.h file only
LinkedList.h:
#ifndef LinkedList_h #define LinkedList_h #include <iostream> using namespace std; template <class T = int> class Node { public: Node(); // default constructor Node(const T& data, Node<T>* next = nullptr); // donstructor T data; // node data Node<T>* next; // node next pointer }; template <class T = int> class LinkedList { public: LinkedList(); // constructor ~LinkedList(); // destructor T deleteFromHead(); // removes and returns content of head T deleteFromTail() // removes and returns content of tail void deleteNode(T data) // removes node with specified data void InsertToHead(T data); // insert node with data at the head void InsertToTail(T data); // insert node with data at the tail int getSize(); // returns size of linked list void print(); // prints linked list private: Node<T>* head; // head of linked list }; /******* From here down is the content of the LinkedList.cpp file: ***********************/ /* Implementation of Node */ // default constructor template<class T> Node<T>::Node() { } // constructor template<class T> Node<T>::Node(const T& data, Node<T>* next) { this->data = data; this->next = next; } /* Implementation of linked list */ // constructor template <class T> LinkedList<T>::LinkedList() { head = nullptr; } // destructor template <class T> LinkedList<T>::~LinkedList() { /*** to be implemented ***/ } template <class T> T LinkedList<T>::deleteFromHead() { /*** to be implemented ***/ } template <class T> T LinkedList<T>::deleteFromTail() { /*** to be implemented ***/ } template <class T> void LinkedList<T>::deleteNode(T data) { /*** to be implemented ***/ } template <class T> void LinkedList<T>::InsertToHead(T data) { Node<T> * newNode = new Node<T>(data, nullptr); if (head == nullptr) head = newNode; else { newNode->next = head; head = newNode; } } template <class T> void LinkedList<T>::InsertToTail(T data) { /*** to be implemented ***/ } template <class T> int LinkedList<T>::getSize() { /*** to be implemented ***/ } template <class T> void LinkedList<T>::print() { if (head == nullptr) { cout << "Linked list is empty" << endl;; return; } cout << head->data << " "; if (head->next == nullptr) { cout << endl; return; } Node<T>* currNode = head->next; Node<T>* prevNode = head; while (currNode->next != nullptr) { cout << currNode->data << " "; prevNode = currNode; currNode = currNode->next; } cout << currNode->data << endl; return; } #endif /* LinkedList_h */
In: Computer Science
In: Math
How does Johnson & Johnson's culture support its business model? Can you determine any ways in which its top-management team influences its culture?
In: Operations Management
"The Effects of Forgiveness Therapy on Depression, Anxiety, and
Posttraumatic Stress for Women After Spousal Emotional Abuse"
by Gayle L. Reed and Robert D. Enright
Develop a summary of the main concepts from the article. Do not duplicate the article’s abstract. If the article describes a research study, include brief statements about the hypotheses, methods, results, discussion, and implications. If any test measures or statistical methods used are given in the article, do not provide detailed descriptions of these. Short direct quotations from the article are acceptable, but avoid long quotes in a paper this size. Make sure you include the core points from the article.
In: Psychology
Will Jones, LLP is a small CPA firm that focuses primarily on
preparing tax returns for small businesses. The company pays a $500
annual fee plus $10 per tax return for a license to use Mega Tax
software.
(a) What is the company’s total annual cost for
the Mega Tax software if 300 returns are filed? If 400 returns are
filed? If 500 returns are filed?
Total cost for 300 returns:
Total cost for 400 returns:
Total cost for 500 returns:
(b) What is the company’s cost per return for the Mega Tax software if 300 returns are filed? If 400 returns are filed? If 500 returns are filed? (Round answers to 2 decimal places, e.g. 52.75.)
Cost per unit (300):
Cost per unit (400):
Cost per unit (500):
In: Finance
What are some of the operating challenges related to Supply Chain Management, that the Canadian company may be facing With new ventures?
In: Operations Management
In: Biology
Josh worked for the Johnson Boat Works Company as a maintenance welder for 15 years. At the beginning of each five years of employment, Josh signed a five-year work agreement with the company. Soon after Josh had signed a new five-year agreement, Josh was fired by the new owner of the company. At the time of his firing, Josh was making $25 an hour and his employer-paid benefit package, which included health care and other government mandated items, was worth about 20% of his wages. Although Josh started looking for a new similar job right away, it was eight months before he got a new job. The new job pays $22 per hour, but it is on a contract that pays no benefits other than his wages. On advice from his attorney he recently filed a wrongful discharge case against Johnson Boat Works.
Assume that the Johnson Boat Works Company is found liable for the firing of Josh. Also assume a 40-hour work week and a 52-week work year. Josh worked for 13 weeks during the first year at the new job. Assume that he continued to work at his new job for all of years two and three, and that during the fourth and fifth years, Josh lost his contract job and had to work a minimum wage job at $15,000 a year with employer paid benefits that amounted to 10% of his wages. Using only the information above, what is the total amount of damages suffered by Josh during the entire five-year contract period? [Provide one total dollar amount for the damages.]
Show clearly labeled and organized computations below. Do not adjust for present value.
In: Accounting
3. (20 pts) Hilton Financial Inc. has just obtained $240,000 for investment and would like to maximize investment return. The firm’s top financial analyst recommends that all new investments be made in the automobile industry (Ford, Honda), retail industry (Target, Wal-Mart), or in government bonds. Specifically, the analyst identified five investment opportunities and projected their annual rates of return:
Investment Projected Rate of Return
Ford 12%
Honda 11%
Target 8%
Wal-Mart 6%
Government Bonds 5%
Management of Hilton imposed the following guidelines:
1. Neither industry (automobile or retail) should receive more than $140,000.
2. Government bonds should be at least 25% of the retail industry investments.
3. The investment in Ford can not be more than 65% of the total automobile industry investment.
5. No more than 60% of the total funds invested in stock (automobile and retail) may be invested in the automobile industry, and no more than 55% of the funds invested in stock (automobile and retail) may be invested in the retail industry.
Formulate a linear programming model of the problem to find out how much to invest in each security.
3. (20 pts) Hilton Financial Inc. has just obtained $240,000 for investment and would like to maximize investment return. The firm’s top financial analyst recommends that all new investments be made in the automobile industry (Ford, Honda), retail industry (Target, Wal-Mart), or in government bonds. Specifically, the analyst identified five investment opportunities and projected their annual rates of return:
Investment Projected Rate of Return
Ford 12%
Honda 11%
Target 8%
Wal-Mart 6%
Government Bonds 5%
Management of Hilton imposed the following guidelines:
1. Neither industry (automobile or retail) should receive more than $140,000.
2. Government bonds should be at least 25% of the retail industry investments.
3. The investment in Ford can not be more than 65% of the total automobile industry investment.
5. No more than 60% of the total funds invested in stock (automobile and retail) may be invested in the automobile industry, and no more than 55% of the funds invested in stock (automobile and retail) may be invested in the retail industry.
Formulate a linear programming model of the problem to find out how much to invest in each security.
In: Operations Management
On October 29, 2017, Lobo Co. began operations by purchasing
razors for resale. Lobo uses the perpetual inventory method. The
razors have a 90-day warranty that requires the company to replace
any nonworking razor. When a razor is returned, the company
discards it and mails a new one from Merchandise Inventory to the
customer. The company's cost per new razor is $15 and its retail
selling price is $80 in both 2017 and 2018. The manufacturer has
advised the company to expect warranty costs to equal 6% of dollar
sales. The following transactions and events occurred.
2017
Nov. | 11 | Sold 70 razors for $5,600 cash. | ||
30 | Recognized warranty expense related to November sales with an adjusting entry. | |||
Dec. | 9 | Replaced 14 razors that were returned under the warranty. | ||
16 | Sold 210 razors for $16,800 cash. | |||
29 | Replaced 28 razors that were returned under the warranty. | |||
31 | Recognized warranty expense related to December sales with an adjusting entry. |
2018
Jan. | 5 | Sold 140 razors for $11,200 cash. | ||
17 | Replaced 33 razors that were returned under the warranty. | |||
31 | Recognized warranty expense related to January sales with an adjusting entry. |
Problem 9-4A Part 1
1a. Prepare journal entries to record above
transactions and adjustments for 2017.
1b. Prepare journal entries to record above
transactions and adjustments for 2018.
2. How much warranty expense is reported for November 2017 and for December 2017?
3. How much warranty expense is reported for January 2018?
4. What is the balance of the Estimated
Warranty Liability account as of December 31, 2017?
5. What is the balance of the Estimated Warranty
Liability account as of January 31, 2018?
In: Accounting
Write a program that utilizes a Professor class. A professor has a first name, last name, affiliation, easiness grade, and a helpfulness grade. Grades range from 1 (lowest) to 5 (highest). The Professor class has two constructors. The first constructor initiates the object with just the first name, the last name, and the affiliation. The default value for easiness and helpfulness grade is 3. The second constructor initiates the object using the first name, the last name, the affiliation, and two grades.
The Professor class must not allow a first name or last name to be changed after instantiation.
The affiliation should be implemented as a property.
The grades should have both an accessor method and a mutator method. The Professor class should have a display method that prints all member variables in an appropriate format. For example, you can print out the first name, the last name, affiliation, and the two grades from the display method.
The Professor class should have a ToString() method. Make sure to override the ToString() method to present something meaningful.
Lastly, you should use the Main() method to demonstrate how the Professor class works. For example, create an instance of the Professor class with one of its two constructors. And then, invoke the display method on the instance.
Were using Visual Studios C# console.
This is the program requirements we are working on.
Can you write comments that explain the steps? Or how you get
the result for the steps you write.
In: Computer Science
The cash account for American Medical Co. at April 30 indicated a balance of $13,140. The bank statement indicated a balance of $15,360 on April 30. Comparing the bank statement and the accompanying canceled checks and memos with the records revealed the following reconciling items:
A. Checks outstanding totaled $5,530.
B. A deposit of $5,760, representing receipts of April 30, had been made too late to appear on the bank statement.
C. The bank collected $3,000 on a $2,840 note, including interest of $160.
D. A check for $550 returned with the statement had been incorrectly recorded by American Medical Co. as $500. The check was for the payment of an obligation to Targhee Supply Co. for a purchase on account.
E. A check drawn for $50 had been erroneously charged by the bank as $500.
F. Bank service charges for April amounted to $50.
1)Prepare a Bank Reconciliation
2) Journalize the necessary entries (a.) that increase cash and (b.) that decrease cash. The accounts have not been closed. For a compound transaction, if an amount box does not require an entry, leave it blank.
3) If a balance sheet is prepared for American Medical Co. on April 30, what amount should be reported as cash?
In: Accounting
4). Eight maintenance activities, their normal durations in weeks, and the crew sizes for the normal condition are as follows:
Activity |
Duration in Weeks |
Crew size |
AC |
6 |
8 |
BC |
6 |
7 |
BE |
2 |
6 |
CD |
3 |
2 |
CE |
4 |
1 |
DF |
7 |
4 |
EF |
4 |
6 |
FG |
5 |
10 |
Extra Crew |
Weeks Saved |
Crash cost per week |
1 |
1 |
$100 |
2 |
2 |
$120 |
3 |
2 |
$200 |
4 |
3 |
$250 |
If there is a penalty cost of $1,250 per week beyond the minimum maintenance time of 20 weeks, recommend the minimum cost schedule.
Activity |
Optimistic |
Most Likely |
Pessimistic |
AC |
5 |
6 |
8 |
BC |
4 |
6 |
10 |
BE |
2 |
2 |
2 |
CD |
2 |
3 |
7 |
CE |
2 |
4 |
9 |
DF |
5 |
7 |
13 |
EF |
3 |
4 |
6 |
FG |
4 |
5 |
16 |
In: Operations Management
areaCircle() – should accept the radius of the circle from the
main function, calculate the area, and then print the area of the
circle.
In: Computer Science
A 6% annual coupon bond has 11 years remaining until maturity. Par value is $1000. | |||||
The required rate of return (yield to maturity)on the bond is 8.5%. | |||||
Compute the price of the bond today using the appropriate Excel formula | |||||
Compute the price of the same bond if it has 10 years remaining to maturity instead of 11. | |||||
What is the capital gains yield on the bond? | |||||
What is the current yield on the bond? | |||||
What is the total yield on the bond? | |||||
What will the bond's price be at the instant before it matures? | |||||
SHOW WORK HERE, HIGHLIGHT FINAL ANSWERS IN YELLOW | |||||
11 years | 10 years | ||||
PV | |||||
RATE | |||||
NPER | |||||
PMT | |||||
FV | |||||
In: Finance