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
White raven [17]
3 years ago
5

Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "To

o 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.1 #include 2 using namespace std; 34 void PrintPopcornTime (int bagOunces)5 6 Your solution goes here 10 int main) 7891011 PrintPopcornTime(7) 12 13 return 0 14
Computers and Technology
1 answer:
Ludmilka [50]3 years ago
4 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 << bagOunces*6 <<" seconds"<<endl;

   }

}

int main(){

   PrintPopcornTime(7);

   

   return 0;

}

Explanation:

Create a function called PrintPopcornTime that takes one parameter, bagOunces

Check the bagOunces using if-else structure. If it is smaller than 2, print "Too small". If it is greater than 10, print "Too large". Otherwise, calculate and print 6*bagOunces followed by " seconds".

Call the function in the main function with parameter 7. Since 7 is not smaller than 2 or not greater than 10, "42 seconds" will be printed.

You might be interested in
On tool hackers use to get sensitive information from victims is/are:
Feliz [49]
Pretty sure it’s keyloggers because it’s the only one that makes sense to me but I’m not 100% sure on that one
5 0
3 years ago
Read 2 more answers
__________ is an attempt to gain access to a network by posing as an authorized user in order to find sensitive information, suc
laila [671]
Spoofing is<span> an attempt to gain access to a network by posing as an authorized user in order to find sensitive information, such as passwords and credit card information. </span>
8 0
3 years ago
Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
stira [4]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// function to calculate cost

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon){

  double cost;

  //Expression to compute cost

  cost = drivenMiles / milesPerGallon * dollarsPerGallon;

  return cost;

}

// main function

int main()

{

   double drivenMiles, milesPerGallon, dollarsPerGallon;

  //initialise the variables

  drivenMiles = 50;

  milesPerGallon = 20.0;

  dollarsPerGallon = 3.1599;

  //Call function

  double cost = DrivingCost(drivenMiles,milesPerGallon,dollarsPerGallon);

  //Display result

  cout<<"Driven miles : "<<drivenMiles<<endl;

  cout<<"Miles per Gallon : "<<milesPerGallon<<endl;

  cout<<"Dollars per Gallon : "<<dollarsPerGallon<<endl;

  cout << fixed << setprecision(2);

  cout<<"The total driving cost : "<<cost ;

  return 0;

}

Explanation:

Declare and initialize drivenMiles with 50, milesPerGallon with 20.0 and dollarsPerGallon with 3.1599.Call the function DrivingCost() with these parameters,This will calculate the cost and return the value.Print the result after getting the cost.Similarly we can calculate cost for drivenMiles equals to 10 and 400 miles also.

Output:

Driven miles : 50

Miles per Gallon : 20

Dollars per Gallon : 3.1599

The total driving cost : 7.90

5 0
3 years ago
You want your computer to boot off of the network and have the ability to be brought out of sleep mode over the network. Which t
notsponge [240]

The two technologies should be implemented in the BIOS are PXE and WOL

<h3>What is the term above about?</h3>

WOL is known to be a term that connote that which is often used to put on (power on) and PXE is known to be a term that is often used for turning (booting) that is when one wants to load an OS from a remote server.

Conclusively, Note that  WoL often occurs before PXE and as such, he two technologies should be implemented in the BIOS are PXE and WOL.

Learn more about technologies  from

brainly.com/question/25110079

#SPJ1

4 0
2 years ago
Write the printItem() method for the base class. Sample output for below program:
Anna [14]

Answer:

The printItem() method code is filled in the explanation, highlighted with bold font.

Explanation:

// ===== Code from file BaseItem.java =====

public class BaseItem {

  protected String lastName;

  public void setLastName(String providedName) {

      lastName = providedName;

      return;

  }

// FIXME: Define printItem() method

/* Your solution goes here */

  public void printItem() {

      // TODO Auto-generated method stub

      System.out.println("Last name: "+lastName);

  }

}

// ===== end =====

4 0
3 years ago
Other questions:
  • The bias condition for a transistor to be used as a linear amplifier is called:________.
    14·1 answer
  • Technician A says a 2:1 gear ratio doubles the amount of torque. Technician B says a 2:1 gear ratio reduces the speed by half. W
    8·1 answer
  • The information gathering technique that enables the analyst to collect facts and opinions from a wide range of geographically d
    11·1 answer
  • HELP URGENT
    12·2 answers
  • In apersuasive message, opposing ideas should be:
    13·1 answer
  • Related to Image Classification
    13·1 answer
  • You have a screen and a pen, which is an instance of the Turtle class.
    13·2 answers
  • Karen wants to create a program that will allow the user to input their age. Which of these lines of code should be used?
    11·1 answer
  • arrange the following numbers from the highest to the lowest. ⅔,-7,0. no file or photo​
    8·1 answer
  • To freeze rows 1 and 2, and columns 1, 2, and 3, which cell should you highlight before selecting freeze panes?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!