Write a Java program (name it InputSum) that prompts the user to enter positive integer numbers using a sentinel while loop. The program should accept integer inputs until the user enters the value -1 (negative one is the sentinel value that stops the while loop). After the user enters -1, the program should display the entered numbers followed by their sum as shown below. Notice that -1 is not part of the output. The program should ignore any other negative input and should continue to run.
Hint: to remember/save the entered (good) positive values, you can concatenate them into a string (separated by comas) that you can output later on.
The following are sample runs showing the input prompt and the outputs: (Notice the user may enter one value per line. DO NOT read inputs as String type)
Enter positive integers (-1 to quit): 10 -5 2 -1
Entered Numbers: 10, 2
The Sum: 12
Enter positive integers (-1 to quit): 1 2 3 4 5 6 -1
Entered Numbers: 1, 2, 3, 4, 5, 6
The Sum: 21
Enter positive integers (-1 to quit): 1 1 -7 1 1 -9 100 -1
Entered Numbers: 1, 1, 1, 1, 100
The Sum: 104
Make sure the program validates each entered number before processing it as the user may enter negative numbers (other than the sentinel value -1).
Design your program such that it allows the user to re-run the program with a different set of inputs in the same run.
Document your code, and organize and space out your outputs as shown above.
In: Computer Science
You decide to open an individual retirement account (IRA) at your local bank that pays 8 %/year compounded annually. At the end of each of the next 40 years, you will deposit $4,000 into the account. Three years after your last deposit, you will begin making annual withdrawals. What annual amount will you be able to withdraw if you want the withdrawals to last:
A, 20 years? $
B, 30 year? $
C, Forever? $
In: Finance
| Postretirement Benefits | ||||||||||||
| Peyton Approved has revised its postretirement plan. It will now provide health insurance to retired employees. Management has requested that you report the short- and long-term financial implications of this. | ||||||||||||
| · The company is currently employing 60, and actuaries estimate that the company has a pension liability of $107,041.70. | ||||||||||||
| · The estimated cost of retired employees’ health insurance is $43,718.91. | ||||||||||||
| · Prepare adjusting entries for the pension liability and the health insurance liability | ||||||||||||
| Leases | ||||||||||||
| · Six ovens were rented on December 31, with $20,000 charged to rent expense. The lease runs for 6 years with an implicit interest rate of 5%. At the end of the 6 years, Peyton will own them. Make any necessary adjusting entries. | ||||||||||||
In: Accounting
In: Computer Science
Suzy purchased 2 acres of vacant land in 2018 by paying $4,000 in cash at closing and borrowing $40,000 to be repaid at $8,000 per year for the next 5 years with interest on the unpaid balance at 10%. As part of the purchase agreement, Suzy agreed to let the seller store farm equipment on the land for 2 years (rental value of $1,000 per year). Suzy also pays legal, survey and title abstract fees of $700 on the purchase. In 2019, she paid $1,250 in property tax on the land. In addition, the county paved the road that runs by the land and assessed each taxpayer $1,300 for the paving, which Suzy paid in November 2019. What is Suzy's adjusted basis of the land at the end of 2019?
In: Accounting
You are considering constructing a new plant in a remote wilderness area to process the ore from a planned mining operation. You anticipate that the plant will take a year to build and cost
$ 100
million upfront. Once? built, it will generate cash flows of
$ 16
million at the end of every year over the life of the plant. The plant will be useless
20
years after its completion once the mine runs out of ore. At that point you expect to pay
$ 220$220
million to shut the plant down and restore the area to its pristine state. Using a cost of capital of
13 %
a. What is the NPV of the? project?
b. Is using the IRR rule reliable for this? project? Explain.
c. What are the IRRs of this? project?
In: Finance
A single- phase full- wave rectifier is used to control the speed of a 5- hp, 110- V, 1200- rpm, separately- excited dc motor. The converter is connected to a single- phase, 120- V, 60- Hz supply. The motor has a winding resistance of 0.4ohms and an inductance of 5 mH, and a voltage constant K=0.09V/rpm.
a. During the motoring operation, the motor runs at 1000 rpm and receives an armature current of 30 A. Determine the corresponding firing angle and the power to the motor.
b. The polarity of the emf is reversed to get a regenerative action. Determine the firing angle required to keep the motor speed at 1000 rpm with an armature current of 30A. What is the power fed back to the supply under these conditions?
In: Electrical Engineering
How will the following situations affect your final calculation of molarity of HC2H3O2? (higher, lower, unaffected. be specific) A) You wash the sides of the flask with deionized water to remove any vinegar of NaOH solution adhering to the side of the flask. B) You add 20 mL of water to the vinegar in the flask (assume no drops of vinegar adhere to the side of the flask). C) The tip of the buret is not filled when you start a titration but is filled when you finish the titration. D) The molarity of the standard NaOH solution is miscalulated and the true value is higher than the concentration given. E) As you are refilling your buret, some of the NaOH spills over the side and runs down the buret into the flask you intend to titrate.
In: Chemistry
You are considering constructing a new plant in a remote wilderness area to process the ore from a planned mining operation. You anticipate that the plant will take a year to build and cost $120 million upfront. Starting in t=1, it will generate cash flows of $19 million at the end of every year over the life of the plant. The plant will be useless 20 years later, once the mine runs out of ore. In t=21 you expect to pay another $120 million to shut the plant down and restore the area to its pristine state. Using a cost of capital of 8,9%, a. What is the NPV of the project? b. Is using the IRR rule reliable for this project? Explain in 1-2 sentences.
In: Finance
You are considering constructing a new plant in a remote wilderness area to process the ore from a planned mining operation. You anticipate that the plant will take a year to build and cost $ 96 million upfront. Once built, it will generate cash flows of $ 16 million at the end of every year over the life of the plant. The plant will be useless 20 years after its completion once the mine runs out of ore. At that point you expect to pay $ 224 million to shut the plant down and restore the area to its pristine state. Using a cost of capital of 11 %: a. What is the NPV of the project? b. Is using the IRR rule reliable for this project? Explain. c. What are the IRRs of this project?
In: Finance