Questions
Language: C++ 3 Campus Travel Game This lab will practice using loops. We will construct a...

Language: C++

3 Campus Travel Game

This lab will practice using loops.

We will construct a short computer game. Please look at the Test Cases for exact wording.

For your game, the player’s goal is to reach campus exactly.

The player starts 14 miles away and has up to 4 turns to reach campus.

At each turn the play can ride either use a Bus, a Subway, or a Jetpack:

  • Riding a Bus moves the player forward 2 miles each turn.
  • Riding a Subway moves the player forward 5 miles each turn
  • Riding a Jetpack moves the player forward 10 mile each turn.
Example:
You are 14 mile(s) from campus!
How do you wish to travel? (1 bus, 2 subway, 3 jetpack) 

The player chooses one.

After each turn, the player is informed how much farther she must travel before reaching campus.

Winning/Losing: After the last turn, if the player has reached campus exactly ("You have won!")

   Otherwise, explain the problem: "You have over-shot your target!" or "You haven't reached your target!"

   And then write “You lose!”

The game will operate as follows:

  • Report how far the user is from campus – the player starts 14 mile away
  • For each turn:

o Ask user to select transport method (Bus, Subway, or Jetpack)

o Report the user’s new distance from campus

o If the player has reached campus or passed campus and it is not the fourth turn, end the game early – This is a more challenging step! Make sure the rest of your game works before working on this step.

ALSO:

Check that the user input is valid (1-3).

If the user fails to pick a valid number, the program must keep asking the user for a new selection until a valid number is entered. ALSO- you do not lose turns by making an invalid selection.

    Use this wording:      Invalid choice, try again!

Requirements:

  • You must use a loop (while, do-while, or for) to loop through the 4 turns. (The loop can include a condition to allow ending early, if you so choose.)
  • You must use at least one if or switch statement
  • Require the user enters one of three numbers to specify the transport method

Example Output:

You are 14 mile(s) from campus!

How do you wish to travel? (1 bus, 2 subway, 3 jetpack) 2

You are 9 mile(s) from campus!

How do you wish to travel? (1 bus, 2 subway, 3 jetpack) 1

You are 7 mile(s) from campus!

How do you wish to travel? (1 bus, 2 subway, 3 jetpack) 1

You are 5 mile(s) from campus!

How do you wish to travel? (1 bus, 2 subway, 3 jetpack) 2

You are 0 mile(s) from campus!

You have won!

In: Computer Science

NUR 303 - Nursing Pathophysiology Unit X Case Study: Hyperthyroid Disease Patient’s Chief Complaints: “I was...

NUR 303 - Nursing Pathophysiology

Unit X Case Study: Hyperthyroid Disease

Patient’s Chief Complaints:

“I was jogging in the park like I do most mornings. Suddenly, I couldn’t catch my breath and I felt very dizzy. When I sat down on a park bench for a minute, I noticed a weird feeling in my chest—like a strong fluttering sensation. I called 911 with my cellular phone and here I am.”

History of Present Illness:

B.G. is a 52 yo man who was brought to the emergency room by paramedics following symptoms of dyspnea, dizziness, and palpitations. When questioned about his recent medical history, he reports a sudden, unintentional loss in weight of approximately 10 pounds over the past two months and nearly 15 pounds over the last four months. “I’ve been eating like an elephant, but I’ve been losing weight,” he reports. A few months ago, he began experiencing palpitations that came and went, but were not associated with chest pain. However, he notes that, sometimes, his “heart seems to beat too fast and too hard” and disproportionate to the activity in which he is engaged. Sometimes, it begins when he is sitting and watching TV or reading a magazine. He has also noticed that it has been “difficult getting some kinds of food down for the past week” and that he “had planned to see a doctor about that soon.”

“My wife also tells me that I have been on edge and a bit short with her lately. I agree that I have not been myself mentally.”

Past Medical History:

  • Migraine headaches 9 years

  • History of herpes simplex infections on lips and corners of mouth

  • HTN 3 years

Family History:

  • Paternal grandfather and father diagnosed with prostate cancer; father’s cancer is currently in remission

  • Half-sister had “thyroid problems with a goiter”

  • Mother had arthritis and hyperthyroid disease

  • One brother with type 2 DM who “takes pills”

Social History:

  • Married and lives with wife of 30 years

  • They had one daughter who was kidnapped and murdered in Aruba 6 months ago. The authorities have made no arrests to date and there are no suspects at this time.

  • Works as an auto mechanic

  • Previous smoker but quit 11 years ago

  • Has an occasional beer with friends

  • Denies use of illicit drugs, although he reports history of heroin and cocaine use as a young adult

  • Admits to drinking “too much coffee” every day

  • Physically very active and jogs 1–2 miles 3 or more days each week; also works out at the gym 1 day/week

Review of Systems:

  • (+) occasional insomnia plus increased sensitivity to heat, fatigue, and decreased exercise tolerance for 1 week

  • Reports that “hair seems to be falling out faster than usual” for past month

  • (-) headache, cough, blurred or double vision, eye pain or sensitivity to light, excessive tearing or discomfort in the eyes, fever or chills, muscle weakness, diarrhea, chest pain, changes in libido or sexual performance, concentration problems, “shakiness,” rashes or other skin lesions, painful swallowing, tenderness/pain in the neck, difficulty with urination, edema, recent fainting spells, and recent respiratory infection

Medications:

  • Acetaminophen 500 mg + aspirin 500 mg + caffeine 130 mg PO QD PRN

  • Atenolol 25 mg PO QD

  • Multivitamin 1 tablet PO QD

Vaccinations: Unknown

Allergies: Morphine → intense pruritus

Physical Examination:

Vital Signs

Temp. = 98.8F oral

BP = 98/70 mmHg supine

RR = 20 breaths/minute and unlabored

HR = 130-170 beats/minute, irregular

Height = 5’10”

Weight = 124 lbs

General

Patient is thin, tanned, white male who appears slightly short of breath. He is cooperative and answers all questions appropriately.

Skin

Skin very warm, soft, intact, and moist

Normal turgor and color

Hyperpigmented lesions on upper back and lower extremities

Hair is fine, velvety, and sparse on crown of head

No evidence of rash, ecchymoses, petechiae, edema, or cyanosis

HEENT

PERRLA

EOMI

Positive: eyelid lag bilaterally, R > L

Positive: mild proptosis bilaterally

Fundi benign

TMs intact

Tongue and oral mucous membranes moist without erythema, exudates, or lesions

Cold sore on right upper lip

Neck, Lymph Nodes

Neck supple

Positive: smooth, diffusely enlarged thyroid

Negative: JVD, carotid bruits, or cervical/axillary/inguinal adenopathy

Lungs

Lungs clear bilaterally

No wheezes or crackles

Heart

Irregular rhythm

Tachycardic without murmurs

No S3 or S4 heard

No rubs heard

Abdomen

Soft, non-tender, non-distended

Positive bowel sounds in all four quadrants

Negative: hepatosplenomegaly, masses, bruits

Genitalia, Rectum

Normal male genitalia

Prostate slightly enlarged, but no nodules noted

Guaiac-negative stool

Musculoskeletal, Extremities

2+ DP pulses bilaterally

Negative joint tenderness, peripheral edema, cyanosis, or clubbing

Full ROM

No muscle weakness in proximal muscle groups

No femoral bruits

Neurological

Alert & oriented to person, place, and time

DTRs 3+ at knees

No tremor observed with fingers extended

CNs II-XII intact

Negative Babinski

Sensory and motor levels appear intact


Laboratory Blood Test Results:

Serum Sodium

142 mEq/L

RBC

4.9 million/mm^3

WBC

7,700/mm^3

Serum Potassium

4.0 mEq/L

Hct

42%

ESR

6 mm/hr

Serum Chloride

108 mEq/L

Hb

14.6 g/dL

Total Cholesterol

68 mg/dL

Serum Calcium

8.6 mEq/L

Platelets

378,000/mm^3

Total T4

26.5 μg/dL

Glucose

NA

Serum Magnesium

1.8 mg/dL

Total T3

508 ng/dL

Creatinine

0.6 mg/dL

HCO3

27 meq/L

TSH

0.016 μU/mL

BUN

11 mg/dL

MCV

88 fL

FT4

57 pmol/L

AST

34 IU/L

ALT

31 IU/L

Total Bilirubin

1.0 mg/dL

Electrocardiogram:

  • Atrial fibrillation

  • Sinus tachycardia

  • Negative: Left ventricular hypertrophy

Thyroid Ultrasound: Marked vascularity of the thyroid

Radioactive Iodine Uptake Test: 53% 123Iodine absorbed after 5.9 hours

Thyroid-Stimulating Hormone Receptor Antibody Test: Positive

Chest X-Ray: Clear

Exophthalmometry:

  • 20% greater than expected, R eye

  • 11% greater than expected, L eye

Case Study Questions:

  1. Which is a more appropriate diagnosis and why: primary hyperthyroidism, secondary hyperthyroidism, or tertiary hyperthyroidism?

  2. Why can a pituitary tumor be excluded as a potential cause of hyperthyroid disease in this patient?

  3. Why is this patient taking a combination drug regimen of acetaminophen, aspirin, and caffeine?

In: Nursing

Name Primary Segment Units Sold Unit Inven tory Revision Date Age Dec.31 MTBF Pfmn Coord Size...

Name Primary Segment Units Sold Unit Inven tory Revision Date Age Dec.31 MTBF Pfmn Coord Size Coord Price Material Cost Labor Cost Contr. Marg. 2nd Shift &
Over-
time
Auto mation Next Round Capacity Next Round Plant Utiliz.
Acre Thrift 1,313 598 4/27/2020 3.0 20000 8.2 12.0 $23.45 $6.84 $6.97 37% 69% 6.0 1,130 167%
Adam Core 2,050 104 6/18/2021 2.1 22000 11.2 9.0 $28.45 $9.37 $6.02 43% 7% 6.0 1,600 106%
Aft Nano 1,854 11 6/29/2021 1.5 24000 13.1 4.2 $36.45 $12.22 $8.52 43% 83% 5.0 1,028 181%
Agape Elite 1,898 0 6/16/2021 1.5 26000 16.0 7.1 $36.45 $12.75 $10.01 38% 89% 5.0 1,014 187%
Bead Nano 1,850 429 9/13/2021 1.3 23000 14.5 3.2 $34.00 $13.04 $6.63 41% 100% 7.0 1,100 198%
Bid Elite 1,606 139 8/21/2021 1.6 25000 17.6 5.7 $34.00 $13.82 $6.63 39% 100% 7.0 800 198%
Bold Nano 1,370 444 8/13/2021 1.4 23000 14.9 2.9 $37.00 $13.28 $5.96 45% 32% 7.0 1,100 131%
Buddy Elite 1,552 491 8/21/2021 1.3 25000 17.4 5.4 $37.00 $13.83 $6.04 43% 38% 7.0 1,200 136%
Cedar Thrift 1,955 172 6/10/2021 2.6 17000 9.0 11.2 $15.00 $6.69 $1.43 45% 33% 10.0 1,500 132%
Cid Thrift 1,976 196 6/10/2021 2.6 17000 9.2 11.0 $15.00 $6.82 $1.29 43% 3% 10.0 1,750 102%
Cute Core 2,058 220 12/14/2021 1.6 18000 11.7 7.8 $23.00 $9.03 $4.63 40% 77% 8.0 1,100 176%
Cure Core 1,996 235 12/14/2021 1.6 20000 12.4 8.3 $25.00 $9.64 $4.33 43% 37% 8.0 1,350 136%
Dell Thrift 1,331 152 12/19/2020 3.2 14000 8.7 11.5 $15.00 $5.93 $1.22 49% 0% 10.0 1,250 87%
Dixie Thrift 1,532 188 12/7/2018 4.1 16000 9.6 10.6 $17.00 $7.14 $1.22 43% 0% 10.0 1,550 86%
Dot Nano 1,334 325 12/21/2021 1.0 18000 13.8 3.4 $28.00 $11.83 $5.79 35% 61% 7.0 900 160%
Dune Elite 981 325 12/21/2021 1.0 20000 17.2 6.2 $34.00 $12.62 $5.34 45% 24% 7.0 850 122%
Dart Core 1,558 171 12/14/2021 1.0 16000 11.6 8.4 $19.00 $8.63 $4.32 31% 59% 8.0 1,040 157%
Deft Core 1,759 150 12/14/2021 1.0 16000 11.3 8.8 $20.00 $8.38 $4.44 36% 78% 8.0 1,040 176%
Production Information

Your Competitive Intelligence team reports that a wave of product liability lawsuits is likely to cause Chester to pull the product Cute entirely off the market this year. Assume Chester scraps all capacity and inventory this round, completely writing off those assets and escrowing the proceeds to a settlement fund, and assume these lawsuits will have no effect on any other products of Chester or other companies. Without Chester's product Cute how much can the industry currently produce in the Core segment? Consider only products primarily in the Core segment last year. Ignore current inventories. Figures in thousands (000).

Select: 1

9,652
8,552
5,030
8,675
10,060
4,104
7,575

In: Finance

Case Assignment: Tesla Motors Tesla Motors was founded with innovation in mind. Launched in 2003 by...

Case Assignment: Tesla Motors

Tesla Motors was founded with innovation in mind. Launched in 2003 by a group of engineers in Silicon Valley who wanted to prove that electric cars could replace gasoline-powered automobiles, Tesla’s mission is to accelerate the world’s transition to sustainable energy.

            The Tesla Roadster was launched in 2008 and can travel 245 miles per charge of its lithium ion battery. There are now more than 2,400 Roadsters being driven in more than 30 countries. The Roadster was followed by the Tesla Model S in 2012. The Model S can travel 265 miles per charge and has room for seven passengers with 64 cubic feet of storage. The Model S was named Motor Trend’s 2013 Car of the Year and achieved a 5-star safety rating from the U.S. National Highway Traffic Safety Administration.

            Next came the Model X, which Tesla began delivering in 2015, and the new Model 3 will begin production in mid-2017 with estimated delivery for new reservations at mid-2018 or later. Model 3 is Tesla’s most affordable model to date, starting at $35,000. It has seating for five adults and can travel 215 miles per charge.

            Improvements to battery life and safety features weren’t the only upgrades Tesla had quietly been putting together. They created a roar in the automobile industry when they announced in October 2016 that, moving forward, all vehicles produced in Tesla factories would have the hardware needed for full self-driving capabilities at a safety level higher than that of a human driver. Model S and Model X vehicles with the new hardware are already in production, and the hardware will be included on the new Model 3 when it goes into production.

            This hardware includes eight surround cameras providing 360-degree visibility around the car up to 250 meters of range; two updated ultrasonic sensors; forward-facing radar that can see through heavy rain, fog, dust, and even the car ahead; and a new onboard computer with more than 40 times the computing power of previous generations.

            Tesla’s move was unprecedented compared to that of other car companies, but not as much for them. While Tesla will be creating cars with the hardware needed for self-driving capabilities, they do not have the software finished yet. They will update the software in the cars produced now using over-the-air software updates. This is a method that Tesla already employs to enhance performance and fix security bugs; it allows them to continually improve cars even after they are on the road and to stay ahead of automakers who do not operate under this model.

            Tesla still has to complete millions of miles of real-world testing before the software can be implemented. They will run the software in the background while a professional drives the car and then compare what the computer would have done with what the person did do. The goal is for self-driving cars to be even better than humans at avoiding crashes.

            Tesla must also achieve regulatory approvals of full self-driving cars before they can legally drive on public roadways. So it is still unclear when customers (even those currently purchasing models featuring the new hardware) will be able to experience fully autonomous driving.

TRUE/FALSE

1. Telsa’s new products have been successful, in part, because they have a well-defined new product strategy at their core and are driven by the corporate objectives and strategies of using electricity over gasoline when designing automobiles.

ANS:

2. A new-product strategy is a plan that links the new-product development process with the objectives of the marketing department, the business unit, and the corporation.

ANS:

3. The business analysis to determine if Tesla should equip their cars with the self-driving hardware before the software was complete would have been a simple process.

ANS:

4. Tesla employed simultaneous product development by having their hardware and their software design teams work together on the autonomous automobile initiative.

ANS:

5. Tesla will use test marketing to teach the self-driving software how to appropriately respond in different driving situations.


In: Operations Management

Consider the following multifactor (APT) model of security returns for a particular stock. Factor Factor Beta...

Consider the following multifactor (APT) model of security returns for a particular stock.

Factor Factor Beta Factor Risk Premium
Inflation 1.1 8 %
Industrial production 0.6 9
Oil prices 0.3 7


a. If T-bills currently offer a 7% yield, find the expected rate of return on this stock if the market views the stock as fairly priced. (Do not round intermediate calculations. Round your answer to 1 decimal place.)




b. Suppose that the market expects the values for the three macro factors given in column 1 below, but that the actual values turn out as given in column 2. Calculate the revised expectations for the rate of return on the stock once the “surprises” become known. (Do not round intermediate calculations. Round your answer to 1 decimal place.)

Factor Expected Value Actual Value
Inflation 8 % 8 %
Industrial production 5 9
Oil prices 2 0

In: Finance

Greta has risk aversion of A = 5 when applied to return on wealth over a...

Greta has risk aversion of A = 5 when applied to return on wealth over a one-year horizon. She is pondering two portfolios, the S&P 500 and a hedge fund, as well as a number of one-year strategies. (All rates are annual and continuously compounded.) The S&P 500 risk premium is estimated at 7% per year, with a standard deviation of 19%. The hedge fund risk premium is estimated at 9% with a standard deviation of 34%. The returns on both of these portfolios in any particular year are uncorrelated with its own returns in other years. They are also uncorrelated with the returns of the other portfolio in other years. The hedge fund claims the correlation coefficient between the annual return on the S&P 500 and the hedge fund return in the same year is zero, but Greta is not fully convinced by this claim.

If the correlation coefficient between annual portfolio returns is actually 0.3, what is the covariance between the returns? (Round your answer to 3 decimal places.)

In: Finance

1.You invest 30% of funding in Stock M and the rest in Stock N. The return...

1.You invest 30% of funding in Stock M and the rest in Stock N. The return on Stock M is 12% and its standard deviation is 7%. The return on Stock N is 25% with a standard deviation of 11%. Assume the two stocks have a correlation coefficient of 0.3. Calculate this portfolio’s return and standard deviation.

2. If you invest your money in 3 stocks: A, B, C. Each stock has a return of 11%,15%, and 21%. Your funding allocation on the stocks is: 30:30:40. Calculate your portfolio return.

3. Suppose you own a portfolio that has a beta risk of 1.2. Treasury bond yield is assumed to be 5%, and the stock market return on average is 11%. What should be your required return on this portfolio if you use CAPM in your estimation? What is the stock market risk premium? What is your portfolio’s risk premium?

Please show work and explain answers.

In: Finance

1. Suppose the data on today’s and future expected interest rates is given: Time Yield on...

1. Suppose the data on today’s and future expected interest rates is given:

Time

Yield on 1-year

T-bond

Today

1.2%

Next year

1.2% (expected)

2 years from today

1.6% (expected)

3 years from today

2.0% (expected)

a) Calculate today’s interest rates on 2-year, 3-year and 4-year bonds using the expectations hypothesis. Use these yields to construct a yield curve and plot it. What kind of shape does it have?

b) Now, suppose term premiums for 2-year, 3-year and 4-year bonds are 0.2%, 0.3% and 0.4%, respectively. Recalculate today’s interest rates on 2-year, 3-year and 4-year bonds using the liquidity premium theory. Use the yields to plot the yield curve on the same graph as expectations hypothesis yield curve from part (a). What do you notice?

In: Economics

An industrial area has several companies that use similar chemicals. Groundwater in this area has been...

  1. An industrial area has several companies that use similar chemicals. Groundwater in this area has been found to be contaminated, and several companies are disputing who is responsible. (The responsible party must pay for remediation.) Two of the chemicals used by several companies are TCE and dioxane, but the companies often use different ratios of these chemicals. One company uses 3.6 times more TCE than dioxane, and the standard deviation of the TCE:dioxane ratio in its supply drums was 0.3. This company claims it isn’t responsible for remediation, because the ratio of TCE:dioxane in water samples is different from what the company uses. Samples of groundwater from 12 wells in the area yielded the following TCE:dioxane ratios:

3.1       2.6       4.5       6.2       4.2       3.3       1.2       3.6       5.9       2.7       3.7       3.8      

Can the company “prove” that there is less than a 5% chance that they contributed to the groundwater contamination?   Explain your answer using statistical justification.

In: Statistics and Probability

Greta has risk aversion of A = 3 when applied to return on wealth over a...

Greta has risk aversion of A = 3 when applied to return on wealth over a one-year horizon. She is pondering two portfolios, the S&P 500 and a hedge fund, as well as a number of one-year strategies. (All rates are annual and continuously compounded.) The S&P 500 risk premium is estimated at 7% per year, with a standard deviation of 19%. The hedge fund risk premium is estimated at 11% with a standard deviation of 34%. The returns on both of these portfolios in any particular year are uncorrelated with its own returns in other years. They are also uncorrelated with the returns of the other portfolio in other years. The hedge fund claims the correlation coefficient between the annual return on the S&P 500 and the hedge fund return in the same year is zero, but Greta is not fully convinced by this claim. Calculate Greta’s capital allocation using an annual correlation of 0.3

. S&P % Hedge % Risk-free asset %

In: Finance