Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve in C++ code. Thanks will rate! Problem C: What's For Dinner (food.c) At the dinner of the wedding reception, Arup and his fiance

Please solve in C++ code. Thanks will rate!

image text in transcribed

image text in transcribed

Problem C: What's For Dinner (food.c) At the dinner of the wedding reception, Arup and his fiance have decided that they will offer their guests the choice between chicken and steak for their entrees. Naturally, the chicken costs less than the steak, so Arup's secret desire is that everyone orders chicken so that he can pocket the extra money to buy some Dolphins tickets. Your job will be to write a program that helps him figure out the minimum number of guests who must order chicken for the total meal cost to be below a particular threshold. For example, if the chicken costs $40/person, the steak costs $50/person, there are 200 guests, and the designated target value was $9059, then at least 95 people must order the chicken. To see this, note that if 95 people order the chicken, the total cost is: 95 x $40 + 105 x $50 = $9050, which is under the target. If only 94 people order the chicken, the cost is: 94 x $40 + 106 x $50 = $9060, which exceeds our target of $9059. Sample Run #1 What is the cost of the chicken, in dollars? 40 What is the cost of the beef, in dollars? 50 How many guests will there be ? 200 What is your spending limit for food, in dollars? 9059

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions