1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
leonid [27]
3 years ago
14

Assume that an int variable age has been given a value. Assume further that the user has just been presented with the following

menu: S: hangar steak, red potatoes, asparagus T: whole trout, long rice, brussel sprouts B: cheddar cheeseburger, steak fries, cole slaw (Yes, this menu really IS a menu!) Write some code that reads the string (S or T or B) that the user types in into a variable choice and prints out a recommended accompanying drink as follows: if the value of age is 21 or lower, the recommendation is "vegetable juice" for steak, "cranberry juice" for trout, and "soda" for the burger. Otherwise, the recommendations are "cabernet", "chardonnay", and "IPA" for steak, trout, and burger respectively. Regardless of the value of age, your code should print "invalid menu selection" if the character read into choice was not S or T or B.
Computers and Technology
1 answer:
jeka57 [31]3 years ago
5 0

Answer:

No programming language stated.

I'll answer the question using C++ programming language

Explanation:

The code goes this;

.#include <iostream>

using namespace std;

int main()

{

string order; int age;

cout<<"Press S for hangar steak, red potatoes, asparagus"<<endl;

cout<<"Press T for whole trout, long rice, brussel sprouts"<<endl;

cout<<"Press B for cheddar cheeseburger, steak fries, cole slaw"<<endl;

cout<<"Please make your order";

cin>>order;

cout<<"Please what's your age";

cin>>age;

if(order == "S" || order == "T" || order == "B")

{

if(age <= 21)

{

if(order == "S")

{

cout<<"The Recommendation is Vegetable Juice";

}

else if(order == "T")

{

cout<<"The Recommendation is Cranberry Juice";

}

else if(order == "B")

{

cout<<"The Recommendation is Soda";

}

}

else

{

if(order == "S")

{

cout<<"The Recommendation is Cabernet";

}

else if(order == "T")

{

cout<<"The Recommendation is Chardonnay";

}

else if(order == "B")

{

cout<<"The Recommendation is IPA";

}

}

}

else

{

cout<<"Invalid Menu Selection";

}

return 0;

}

You might be interested in
Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates wh
____ [38]

Answer:

count_land = count_air = count_water = 0

while True:

   s = input("Enter a string: ")

   if s == "xxxxx":

       break

   else:

       if s == "land":

           count_land += 1

       elif s == "air":

           count_air += 1

       elif s == "water":

           count_water += 1

print("land: " + str(count_land))

print("air: " + str(count_air))

print("water: " + str(count_water))

Explanation:

*The code is in Python

Initialize the variables

Create a while loop that iterates until a specific condition is met. Inside the loop, ask the user to enter the string. If it is "xxxxx", stop the loop. Otherwise, check if it is "land", "air", or "water". If it is one of the given strings, increment its counter by 1

When the loop is done, print the number of strings entered in the required format

4 0
3 years ago
Northern Trail Outfitters uses a custom object Invoice to collect customer payment information from an external billing system.
Kobotan [32]

An administrator should ensure this requirement by creating a process builder to set the field.

<h3>What is a billing system?</h3>

A billing system is a complex software that enables service providers' order to cash process (O2C) and sends invoices, tracks, and processes payments for different consumers.

It is the process by which a business bills and invoices customers. Billing systems often include payment software that automates the process of collecting payments, sending out recurring invoices, expense tracking, and invoice tracking.

Learn more about billing system here,

brainly.com/question/14315763

#SPJ1

8 0
2 years ago
Address Resolution Protocol (ARP) is a protocol for mapping an IP address to a physical machine address that is recognized in th
Nimfa-mama [501]

Answer: Switch

Explanation: ARP spoofing is a illegal harmful activity in a disguised manner by a person who tries to send the ARP (Address resolution protocol)request.The disguised ARP request is sent to steal the confidential data by the overloading of the switch because of the numerous amount of the ARP request. This attack is done in the local area network .Therefore, the correct option is switch.

6 0
3 years ago
Choose the types of work a person in the network systems administration field might do on a regular
solniwko [45]

Answer:troubleshooting the network when there are problems with the connectivity ||||||| improving network speed

Explanation:

7 0
3 years ago
Read 2 more answers
GDP measures the production levels of
UkoKoshka [18]

Answer:

A. Standard of Living

Explanation:

Gross Domestic Products (GDP) is a measure of the total market value of all finished goods and services made within a country during a specific period.

Simply stated, GDP is a measure of the total income of all individuals in an economy and the total expenses incurred on the economy's output of goods and services in a particular country. Also, Gross Domestic Products (GDP) is a measure of the production levels of any nation.

Basically, the four (4) major expenditure categories of GDP are consumption (C), investment (I), government purchases (G), and net exports (N).

Hence, the standard of living of the people living in a particular country automatically improves if a nation's level of productivity or production improves; they are able to easily pay for goods and services, as well as save and invest their money.

In contrast, inflation and high unemployment rate are indications of economic downturn, recession and low level of productivity (output) in a country; this would automatically affect the standard of living within such countries.

4 0
3 years ago
Other questions:
  • Two types of business communications enhanced by desktop publishing are
    7·2 answers
  • William has an internet connection that does not allow him to make calls when connected to the internet. what internet service c
    7·2 answers
  • An example of a current disruptive technology is a?
    8·2 answers
  • (3 points) Write a program to process two large chunks of data (e.g., a large 3D array and an array of self-defined structures w
    11·2 answers
  • Which of the following are mass communication methods? (Select all that apply.)
    9·1 answer
  • List some of the ways that healthcare information technology is making healthcare more of a self-service industry?
    11·1 answer
  • g Design a Boolean function called isPrime, that accepts an integer as an argument and returns True if the argument is a prime n
    14·1 answer
  • Julie is trying to decide weather or not to add a color scheme to her presentation and she asks you for your advice u should adv
    9·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • Ema Company for business .
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!