Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with C++ program Jump to level 1 Integers numCakes and numDollars are read from input. A cake costs 17 dollars. - If numCakes
Please help with C++ program
Jump to level 1 Integers numCakes and numDollars are read from input. A cake costs 17 dollars. - If numCakes is less than 4, output "numCakes is less than the required amount to purchase." - If numCakes is greater than or equal to 4 , then declare and initialize int variable totalCost with the product of numCakes and 17. - If totalCost is less than or equal to numDollars, output "Approved transaction." - Otherwise, output "Not all cakes purchased." End with a newline. Ex: If the input is 11 188, then the output is: Approved transaction. 1 \#include 2 using namespace std; 3 4 int main() \{ 5 int numCakes; 6 int numDollarsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started