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
never [62]
3 years ago
15

Write a code segment that prints the food item associated with selection. For example, if selection is 3, the code segment shoul

d print "pasta".
Write the code segment below. Your code segment should meet all specifications and conform to the example.
Computers and Technology
1 answer:
Ganezh [65]3 years ago
4 0

<em>Missing Part:</em>

<em>Assume that the following variables have been properly declared and initialized: an int variable named selection, where 1 represents "beef", 2 represents "chicken", 3 represents "pasta", and all other values represent "fish"</em>

Answer:

if selection == 1:

    print("beef")

elif selection == 2:

    print("chicken")

elif selection ==3:

    print("pasta")

else:

    print("fish")

Explanation:

I've completer the question and the questin will be answered in python.

   

This checks if selection is 1. If yes, it prints the beef

<em>if selection == 1:</em>

<em>     print("beef")</em>

This checks if selection is 2. If yes, it prints the chicken

<em>elif selection == 2:</em>

<em>     print("chicken")</em>

This checks if selection is 3. If yes, it prints the pasta

elif selection ==3:

    print("pasta")

Any other input is considered java/

else:

    print("fish")

You might be interested in
Write a C++ programthat returns the type of a triangle (scalene, equilateral,or
bixtya [17]

Answer:

#include<iostream>

using namespace std;

int main(){

   //initialize

   int a, b,c;

   //print the message

   cout<<"Enter the three sides of the triangle: "<<endl;

   //store in the variables

   cin>>a>>b>>c;

   //if-else statement for checking the conditions  

   if(a == b && b == c && a == c){

       cout<<"\nThe triangle is equilateral";

   }else if(a != b && b != c && a != c ){

       cout<<"\nThe triangle is scalene";

   }else{

       cout<<"\nThe triangle is isosceles";

   }

   return 0;

}

Explanation:

Create the main function and declare the three variables for the length of the sides of the triangle.

print the message on the screen for the user. Then the user enters the values and its store in the variables a, b, and c.

use the if-else statement for checking the conditions.

Equilateral triangle: all sides of the triangle are equal.

if condition true, print the equilateral triangle.

Scalene triangle: all sides of the triangle are not equal.

if condition true, print the Scalene triangle.

if both conditions is not true, then, the program moves to else part and print isosceles.

8 0
3 years ago
The possible states of a process are:
Oliga [24]

Answer:

a. new, running, waiting, ready, and terminated.

Explanation:

The process in a computer system can have different states and these are:

-New: When the process is created.

-Ready: When the process is waiting to be executed.

-Running: When the process is chosen to be executed.

-Waiting: When the process is expecting for something to happen.

-Terminated: When the process is not running anymore.

According to this, the answer is that the possible states of a process are: new, running, waiting, ready, and terminated.

3 0
4 years ago
Read 2 more answers
Name at least 3 different portable computer devices that can be purchased
rosijanka [135]

Answer:

Smart Phone

Cameras

Console Controller

Brainliest and please say if its right!!

3 0
3 years ago
Read 2 more answers
g Suppose we want to compress a text consisting of 6 characters,a, b, c, d, e, fusingthe Huffman Algorithm. Give an example for
Papessa [141]

Answer:

e(a) = 0

e(b) = 10

e(c) = 110

e(d) = 1110

Explanation:

The Worst case will happen when f(a) > 2*f(b) ; f(b) > 2*f(c) ; f(c) > 2*f(d) ; f(d) > 2*f(e) and f(e) > 2*f(f).

Where f(x) is frequency of character x.

Lets consider the scenario when

f(a) = 0.555, f(b) = 0.25, f(c) = 0.12, f(d) = 0.05, f(e) = 0.02 and f(f) = 0.005

Please see attachment for image showing the steps of construction of Huffman tree:- see attachment

From the Huffman tree created, we can see that endcoding e() of each character are as follows:-

e(a) = 0

e(b) = 10

e(c) = 110

e(d) = 1110

e(e) = 11110

e(f) = 11111

So we can see that maximum length of encoding is 5 in this case.

3 0
3 years ago
How do you change between worksheets inside an Excel Workbook?
ad-work [718]

Answer:      c) Click on a different sheet tab at the bottom.

Explanation:    

To change between worksheets inside an Excel Workbook : Click on a different sheet tab at the bottom

3 0
4 years ago
Other questions:
  • I want to customize my company's logo, name, address, and similar details in all my business documents what option should use?
    12·1 answer
  • Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The progr
    8·1 answer
  • What is the name for the type of flash memory that is used by mobile devices to store their apps and data?
    6·1 answer
  • Antifreeze is not considered a hazardous waste by the EPA unless it is used or otherwise becomes contaminated.
    13·2 answers
  • Do you know some website that can make a questionnaire? And I can use the link then put up on the social media so that everyone
    7·2 answers
  • A computer (mainframe, server, or workstation) that has an operating system enabling _____________ to access it at the same time
    11·1 answer
  • Describe PROM, EPROM and EEPROM memories​
    7·1 answer
  • What does Al stand for?
    10·1 answer
  • Activity #2
    13·1 answer
  • Which one causes concerns for institutions or businesses when they are collected stores and they aren’t secured properly?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!