Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CHALLENGE ACTIVITY 3 . 7 . 2 : Detecting multiple features with branches. 5 2 2 9 4 0 . 4 0 6 7 9

CHALLENGE
ACTIVITY
3.7.2: Detecting multiple features with branches.
522940.4067970.93zqy7
Jump to level 1
Integers numDonuts and numDollars are read from input. A donut costs 3 dollars.
If numDonuts is less than 4, then output "numDonuts is less than the required amount to purchase."
If numDonuts is greater than or equal to 4, then declare and initialize int variable totalCost with the product of numDonuts and 3.
If totalCost is less than or equal to numDollars, then output "Donuts successfully purchased."
Otherwise, output "Need more money topurchase all."
If numDollars is greater than or equal to 3, then output "At least one item was purchased."
If numDonuts is greater than 38, then output "Now out of stock."
Otherwise, output "Item still in stock."
End each output with a newline.
Click here for examples
#include 4P
image text in transcribed

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago