Question: Please use JAVA ;Integers numMangos and moneyOnHand are read from input. Each mango costs 3 dollars. Write the following if - else statement. Within the
Please use JAVA ;Integers numMangos and moneyOnHand are read from input. Each mango costs dollars.
Write the following ifelse statement. Within the else branch, write the following assignment and nested ifelse statement:
If numMangos is less than output "Please purchase at least mangos".
Otherwise:
Assign variable totalCost with the product of numMangos and
If totalCost is less than or equal to moneyOnHand, then output "Mangos successfully purchased".
Otherwise, output "Not enough money to buy all".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
