Question: hello. can someone help fix this code? thank you (java only) ntegers numNectarines and numDollars are read from input. A nectarine costs 2 dollars. -

hello. can someone help fix this code? thank you (java only)
hello. can someone help fix this code? thank you (java only) ntegers
numNectarines and numDollars are read from input. A nectarine costs 2 dollars.
- If numNectarines is greater than or equal to 5 , then
declare and initialize int variable totalCost with the product of numNectarines and

ntegers numNectarines and numDollars are read from input. A nectarine costs 2 dollars. - If numNectarines is greater than or equal to 5 , then declare and initialize int variable totalCost with the product of numNectarines and 2. - If totalCost is less than or equal to numDollars, output "Approved transaction." - Otherwise, output "Not enough money to buy all." - If numDollars is greater than or equal to 2 , output "At least one item was purchased: - If numNectarines is greater than 24, output "Now out of stock." End with a newline. Ex: If the input is 1534, then the output is Approved transaction. At least one item was purchased. Ex If the input is 1534 , then the output is: Approved transaction. At least one item was purchased. 1: Compare output Input 1534 Youroutput Approved transaction. At least one item was purchased. 2 : Compare output Input 10 Your output Not enough money to buy all. Expected output This test case should produce no output 3. Compare output Input 34115 Your output At least one item was purchased. Now out of stock. 4: Compare output ^ Approved transaction. Your output At least one item was purchased. Now out of stock. 4: Compare output Input Your output 5: Compare output Input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!