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
telo118 [61]
3 years ago
7

Using C++, complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2

, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by "seconds". End with a newline. Example output for ounces = 7:42 seconds1 #include 2 using namespace std; 34 void PrintPopcornTime(int bagOunces) { 56 /* Your solution goes here */ 78 } 9 int main() { 10 int userOunces; cin >> userOunces; 11 PrintPopcornTime12 13 return 0; 14 }
Computers and Technology
1 answer:
victus00 [196]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime(int bagOunces) {

   if(bagOunces < 2)

       cout << "Too small" << endl;

   else if(bagOunces > 10)

       cout << "Too large" << endl;

   else

       cout << 6 * bagOunces <<" seconds" << endl;

}

int main()

{

   int userOunces;

   cin >> userOunces;

   PrintPopcornTime(userOunces);

   return 0;

}

Explanation:

Inside the function PrintPopcornTime, check the parameter bagOunces using if structure. Depending on the value of bagOunces, print the required information.

Inside the main, ask the user for the userOunces. Call the PrintPopcornTime function with the userOunces.

You might be interested in
A student is curious about how a Web site appears on his computer screen. On a piece of paper,
Temka [501]

Answer:

When you go out to open a web page then you should know that It’s not the OSI model that comes into the picture, and in fact, it is just for study purposes, and it does not work in real network work, The exact one used is the TCP/IP model. However, the OSI model separates the concepts into various layers, and hence used for study purposes.

When you try to open a web address through a web browser, then the web browser uses the HTTP that is an Application layer protocol.

The web browser thus finds the IP address of the URL through the Domain Name System. And this is as well the Application layer protocol.

However, you will find that the actual process is even more complex.

The browser now forms an HTTP packet which mentions, “Hello I would like to get the web page from the server”. Now the browser sends the HTTP packet to the TCP, which stands for Transmission control protocol, and is a transport layer protocol.

Here the adjacent layer interaction works. However, that is on the same device, and currently, the packet is on your PC only. The ALI states that the higher layer asks the next lower layer protocol to get done the service, and the lower layer delivers the service to the higher layer just above it. And this interaction gets repeated until the data finds itself at the lowest layer.

The main job of the TCP is to create a pipe in between you and the server, such that the data can be transferred via the pipe. And for this the TCP on your PC talks to the TCP on the server.

Now the TCP puts up its details over the HTTP packet. And these are necessary for managing the pipe/session.

Now the packet is handed to the IP process or the internet protocol, which is an internet layer protocol. The main task performed by the IP is addressing and routing. It's like a postal service, that routes the letter via various postal offices to reach the correct one. IP now puts its info on top of the TCP packet. This info is required for routing on the internet.

The packet is now handed over to the network access or the network interface layer. And this defines the hardware and protocols that are required for delivering the data via the physical network. The majority of the times the physical network used is the Ethernet.

Your PC now binds the IP packet in between the Ethernet header and the Ethernet trailer, and thus forms an Ethernet frame. You should know that Ethernet has a MAC address that is being made use of for sending the frame within the LAN.  And now the PC transmits the Ethernet frame bits physically with the help of the electricity that flows through the Ethernet Cables.

The packet now reaches the server. The web server recreates the bits through the interpretation of the electrical signals. And the webserver now removes and discards the ethernet header and trailer from the ethernet frame, and de encapsulates it. And in the same manner, it reads through the TCP data, and finally transfers that to the HTTP process which can figure out the HTTP get request.

Now the webserver in s similar manner sends back the detail. And this process can be repeated any number of times.

Also, keep in mind that in case of secure website, there is one extra step, and that is the verification of the SSL certificate, at both the client and server end. Rest of the process is same.

Explanation:

Please check the answer section.

6 0
3 years ago
If an administrator wanted to change the IP configuration settings on the first Ethernet interface to 10.1.1.1 and the netmask t
KatRina [158]
I’m assuming we’re talking about this through Windows CL

in such case the command ‘netsh’
4 0
4 years ago
List four safety factors that must be considered when building mine shaft headgear model
trasher [3.6K]

The four safety factors that must be considered when building mine shaft headgear model are:

  • Do always Prioritize your Planning.
  • Keep a consistent Rigorous Standards.
  • Be Attentive to Equipment Upkeep.
  • Try and Improve Visibility.

<h3>What are four materials used to mine headgear?</h3>

Materials that are known to be used in the creation of a mine shaft headgear are the use of steel and concrete.

Note that The headgear must be one that can be able to transport miners and equipment to a depth of 500m underground and as such, The four safety factors that must be considered when building mine shaft headgear model are:

  • Do always Prioritize your Planning.
  • Keep a consistent Rigorous Standards.
  • Be Attentive to Equipment Upkeep.
  • Try and Improve Visibility.

Learn more about safety factors from

brainly.com/question/13261411

#SPJ1

7 0
2 years ago
2×2×2×2×2×2×2×2:-) :-) :-) :-) :-) :-) :-! ​
Gre4nikov [31]

Answer:

256 :-) :-) :-) :-) :-) :-) :-! ​

5 0
3 years ago
Read 2 more answers
The number of bytes in an array is always a multiple of the number of ____ in an array.
liq [111]

Answer:

The Correct answer for the given question is "elements " .

Explanation:

The number of bytes is always multiple by the number of array elements in an array to getting total memory occupy by any array .

For example :

int a[100];

Since in c language int is 2 bytes

So memory in number of bytes =2*100=200 bytes

Indexes is keep the track of physical location of any file this is also used to track the logical location of file in database so this option is wrong

Subscripts are the index number of an array so we will never used subscripts to getting total memory occupy by any array so this option is wrong

Iterators  are the loop so this option is wrong.

Due to this the correct answer is elements.

4 0
4 years ago
Other questions:
  • Consider the following table used for grading assignments.
    10·1 answer
  • Write code that inserts useritems into the output string stream itemsoss until the user enters "exit". each item should be follo
    15·1 answer
  • State three differences between a hard drive and a pen drive​
    6·1 answer
  • The term “gigahertz” refers to how many cycles per second? One thousand One hundred One billion One million
    7·1 answer
  • Why is my computer acting up?
    14·1 answer
  • _____emphasizes on proper breathing and the mind-body-spirit connections.​
    6·2 answers
  • Which of the following components helps to limit the front-to-back movement of the crankshaft? 
    9·2 answers
  • Would a hurricane form if the humidity is really high and the breeze is very low
    11·1 answer
  • 2.3 pseudocode exercise on edhesive
    9·1 answer
  • What is the full form of cpu​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!