Integers numSteaks and allowance are read from input. A steak costs 13 dollars. If numSteaks...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Integers numSteaks and allowance are read from input. A steak costs 13 dollars. • If numSteaks is greater than or equal to 5, then declare and initialize int variable totalCost with the product of numSteaks and 13. • If totalCost is less than or equal to allowance, output "Approved transaction." • Otherwise, output "Not enough money to buy all." • If allowance is greater than or equal to 13, output "At least one item was purchased." If numSteaks is greater than 30, output "Restocking soon." Otherwise, output "Item still in stock." End with a newline. Ex: If the input is 16 258, then the output is: Approved transaction. At least one item was purchased. Item still in stock. 1 import java.util.Scanner; 2 3 public class SteakPurchases { 4 5 6 7 8 9 10 11 12 13 public static void main (String[] args) { Scanner scnr = new Scanner(System.in); int numSteaks; int allowance; numSteaks scnr. nextInt(); allowance scnr.nextInt(); *Your code goes here */ Integers numSteaks and allowance are read from input. A steak costs 13 dollars. • If numSteaks is greater than or equal to 5, then declare and initialize int variable totalCost with the product of numSteaks and 13. • If totalCost is less than or equal to allowance, output "Approved transaction." • Otherwise, output "Not enough money to buy all." • If allowance is greater than or equal to 13, output "At least one item was purchased." If numSteaks is greater than 30, output "Restocking soon." Otherwise, output "Item still in stock." End with a newline. Ex: If the input is 16 258, then the output is: Approved transaction. At least one item was purchased. Item still in stock. 1 import java.util.Scanner; 2 3 public class SteakPurchases { 4 5 6 7 8 9 10 11 12 13 public static void main (String[] args) { Scanner scnr = new Scanner(System.in); int numSteaks; int allowance; numSteaks scnr. nextInt(); allowance scnr.nextInt(); *Your code goes here */
Expert Answer:
Answer rating: 100% (QA)
Heres the Java code for solution import javautilScanner public class SteakPurc... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Water at an average temperature of 110C and an average velocity of 2.5 m/s flows through a 7-m-long stainless-steel tube (k=14.2 W/m-C) in a boiler. The inner and outer diameters of the tube are D;=...
-
Explain the FOUR ways you can map EERD to Relational Model?
-
On Wednesday, February 18, Jim Elsey, cost management specialist at Deere & Company in Moline, Illinois, received a call from Glen Lowery, sales manager in the Agricultural Products Division: Jim, I...
-
Olmsted Co. has small computer chips assembled in Poland and transports the final assembled products to the parent, where they are sold by the parent in the U.S. The assembled products are invoiced...
-
Determine the moment of inertia for the shaded area about the x axis. (x, y)
-
How does retargeting work both from the perspective of the customer as well as the marketing professional.
-
An option based on a variable that is not traded is called a real option or sometimes a soft option. Find the projection price of the soft option with the following parameters and compare with the...
-
Laramie Corporations income statement is presented below: Sales ........ $40,000 Less variable costs .. -28,000 Contribution margin . $12,000 Less fixed costs ..... -8,000 Net Income ..... $ 4,000...
-
What is the net present value of this project if the required return is 10%? Consider a capital project with the following cash flows: 1 (This info is for the Year 0 2 3 4 Cash Flow -$24,000 $7,000...
-
Omar is leading a weekly workshop series for his peers on how to be a successful student. Each week, he assigns a task for them to try and report back on next session. However, it seems like nobody...
-
A company just paid dividends of $2.75 per share. The company has a constant growth of 5.5%. The risk-free rate is 2.5%, beta is 0.90 and market return of 8%. The stock is selling at $75.50. a....
-
Mauer Company licenses customer-relationship software to Hedges Inc. for 3 years. In addition to providing the software, Mauer promises to perform consulting services over the life of the license to...
-
At the beginning of 2015, Callaway Company acquired a mine for \($850\),000. Of this amount, \($100\),000 was ascribed to the land value and the remaining portion to the minerals in the mine. Surveys...
-
Addison Corporation has 10 million shares of ordinary shares issued and outstanding. On June 1, the board of directors voted a 60 cents per share cash dividend to shareholders of record as of June...
-
Chen Inc. acquired 20% of the outstanding ordinary shares of Cho Corp. on December 31, 2015. The purchase price was 125,000,000 for 50,000 shares. Cho Corp. declared and paid an 80 per share cash...
-
The cost of equipment purchased by Charleston, Inc., on June 1, 2015, is 89,000. It is estimated that the machine will have a 5,000 residual value at the end of its service life. Its service life is...
-
java. needs to run on ios coderunner. Examine the following image (GeeksforGeeks, n.d.): 2 10 25 20 35 30 15 3 Solve the traveling salesman problem (TSP) based on the given image using dynamic...
-
3.16. For a system with non-identical service rates (see Sect. 3.5) and a limit of N jobs in the system (Eq. 3.13), obtain an expression for the mean service time per job, E[Ts], as a function of the...
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
Lisa Sizemore, a taxpayer in the 10-15 percent tax bracket, purchased stock as an investment on July 11, 2011. She sold the stock on July 9, 2012, 2 days before qualifying for the long-term holding...
-
A positively charged particle creates the electric field shown in Figure 30. 20. When the kinks in the electric field lines reach the rod, what is the direction of the current induced in the rod?...
-
Suppose the current shown in Figure 30. 19 discharges the capacitor. What are the directions of \(\vec{E}\), \(\Delta \vec{E}\), and \(\vec{B}\) between the plates of the discharging capacitor? Data...
-
For the oscillating dipole of Figure 30. 14, sketch the electric field pattern at \(t=\frac{5}{4} T\). Data from Figure 30.14 0=1 t = T t=T 1=T O O D
Study smarter with the SolutionInn App