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
SVETLANKA909090 [29]
3 years ago
14

Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than

10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline.
Computers and Technology
2 answers:
yawa3891 [41]3 years ago
8 0

Answer:

void print_popcorn_time(int bag_ounces){

   if(bag_ounces < 3){

       cout<<"Too small"<<endl;

   }else if(bag_ounces > 10){

       cout<<"Too large"<<endl;

   }else{

       cout<<(6 * bag_ounces)<<"seconds"<<endl;

   }

}

Explanation:

The function is the block of the statement which performs the special task.

For checking the condition in the program, the if-else statement is used.

It can check the condition one or two but if we want to check the more than two different conditions then the continuous if-else statement is used.

syntax of continuous if else:

if(condition){

statement;

}else if(condition)

statement;

}else{

statement;

}

In the question, there are three conditions;

1. bag_ounces is less than 3

2. bag_ounces greater than 10

3. else part.

we put the condition in the above if-else statement and print the corresponding message.

erastova [34]3 years ago
5 0

Answer:

def print_popcorn_time(bag_ounces):

   if bag_ounces < 3:

       print("Too small")

   elif bag_ounces > 10:

        print("Too large")

   else:

        bag_ounces = bag_ounces * 6

        print(bag_ounces, "seconds")

Explanation:

def print_popcorn_time(bag_ounces): #fed function

   if bag_ounces < 3:  #1st if statement

       print("Too small") #print function

   elif bag_ounces > 10: #else if

        print("Too large") #print than print

   else:  #else:

        bag_ounces = bag_ounces * 6 #do work

        print(bag_ounces, "seconds") #print

You might be interested in
A user complains that her computer is performing slowly. She tells you the problem started about a week ago when new database so
motikmotik

Answer/Explanation:

It is best to use Performance Monitor and Process counters to observe performance.

Cheers

6 0
3 years ago
c++ 2.30 LAB: Phone number breakdown Given a long long integer representing a 10-digit phone number, output the area code, prefi
Nady [450]

Answer:

#include <iostream>

using namespace std;

int main()

{

   //declare variable to store phone numbers,its area code, prefix and line number.

   long phone_number;

   int area_code, prefix,line_number;

   cout<<"Enter 10-digit phone number:"<<endl;

   //input 10-digit phone number

   cin>>phone_number;

   //logic to find area_code, prefix, and line_number.

   area_code = phone_number/10000000;

   prefix = (phone_number/10000)%1000;

   line_number = phone_number%10000;

   //output phone number in asked format.

   cout<<area_code<<"-"<<prefix<<"-"<<line_number<<endl;

   return 0;

}

Output:

Enter 10-digit phone number:

8005551212

800-555-1212

Explanation:

In the above program 10 digit phone number entered by user will be stored in the variable phone_number.

Then using this phone_number variable area_code, prefix, and line number are calculated using the following logic:

area_code = phone_number/10000000;

prefix = (phone_number/10000)%1000;

line_number = phone_number%10000;

Finally these area_code, prefix, and line_number are displayed with hyphen in between using cout statement.

5 0
3 years ago
A.
FrozenT [24]

Answer:

b. the action is not allowed.

Explanation:

Traffic signs are established rules and regulations designed to direct and guide commuters and other road users.

A red circle and diagonal slash on a sign simply means that the action is not allowed.

A hortatory technique is focused on encouraging, exhorting and urging people to do that which is right, acceptable and worthy of emulation by others.

For example, commuters and road users are being urged not to litter the highway with thrash, waste, or dirt, in order to protect the planet from environmental degradation and pollution. This would help in conserving and mitigating risks posing as a threat to our dear planet and habitat.

Hence, a hortatory technique in policy implementation and enactment is primarily aimed at appealing to the sense and conscience of individuals, to engage in socially responsible acts.

7 0
3 years ago
What is one of the main problems that can occur when implementing a large number of new systems within an organization?
attashe74 [19]

Trying to conduct business as usual while still training, learning, and migrating to a new system, is one of the main problems that can occur when implementing a large number of new systems within an organization. Linking up together problems that go hand in hand with a lengthy implementation process and the company conducting business as usual, this always becomes a very big issue. This practice of employees attending to their daily tasks of their main job and contributing to the software project at the same time can be detrimental and can cause software implementation to take much longer.

8 0
3 years ago
Answer to this if you have apex legends on either pc xbox one or PS4 for the one that answers and does gets brainliest please do
weqwewe [10]

Answer:

I got it on Ps4

3 0
2 years ago
Read 2 more answers
Other questions:
  • Nunya is a computer software company that employs highly intelligent, but somewhat unusual people. Every Friday, free lollipops,
    13·1 answer
  • Describe the following software process models using your own words .Your explanation should also provide an example of a softwa
    12·1 answer
  • What type of program would you use to create a personal budget?
    9·1 answer
  • How are a cell's content and format related?
    12·2 answers
  • Which of the following is a rule of thumb for cell phones or smartphone etiquette ?
    12·1 answer
  • Your task is to create a bash shell script that is able to backup all the C++ program files in your current directory. The algor
    10·1 answer
  • For all programs, you should write a small amount of code and _______
    6·1 answer
  • Which compound is obtained by the oxidation of primary alcohol with nascent oxygen​
    11·1 answer
  • What is an advantage of using a dynamic hard drive in a vm?
    10·1 answer
  • Explain briefly how learning how to follow can make a person a good leader
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!