answer.
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
Inessa [10]
2 years ago
7

Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, 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 = 7:
Engineering
1 answer:
weqwewe [10]2 years ago
8 0

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime(int bagOunces) {

if(bagOunces < 3){

 cout << "Too small";

 cout << endl;

}

else if(bagOunces > 10){

 cout << "Too large";

 cout << endl;

}

else{

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

}

}

int main() {

  PrintPopcornTime(7);

  return 0;

}

Explanation:

Using C++ to write the program. In line 1 we define the header "#include <iostream>"  that defines the standard input/output stream objects. In line 2 "using namespace std" gives me the ability to use classes or functions, From lines 5 to 17 we define the function "PrintPopcornTime(), with int parameter bagOunces" Line 19 we can then call the function using 7 as the argument "PrintPopcornTime(7);" to get the expected output.

You might be interested in
Suppose we store a relation R (x,y) in a grid file. Both attributes have a range of values from 0 to 1000. The partitions of thi
leva [86]

Answer:

For (a) The total number of buckets from the given query for the relation is 25 buckets (b) the nearest neighboring query is (80, 200) (80, 150), (100, 150), (120,150) and (120, 200)

Explanation:

From the question stated, we need to define what a Grid file is

Grid File it is a structure of data that are used to divide the total space into a grid non-periodic, where set of point (small) are defined by more than one cells of the grid.

(a)Finding buckets for the query

The relation is divided into two parts which ranges from 0 to 1000, the first part is partitioned in every 20 units, at 20, 40, 60 etc; a second part is partitioned into every 50 units at 50, 100, 150 etc.

The total number of buckets from the given query for the relation is 25 buckets

(b)Finding the closest point or nearest point

The closest point discovered in the distance is little above 15

These points are are the points closer to the point target (110, 205) which can be found in five neighboring rectangles with left corners lower is stated as follows:

(80, 200) (80, 150), (100, 150), (120,150) and (120, 200)

3 0
2 years ago
Fix the code so the program will run correctly for MAXCHEESE values of 0 to 20 (inclusive). Note that the value of MAXCHEESE is
GarryVolchara [31]

Answer:

Code fixed below using Java

Explanation:

<u>Error.java </u>

import java.util.Random;

public class Error {

   public static void main(String[] args) {

       final int MAXCHEESE = 10;

       String[] names = new String[MAXCHEESE];

       double[] prices = new double[MAXCHEESE];

       double[] amounts = new double[MAXCHEESE];

       // Three Special Cheeses

       names[0] = "Humboldt Fog";

       prices[0] = 25.00;

       names[1] = "Red Hawk";

       prices[1] = 40.50;

       names[2] = "Teleme";

       prices[2] = 17.25;

       System.out.println("We sell " + MAXCHEESE + " kind of Cheese:");

       System.out.println(names[0] + ": $" + prices[0] + " per pound");

       System.out.println(names[1] + ": $" + prices[1] + " per pound");

       System.out.println(names[2] + ": $" + prices[2] + " per pound");

       Random ranGen = new Random(100);

       // error at initialising i

       // i should be from 0 to MAXCHEESE value

       for (int i = 0; i < MAXCHEESE; i++) {

           names[i] = "Cheese Type " + (char) ('A' + i);

           prices[i] = ranGen.nextInt(1000) / 100.0;

           amounts[i] = 0;

           System.out.println(names[i] + ": $" + prices[i] + " per pound");

       }        

   }

}

7 0
2 years ago
If water molecules pass through a membrane with a steady state flux of 220 mole/(m2 day), how long will it take, in hours, for 0
goblinko [34]

Answer:

<em>0.0386 hr</em>

<em></em>

Explanation:

Area = 565 cm^2 = 0.0565 m^2  (1 cm^2 = 0.0001 m^2)

flux state rate = 220 mole/m^2-day

<em>There are 24 hrs in a day,</em> therefore rate in hrs will be

220/24 = 9.17 mole/m^2-hr

mass of water = 0.4 kg

molar mass of water = (1 x 2) + 16 = 18 kg/mole

therefore,

<em>mole of water = mass of water/molar mass of water</em>

mole of water = 0.4/18 = 0.02 mole

<em>mole flux = mole/area</em> = 0.02/0.0565 = 0.354 mol/m^2

<em>time that will be taken will be for water to pass = mole flux/mole flux rate</em>

time = 0.354/9.17 = <em>0.0386 hr</em>

7 0
2 years ago
A cylindrical rod of copper (E = 110 GPa, 16 × 106 psi) having a yield strength of 240 MPa (35,000 psi) is to be subjected to a
77julia77 [94]

Answer:

7.65 mm

Explanation:

Stress, \sigma=\frac {F}{A} where F is the force and A is the area

Also, \sigma=E\times \frac {\triangle L}{L}

Where E is Young’s modulus, L is the length and \triangle L is the elongation

Therefore,

\frac {F}{A}= E\times \frac {\triangle L}{L}

Making A the subject of the formula then

A=\frac {FL}{E\triangle L}=\frac {6660\times 380}{110\times 10^{9}\times 0.5}=4.60145\times 10^{-5} m^{2}

Since A=\frac {\pi d^{2}}{4} then  

d=\sqrt {\frac {4A}{\pi}}=\sqrt {\frac {4\times 4.60145\times 10^{-5}}{\pi}}= 0.00765425m= 7.654249728 mm\approx 7.65 mm

4 0
2 years ago
In a production facility, 1.6-in-thick 2-ft × 2-ft square brass plates (rho = 532.5 lbm/ft3 and cp = 0.091 Btu/lbm·°F) that are
Gnoma [55]

Answer:

106600 btu/s

<u>note: </u>

<u><em> solution is attached due to error in mathematical equation. please find the attachment</em></u>

8 0
2 years ago
Other questions:
  • Tin atoms are introduced into a FCC copper crystal, producing an alloy with a lattice pa- rameter of 3.7589 x 10-8 cm and a dens
    8·1 answer
  • a. Replacing standard incandescent lightbulbs with energy-efficient compact fluorescent lightbulbs can save a lot of energy. Cal
    9·1 answer
  • A 0.9% solution of NaCl is considered isotonic to mammalian cells. what molar concentration is this?
    10·1 answer
  • At a certain college, 30% of the students major in engineering, 20% play club sports, and 10% both major in engineering and play
    14·1 answer
  • Air in tankBis at 200 kPa, 280 K and mass 1 kg. It is connected to an empty piston/cylinder with a float pressure of 400 kPa sim
    6·1 answer
  • Air whose density is 0.082 lbm/ft3 enters the duct of an air-conditioning system at a volume flow rate of 450 ft3/min. If the di
    8·2 answers
  • An uninsulated, thin-walled pipe of 100-mm diameter is used to transport water to equipment that operates outdoors and uses the
    9·1 answer
  • The purification of hydrogen gas is possible by diffusion through a thin palladium sheet. Calculate the number of kilograms of h
    8·1 answer
  • The small washer is sliding down the cord OA. When it is at the midpoint, its speed is 28 m/s and its acceleration is 7 m/s 2 .
    13·1 answer
  • thermal energy is being added to steam at 475.8 kPa and 75% quality. determine the amount of thermal energy to be added to creat
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!