Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integers numMangos and cash are read from input. A mango costs 2 dollars. - If numMangos is greater than or equal to 2 , then

image text in transcribed

Integers numMangos and cash are read from input. A mango costs 2 dollars. - If numMangos is greater than or equal to 2 , then declare and initialize int variable totalCost with the product of numMangos and 2. - If totalCost is less than or equal to cash, output "Mangos successfully purchased." - Otherwise, output "Not all mangos purchased." - If numMangos is greater than 21, output "Restocking soon." Otherwise, output "Item still in stock." End with a newline. Ex: If the input is 1657 , then the output is: Mangos successfully purchased. Item still in stock

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

=+Explain the key responsibilities of each social media role

Answered: 1 week ago