Questions
Implementing a Stack Write a program that implements a stack of integers, and exercises the stack...

Implementing a Stack

Write a program that implements a stack of integers, and exercises the stack based on commands read from cin. To do this, write a class called Stack with exactly the following members: class Stack { public: bool isEmpty(); // returns true if stack has no elements stored int top(); // returns element from top of the stack // throws runtime_error("stack is empty") int pop(); // returns element from top of the stack and removes it // throws runtime_error("stack is empty") void push(int); // puts a new element on top of the stack private: vector elements; }; The program should read commands from cin until either end-of-file is reached or the command end is entered. (You can manually test for end-of-file by entering CTRL-D.) Each time the program expects a new command it should first print a prompt: "stack> " Your program should catch all errors that happen and continue execution until the end command or end-of-file. In case the command push is read, the program should read an integer value from cin and push it onto the stack. In case top is read, the program should print the top integer of the stack to cout. In case pop is read, the program should print the top integer of the stack to cout, and remove it from the stack. In case the command list is read, the program should print all values currently on the stack, without modifying the stack. (Exact format see below.) Your program should check whether a "number" to be pushed is actually a number. If not, print an error message (see below), and reset cin such that it will again accept commands. (See Section 7.6 of the zyBook.) Also, your program should ignore all characters behind a number to be pushed that are on the same input line (example see below). An example of a correct execution of this program is shown below: stack> push 5 stack> pop 5 stack> pop error: stack is empty stack> push 6 stack> push 4bb stack> push foo error: not a number stack> list [4,6] stack> list [4,6] stack> top 4 stack> hello error: invalid command stack> end You may want to use the compare() function (Links to an external site.) on a string to check which command has been entered. Use of arrays, a built-in stack class, or container classes from std:: other than vector, is not allowed.

In: Computer Science

how can i make my career portfolio ? give any example of any public job, and...

how can i make my career portfolio ? give any example of any public job, and what are contents of career portfolio

In: Operations Management

Assembly language program create a program that outputs a picture that represents halloween in ASCll art...

Assembly language program
create a program that outputs a picture that represents halloween in ASCll art (jack-o-lantern, witch's hat, etc)

In: Computer Science

Write java programs to implement CBC mode of data encryption standard?

Write java programs to implement CBC mode of data encryption standard?

In: Computer Science

An investor estimates that next​ year's sales for​ Dursley's Hotels,​ Inc., should amount to about ​$96...

An investor estimates that next​ year's sales for​ Dursley's Hotels,​ Inc., should amount to about ​$96 million. The company has 4.5 million shares​ outstanding, generates a net profit margin of about 8.8​%, and has a payout ratio of 42​%. All figures are expected to hold for next year. Given this​ information, compute the following.

a. Estimated net earnings for next year.

b. Next​ year's dividends per share.

c. The expected price of the stock​ (assuming the​ P/E ratio is 24.9 times​ earnings).

d. The expected holding period return​ (latest stock​ price: ​$32.87 per​ share).

In: Finance

How does China manifest themselves in the enforcement and interpretation of law and order?

How does China manifest themselves in the enforcement and interpretation of law and order?

In: Psychology

Allen starts putting away $400 each month starting at the age of 25 in mutual funds...

Allen starts putting away $400 each month starting at the age of 25 in mutual funds earning about 7.5% per year. Beth invests the same funds but starts putting away $800 each month starting at age 33. How much money does each person have at age 60? Who ends up with more retirement money?

In: Finance

How do you validate in pseudocode a "REPEAT" "UNTIL" loop? For example if a user inputs...

How do you validate in pseudocode a "REPEAT" "UNTIL" loop? For example if a user inputs invalid data there should be an error message that reprompts for correct data.

To show this can you write Pseudo Code for the following problem?

Create an application that can determine the yearly bonus for all company employees. Not all employees are eligible for a yearly bonus. Only employees that have been with the company longer than 2 years and must have been given a rating of “Great”. Employees receiving a rating of “Bad” are not eligible for a bonus. Lastly, each department awards a different bonus amount based on percentage of yearly salary as shown below.

IT = 5% bonus

Sales=8% bonus

The application should allow the user to continually input employee data until the HR representative has reviewed all employees and has indicated they are finished entering employee data. One by one, the application will enable the HR representative to input an employee’s name, years of service, department, rating and salary. Based on data provided, the application must print well-formatted detail stating whether or not the employee is eligible for a bonus. For employees eligible for a bonus, the application must also print the amount of the bonus to be awarded to the employee. Upon completion of entering all employee data, the application will print a report that includes the total number of employees entered by the HR representative, a count of employees that are eligible for a bonus, and the average bonus amount.

In: Computer Science

Depreciation on the company's equipment for the year is computed to be $12,000. The Prepaid Insurance...

  1. Depreciation on the company's equipment for the year is computed to be $12,000.
  2. The Prepaid Insurance account had a $7,000 debit balance at December 31 before adjusting for the costs of any expired coverage. An analysis of the company’s insurance policies showed that $1,930 of unexpired insurance coverage remains.
  3. The Office Supplies account had a $520 debit balance at the beginning of the year; and $2,680 of office supplies were purchased during the year. The December 31 physical count showed $614 of supplies available.
  4. One-fourth of the work related to $11,000 of cash received in advance was performed this period.
  5. The Prepaid Rent account had a $5,900 debit balance at December 31 before adjusting for the costs of expired prepaid rent. An analysis of the rental agreement showed that $3,970 of prepaid rent had expired.
  6. Wage expenses of $5,000 have been incurred but are not paid as of December 31.


Prepare adjusting journal entries for the year ended (date of) December 31 for each of these separate situations.

In: Accounting

ANSWER ASAP Please watch either Big Bucks, Big Pharma DOCUMENTARY. Link for the documentary on youtube:...

ANSWER ASAP

Please watch either Big Bucks, Big Pharma DOCUMENTARY. Link for the documentary on youtube: https://www.youtube.com/watch?v=D1uARFrI9U4&feature=youtu.be

answer the following questions:

1- What were the main argument(s) of the documentary?

2- What are your reactions after watching the video?

3- The pharmaceutical industry often uses direct-to-consumer advertising (DTCA) in order to profit. The U.S. is one of the few countries where DTCA is still legal. Do you think DTCA should be legal? Why or why not?

4- In what ways does healthcare and big pharma contribute to social control and medicalization? Discuss and provide examples.  

In: Psychology

Background: Johnson & Johnson is a global market leader when it comes to Baby products including...

Background: Johnson & Johnson is a global market leader when it comes to Baby products including Wipes & Toiletries (Shampoo, Conditioner, Powder, Moisturizer)

Situation: A recent accusation was risen against J&J highlighting that their products contain Talcum Powder which contains cancerous substances which later-on reflect onto the baby after usage. This accusation was scientifically proven to be FALSE. However, effect of worldwide media negatively impacted the general perception of consumers & thus, is still resulting in J&J shares decline. One vital market where this accusation was blown out of proportion is India. The average Indian consumer is believed to avoid any J&J product today as a result of the false news.

Question: What can J&J propose as a long-lasting, sustainable solution, in terms of population awareness in the UAE in order to bring back the faith of the Indian consumer and win them over again from competitors?

HINT: A good example would be the way Coca Cola advertisements & commercials appeal to sympathy & emotions, giving consumers the perception that they care on a personal level.

In: Operations Management

A Euro-Zone bond portfolio manager is looking to invest € 1,000,000. She has a choice between...

A Euro-Zone bond portfolio manager is looking to invest € 1,000,000. She has a choice between either a Euro-denominated bond with a 4% annualized return, and a 6-month (180 days) maturity, or a New Zealand dollar (NZD)- denominated bond with a 7% annualized return and also a 6-month maturity. Both bonds are AA rated. If the portfolio manager is not allowed to take any FX risk (meaning she must hedge all FX risks), which of the two bonds should she choose in order to maximize her return?

Market data:

NZD/EUR Spot rate: 1.8550 / 1.8600

NZD/EUR 6-month forward rate: 1.8900 / 1.8950

Assume a 360-day year.

In: Finance

Explain TCO and describe how virtualization can reduce TCO.

Explain TCO and describe how virtualization can reduce TCO.

In: Computer Science

What is are the correct code implementations to remove a node from a circular doubly linked...

What is are the correct code implementations to remove a node from a circular doubly linked list from the beginning, middle, and end? Using only a dummy node and a pointer in the code implementation for the removal of the last/end node.

In: Computer Science

What decimal number is represented by the binary 2’s complement 8-bit number 11100111? Show your work

What decimal number is represented by the binary 2’s complement 8-bit number 11100111? Show your work

In: Computer Science