Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integers numSteaks and allowance are read from input. A steak costs 13 dollars. If numSteaks is greater than or equal to 5, then declare

Integers numSteaks and allowance are read from input. A steak costs 13 dollars.  If numSteaks is greater than

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 */

Step by Step Solution

3.32 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

Heres the Java code for solution import javautilScanner public class SteakPurc... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

If f(t) = t cos (wt) u (t 1), find F(s).

Answered: 1 week ago

Question

h&h tools inc balance sheet

Answered: 1 week ago