Questions
Let the following be the supply and demand for coconuts. P 2 3 4 5 6...

Let the following be the supply and demand for coconuts.

P 2 3 4 5 6 7 8 9 10 11 12

Qs 100 200 300 400 500 600 700 800 900 1000 1100

QD 550 500 450 400 350 300 250 200 150 100 50

Now imagine that there is a price ceiling on coconuts at $3 but in order to prevent wasting peoples' time by making them wait in line, the government hands out ration coupons to people. In order to buy a coconut you need a coupon. Assume that the number of coupons is the appropriate number to clear the market with the price ceiling (you should know what that is). Now notice that the government probably doesn't know who has the highest marginal value for coconuts so, while this will eliminate the waste from the line it will most likely not allocate the coconuts efficiently. However, we can solve this problem by allowing people to trade the coupons! So imagine that there is such a market and it is perfectly competitive.

a. What will the price of a coupon be in this market?

b. Draw the price ceiling graph and identify the consumer and producer surplus, and the dead weight loss. There should be an area in there which would have been the cost of the line had there been a line. Label this area "A." Who gets this surplus now?

In: Economics

Programming Project #6: Bowling Team need to use python Problem Expected Duration: 3-4 hours Prerequisites: None...

Programming Project #6: Bowling Team

need to use python

Problem

Expected Duration: 3-4 hours

Prerequisites: None

Knowing that you are a budding programmer, your friends have asked you to create a scoring program for your Saturday bowling league. Your program should take a name, team number, and score for each player, and should deal with any number of players, but have 3 people to a team.
Your program should ignore invalid inputs, and not crash. Your program should print the following lists in columns:

  1. the individual names, team and scores in descending order with high scorer at the top
  2. the individual names, team and scores in alphabetical order
  3. If anyone scores a perfect game, put an asterisk in front of their name.
  4. The top 3 teams with the highest total scores and their score
  5. Display a congratulatory message showing the individual high score and list who got it.
  6. Display a sympathetic message showing the individual low score and who got it.

Last, your program should write each of the lists and the summary information
to a text file called game_results.txt in the same format it is displayed on the screen.

Note: You have the option of using pandas Dataframes in your program. Just make sure the console and file output
has the required structure and format.

In: Computer Science

Write a program that implements a stack of integers, and exercises the stack based on commands...

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<int> 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

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

The last dividend on Spirex Corporation's common stock was $5.94, and the expected growth rate is 10 percent.

The last dividend on Spirex Corporation's common stock was $5.94, and the expected growth rate is 10 percent. If you require a rate of return of 29.7 percent, what is the highest price you should be willing to pay for this stock?

In: Finance

Stoics like Seneca believed that the pursuit of virtue and practice of reason are the highest goods, and that men must accept their lots in life without undue displays of emotion or complaint.


Stoics like Seneca believed that the pursuit of virtue and practice of reason are the highest goods, and that men must accept their lots in life without undue displays of emotion or complaint. How does this letter reflect a Stoic outlook?

In: Economics

((5.11x10^3))((1.880x10^-2))((2.92x10^5)) / ((9.5x10^-7))((7.64x10^2)) Record your answer in scientific notation with 2 significant digits. Note: Your answer...

((5.11x10^3))((1.880x10^-2))((2.92x10^5)) / ((9.5x10^-7))((7.64x10^2))

Record your answer in scientific notation with 2 significant digits. Note: Your answer is assumed to be reduced to the highest power possible.

In: Chemistry

How Does SpaceX's rocket launch relate to Physical science? Using force and physics? With 200 words...

How Does SpaceX's rocket launch relate to Physical science? Using force and physics? With 200 words please explain.

Artcile: https://www.scientificamerican.com/article/spacex-launches-rocket-with-highest-ever-reentry-force/

In: Physics

a laser beam passes through a diffraction grating and the second- order bright spot is produced...

a laser beam passes through a diffraction grating and the second- order bright spot is produced at an angle of 22.0 degree from the main central axis. What is the highest order bright spot that can be produced by this arrangement?

In: Physics

Indicate, from the following, which has the second-highest predicted entropy at 298.15 K. 1.0 mol HCN...

Indicate, from the following, which has the second-highest predicted entropy at 298.15 K.

1.0 mol HCN

0.23g of HCN

0.5 mol HCN

15.0 kg HCN

All of these have the same entropy

In: Other