Questions
Subject is C++ Write a program to compute internet charges according to a rate schedule. The...

Subject is C++

Write a program to compute internet charges according to a rate schedule.

The rate schedule is as follows:

$0.08 per GB for usage between 0 and 40 GB, inclusive

$0.07 per GB for usage between 41 GB and 70 GB, inclusive

$0.05 per GB for usage between 71 GB and 110 GB, inclusive

$0.04 per GB for usage greater than 110 GB

code must use these four functions, using these names (in addition to main):

  1. getData
  2. computeCharges
  3. printAccountInfo
  4. printTotals

Requirements for the getData Function

Purpose:

This function prompts the user for an account number (integer) and a GB value (integer). It passes these values back to main via two output parameters.

Output Parameters:

  1. account number (as an integer)
  2. GB value (as an integer)

Algorithm:

Prompt and read. There must be only one prompt, and the user must enter the data on one line with a space between each value.

Return value:

None

Requirements for the computeCharges Function

Purpose:

This function computes the charges for one transaction. It uses one input parameter (GB value as an integer) and a return value (amount of the charge, which may include decimals).

Input Parameter:

  1. GB value (as an integer)

Algorithm:

Use a selection structure to determine the charge per GB, using the above rate schedule. Calculate the charges using multiplication.

Return value:

Transaction charges (may include decimals)

Requirements for the printAccountInfo Function

Purpose:

This function displays the information for one account transaction to the screen.

Input Parameters:

  1. account number
  2. GB value
  3. Transaction charges

Algorithm:

Print, using appropriate spacing and formatting. The transaction charges must display with two decimal places.

Return value:

None

Requirements for the printTotals Function

Purpose:

This function displays totals to the screen at the end of the program.

Input Parameters:

  1. Total number of accounts
  2. Sum of all GB values
  3. Sum of all transaction charges

Algorithm:

Print, using appropriate spacing and formatting. The sum of transaction charges must display with two decimal places.

Return value:

None

Requirements for main:

  1. Variable declarations in main should only include the variables needed within main. Do not declare all the variables needed in the program here – only the ones needed within main.
  2. The main function must use a conditional loop that prompts the user to enter a Y or an N to indicate if they wish to continue adding more input. Your code must be able to handle lowercase or uppercase: y, Y, n, or N.

Be sure the first prompt is for actual data, not the continuation response.

IMPORTANT NOTE ABOUT THIS LOOP – You will encounter the situation where there is a scanf for a number immediately before the scanf for the Y or N. We have seen this problem before…

  1. The loop body calls the appropriate functions with the appropriate arguments and return values, if necessary. Within the loop, you must keep track of the totals needed by the printTotals function.
  2. When the loop is complete, call the print_totals function with the appropriate arguments.
  3. All prompts and output must display exactly as demonstrated in the sample runs below. Pay attention to spacing and alignment!

Sample Run

Enter account number and GB used (one space between data): 12345 80
Account number: 12345        GB Used:     80        Charge:     4.00

Do you wish to continue? (y/n) y

Enter account number and GB used (one space between data): 98765 25
Account number: 98765        GB Used:     25        Charge:     2.00

Do you wish to continue? (y/n) Y

Enter account number and GB used (one space between data): 25413 120
Account number: 25413        GB Used:    120        Charge:     4.80

Do you wish to continue? (y/n) Y

Enter account number and GB used (one space between data): 42598 50
Account number: 42598        GB Used:     50        Charge:     3.50

Do you wish to continue? (y/n) n

Total accounts =        4
Total GB Used =       275
Total Charges =     14.30

In: Computer Science

Alpha Electronics is a profit-maximizing firm and it can produce any one of the following three...

Alpha Electronics is a profit-maximizing firm and it can produce any one of the following three combinations of HD TV sets per production run, operating at capacity. Its total cost per production run is $1,500. The market price for the Large Screen, Medium Screen, and Small Screen models are $11, $9, and $7, respectively.

A

B

C

LARGE SCREEN

80

90

100

MED SCREEN

50

40

40

SMALL SCREEN

40

30

20

  1. The total cost associated with combination B is _______.
  2. This firm will produce combination ________.
  3. If the market price of a Large Screen increases to $12, ceteris paribus, then this firm will produce combination _______.

In: Economics

A company is considering two mutually exclusive expansion plans. Plan A requires $28,000 initial expenditure on...

A company is considering two mutually exclusive expansion plans. Plan A requires $28,000 initial expenditure on a large scale integrated plant, whereas Plan B requires $20,000 to build a somewhat less efficient but labor intensive plant. The firm’s expected WACC is 14%. The expected cash flows from both projects are listed below:

Years

Plan A

Plan B

1

7186

4660

2

8326

5476

3

7108

5266

4

6377

4743

5

6376

5403

6

5828

5012

7

5280

4620

Note: Add last three digits of your enrollment number which is 015 in each cash outflow (all seven years and not initial investment) before starting this question.

Requirements:

Take a decision on behalf of the above-mentioned firm.

  1. Find the payback period for Plan A and Plan B. According to the payback criterion, which project should be accepted if the firm’s maximum acceptable payback is 4 years?
  2. Hurdle rate for IRR is 15%. Which project should be accepted?
  3. Also find NPV and PI of both projects.

In: Finance

Lucky Buy Company’s stock has suffered due to several warranty-related lawsuits filed against the company. The...

  1. Lucky Buy Company’s stock has suffered due to several warranty-related lawsuits filed against the company. The company revamped their warranty program and introduced additional customer services to improve the customer experience. Yet, its stock price is only $13 per share. Management is planning a two-for-seven reverse stock split to increase the stock price and bring it closer to the average stock price in the industry. Assume that John Thornton, the last remaining co-founder of the firm, owns 420,000 shares. (7 points)
  1.    How many shares will he own after the reverse stock split?
  2. What is the anticipated price of the stock after the reverse stock split?
  3.    Because investors often have a negative reaction to a reverse stock split, assume the stock only goes up to 85 percent of the value computed in part b. What will the stock’s price be?
  4. How will the total value of John Thornton’s holdings change from before the reverse stock split to after the reverse stock split (based on the stock value computed in part c)?

In: Finance

Your company needs to raise $44 million to finance a new factory. You’re evaluating two different...

Your company needs to raise $44 million to finance a new factory. You’re evaluating two different 20-year bonds to raise these funds: a coupon bond with an annual coupon rate of 8 percent; and a zero coupon bond. Your company’s tax rate is 40 percent. Both bonds will have a par value of $1,000 and a  required annual return of 8 percent with semi-annual compounding.

a-1. How many of the coupon bonds would you need to issue to raise the $44 million?
  Number of coupon bonds   
a-2. How many of the zeroes would you need to issue? (Do not round intermediate calculations and round your answer to 2 decimal places, e.g., 32.16.)
  Number of zero coupon bonds   
b-1.

In 20 years, what will your company’s repayment be if you issue the coupon bonds? (Do not round intermediate calculations and enter your answer in dollars, not millions of dollars, i.e. 1,234,567.)

  Coupon bonds repayment $   
b2.

What is the repayment if you issue the zeroes? (Do not round intermediate calculations and enter your answer in dollars, not millions of dollars, i.e. 1,234,567.)

  Zeroes repayment $   

  

c.

Calculate your company's total after-tax cash flow during the first year for each type of bond (don't include the initial amount raised). Don't forget to adjust the cash flow for taxes. (Do not round intermediate calculations and enter your answers in dollars, not millions of dollars, i.e. 1,234,567.)

  

  Coupon bonds   (Click to select)Outflow /Inflow $   
  Zero coupon bonds   (Click to select)Outflow/ Inflow $   

In: Finance

This Tuesday evening at 7:05 p.m., Justin Wolfers, an economics professor at the University of Michigan,...

This Tuesday evening at 7:05 p.m., Justin Wolfers, an economics professor at the University of Michigan, started a provocative Twitter thread about panic buying. Spurred by fear of the spreading coronavirus, shoppers have been mobbing stores worldwide. They’re stockpiling canned goods, flour, sugar, bottled water, hand sanitizer—and toilet paper.

In Australia, where Wolfers was born, one desperate customer reportedly pulled a knife trying to score the last roll on the shelf at a Woolworths Supermarket in Sydney.

Wolfers believes desperate buyers aren’t crazy. “The economics of toilet paper shortages is the same as bank runs,” he tweeted. You stockpile toilet paper because others are stocking up too, depleting supplies.

“My argument is simply that panic buying can be rational,” said Wolfers in a phone interview with Forbes on Wednesday. “There is nothing inherent in markets that prevents this.” Until the FDIC started guaranteeing bank deposits in 1933, it made sense for nervous savers to pull their money out when they saw their neighbors doing the same.

What can be done to preclude toilet paper shortage-sparked violence? “The U.S. needs a strategic toilet paper reserve,” said Wolfers, guaranteeing that Americans have the supplies they need should stores run out.

In all seriousness, what does Wolfers think fear-sparked buying means for U.S. retailers like Costco, Walmart, Target and Kroger? “In the short term it’s good news,” he says, because extra purchases spike revenues. But in the long run, it’s unlikely to change those companies’ fortunes. “Once they have more toilet paper, people aren’t going to poo more,” he says. They’ll wait until their supply runs out to make further purchases.

Oliver Chen, a retail analyst at Cowen in New York, says virus-driven panic buying is giving a boost to curbside services offered by companies like Target and Walmart. Target reported this week in an earnings call that once customers try the service, where they order and pay online and then pick up their purchases at a designated spot outside a store, they increase their spending at Target by 25%. Cowen estimates that only 10% to 11% of shoppers use the service, leaving plenty of room for growth.

One more plus for retailers: “When you use the curbside service, it increases your loyalty as a shopper,” says Chen. He predicts that panic buying will drive up sales by 1% to 2% in the first quarter at retailers who sell groceries and staples. Given that operating margins are a low 3% to 7%, even a small increase in sales is significant.

Sucharita Kodali, an analyst at Forrester, says many retailers have missed an opportunity to hike prices during the scare. “What should have been a winning lottery ticket these guys were handed, they basically squandered,” she says. Without gouging customers, stores could have easily hiked prices by 10% or more on staples and banked the extra profit. “A lot of retailers foolishly let that opportunity pass,” she says. (Most state price-gouging laws, barring increases of 10% or more, only kick in after a state of emergency has been called.)

Wolfers disagrees with Kodali about the wisdom of price hikes during a perceived public health crisis. “Costco’s implicit promise to the customer is, ‘We will never screw you,’” he says. “Raising prices on toilet paper would destroy that trust.”

Rupesh Parikh, a retail analyst at Oppenheimer, says Costco made the right call to hold prices steady. “Costco is a company that puts the customer at the center of everything they do,” he says.

Today Costco reported that February 2020 sales increased 13.8% over the previous year due to “concerns over the coronavirus.” Though Parikh rates the stock a “buy,” he doesn’t believe the Issaquah, Washington-based chain, whose revenue hit $155 billion last year, will benefit from coronavirus buying in the long run. Shoppers who bought extra staples in February will wait to replenish them, possibly causing a sales dip in coming months. “If people don’t use up their supplies, that poses a risk going forward,” he says.

In Australia, where there are 52 confirmed cases of coronavirus including 2 deaths, a Costco store in Canberra has reportedly set limits on toilet paper purchases. Customers can buy no more than two 48-roll packs at a time. That should last them a while.

Assessment Tasks:

Study “The Economics Of Panic Buying” online article above and complete the following tasks.

Complete all 4 tasks:

  1. Describe your knowledge or experience with the panic buying that took place in Sydney/Melbourne.                                                                                                                           

  1. Use the demand and supply model to describe the phenomenon of the panic buying which you describe in task 1 and illustrate the consequences of the panic buying on market equilibrium. Discuss whether there is an increase in demand or an increase in quantity demanded during the panic buying and explain your answer.                                                    

  1. Use the demand and supply model to illustrate the sellers’ responses to the panic buying, such as the curbside service provided by Target and Walmart. Discuss the impact of the curbside service on market equilibrium.                                                                                                          

In: Economics

This Tuesday evening at 7:05 p.m., Justin Wolfers, an economics professor at the University of Michigan,...

This Tuesday evening at 7:05 p.m., Justin Wolfers, an economics professor at the University of Michigan, started a provocative Twitter thread about panic buying. Spurred by fear of the spreading coronavirus, shoppers have been mobbing stores worldwide. They’re stockpiling canned goods, flour, sugar, bottled water, hand sanitizer—and toilet paper.

In Australia, where Wolfers was born, one desperate customer reportedly pulled a knife trying to score the last roll on the shelf at a Woolworths Supermarket in Sydney.

Wolfers believes desperate buyers aren’t crazy. “The economics of toilet paper shortages is the same as bank runs,” he tweeted. You stockpile toilet paper because others are stocking up too, depleting supplies.

“My argument is simply that panic buying can be rational,” said Wolfers in a phone interview with Forbes on Wednesday. “There is nothing inherent in markets that prevents this.” Until the FDIC started guaranteeing bank deposits in 1933, it made sense for nervous savers to pull their money out when they saw their neighbors doing the same.

What can be done to preclude toilet paper shortage-sparked violence? “The U.S. needs a strategic toilet paper reserve,” said Wolfers, guaranteeing that Americans have the supplies they need should stores run out.

In all seriousness, what does Wolfers think fear-sparked buying means for U.S. retailers like Costco, Walmart, Target and Kroger? “In the short term it’s good news,” he says, because extra purchases spike revenues. But in the long run, it’s unlikely to change those companies’ fortunes. “Once they have more toilet paper, people aren’t going to poo more,” he says. They’ll wait until their supply runs out to make further purchases.

Oliver Chen, a retail analyst at Cowen in New York, says virus-driven panic buying is giving a boost to curbside services offered by companies like Target and Walmart. Target reported this week in an earnings call that once customers try the service, where they order and pay online and then pick up their purchases at a designated spot outside a store, they increase their spending at Target by 25%. Cowen estimates that only 10% to 11% of shoppers use the service, leaving plenty of room for growth.

One more plus for retailers: “When you use the curbside service, it increases your loyalty as a shopper,” says Chen. He predicts that panic buying will drive up sales by 1% to 2% in the first quarter at retailers who sell groceries and staples. Given that operating margins are a low 3% to 7%, even a small increase in sales is significant.

Sucharita Kodali, an analyst at Forrester, says many retailers have missed an opportunity to hike prices during the scare. “What should have been a winning lottery ticket these guys were handed, they basically squandered,” she says. Without gouging customers, stores could have easily hiked prices by 10% or more on staples and banked the extra profit. “A lot of retailers foolishly let that opportunity pass,” she says. (Most state price-gouging laws, barring increases of 10% or more, only kick in after a state of emergency has been called.)

Wolfers disagrees with Kodali about the wisdom of price hikes during a perceived public health crisis. “Costco’s implicit promise to the customer is, ‘We will never screw you,’” he says. “Raising prices on toilet paper would destroy that trust.”

Rupesh Parikh, a retail analyst at Oppenheimer, says Costco made the right call to hold prices steady. “Costco is a company that puts the customer at the center of everything they do,” he says.

Today Costco reported that February 2020 sales increased 13.8% over the previous year due to “concerns over the coronavirus.” Though Parikh rates the stock a “buy,” he doesn’t believe the Issaquah, Washington-based chain, whose revenue hit $155 billion last year, will benefit from coronavirus buying in the long run. Shoppers who bought extra staples in February will wait to replenish them, possibly causing a sales dip in coming months. “If people don’t use up their supplies, that poses a risk going forward,” he says.

In Australia, where there are 52 confirmed cases of coronavirus including 2 deaths, a Costco store in Canberra has reportedly set limits on toilet paper purchases. Customers can buy no more than two 48-roll packs at a time. That should last them a while.

Tasks:

Study “The Economics Of Panic Buying” online article above and complete the following tasks.

  1. Describe your knowledge or experience with the panic buying that took place in Sydney/Melbourne.

  1. Use the demand and supply model to describe the phenomenon of the panic buying which you describe in task 1 and illustrate the consequences of the panic buying on market equilibrium. Discuss whether there is an increase in demand or an increase in quantity demanded during the panic buying and explain your answer.   

  1. Use the demand and supply model to illustrate the sellers’ responses to the panic buying, such as the curbside service provided by Target and Walmart. Discuss the impact of the curbside service on market equilibrium.

In: Economics

Periodic Inventory Using FIFO, LIFO, and Weighted Average Cost Method. The units of an item available...

Periodic Inventory Using FIFO, LIFO, and Weighted Average Cost Method.

The units of an item available for sale during the year were as follows:

Jan. 1 Inventory 14 units at $27 $378
Aug. 13 Purchase 19 units at $30 570
Nov. 30 Purchase 11 units at $32 352
Available for sale 44 units $1,300

There are 17 units of the item in the physical inventory at December 31. The periodic inventory system is used. Determine the inventory cost using (a) the first-in, first-out (FIFO) method; (b) the last-in, first-out (LIFO) method; and (c) the weighted average cost method (round per-unit cost to two decimal places and your final answer to the nearest whole dollar).

a. First-in, first-out (FIFO) $
b. Last-in, first-out (LIFO) $
c. Weighted average cost $

In: Accounting

Use equations 7 and 8 to determine the angle θ

Use equations 7 and 8 to determine the angle θ (in degrees) if the two positions of the first order spectral line are 35.0 cm and 65.0 cm. Assume the distance from the diffraction grating to the slit is 55 cm.

Equation 7: s= .5 (xr-xl)

Equation 8: tan? = s/L

In: Physics

The data in Table 2 show the per capita income (PCI) to the nearest $100 and...

The data in Table 2 show the per capita income (PCI) to the nearest $100 and the percentage of the economy in agriculture (PIA) in fifteen countries in South America (1999). The estimated results of a regression model fitted with these data and the error terms are presented below.

                   ^

                 PCI     =   59.13 – 2.60 PIA ………………………………………………………………………..(3)

                 S(b)          8.67      0.71

             

                 R squared = 0.51      n = 15                                               

Country   1        2        3        4        5        6        7        8        9       10       11      12       13        14        15

Error (e) 32.47   -7.53 8.27 8.67   0.27 -11.53 -14.93 -14.13 -4.33 -2.13 12.47 -7.33   -14.33   23.27 -9.13

                                                              Table 2

Country    1        2        3        4        5        6        7        8        9    10        11        12      13     14     15

Y               76     10     44       47      23      19     13       19       8    44         4         31      24     59     37

X                 6     16       9         8       14      11     12       10      18     5        26          8        8       9       5      

(a)Would it be more or less reasonable to specify the model as PIA = f(PCI)? Explain.

(b)For this model, what is your expectation concerning the impact of the explanatory variable on the dependent variable?

(c) What type of data are these?

(d)Is the result of the estimated coefficient consistent with your expectation?

(e) Test for heteroskedasticity at the 5% level of significance. Use the Glejser method.

In: Statistics and Probability