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
mixer [17]
3 years ago
15

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. Sample output with input: 7 42 seconds
Computers and Technology
1 answer:
Gnoma [55]3 years ago
3 0

Answer:

public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

           System.out.println("Too Small");

       }

       else if(bag_ounces>10){

           System.out.println("Too Large");

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

Explanation:

Using Java prograamming Language.

The Method (function) print_popcorn_time is defined to accept a single parameter of type int

Using if...else if ....else statements it prints the expected output given in the question

A complete java program calling the method is given below

public class num6 {

   public static void main(String[] args) {

       int bagOunces = 7;

       print_popcorn_time(bagOunces);

   }

   public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

           System.out.println("Too Small");

       }

       else if(bag_ounces>10){

           System.out.println("Too Large");

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

}

You might be interested in
Which command on the Insert tab of the PowerPoint Online application is used to add a Venn diagram or process chart to a present
Setler [38]

The command to add a Venn Diagram or a process chart on PowerPoint Online is to select the Insert tab, then select the SmartArt button, and there is the process charts listed under Process. But the Venn Diagram is listed under List.

7 0
2 years ago
Read 2 more answers
Given an array arr, of type int, along with two int variables i and j, write some code that swaps the values of arr[i] and arr[j
Inessa05 [86]

You'll need a helper variable for this, so depending on your programming language, the solution becomes:

int helper;

helper = arr[i];

arr[i] = arr[j];

arr[j] = helper;

3 0
2 years ago
1. Grouping Data in a Pivot Table can help you do what?
valentina_108 [34]

Answer:

1.Grouping data in a PivotTable can help you show a subset of data to analyze. For example, you may want to group an unwieldy list of dates or times (date and time fields in the PivotTable) into quarters and months, like this image. Note:  The time grouping feature is new in Excel 2016.

2.Select the rows or columns you wish to grouP

On the Data tab, in the Outline group, click the Group command.  

In the Group dialog box, select Rows or Columns and click OK.

3.Select the rows or columns you wish to ungroup.

On the Data tab, in the Outline group, click the Ungroup command.  

In the Group dialog box, select Rows or Columns and click OK.

4.

1.Launch Microsoft Excel.

2

Browse to and open the workbook file containing the pivot table and source data for which you need filter data.

3

Select the worksheet containing the pivot tab and make it active by clicking the appropriate tab.

4

Determine the attribute by which you want to filter data in your pivot table.  

The attribute should be one of the column labels from the source data that is populating your pivot table.

For example, assume your source data contains sales by product, month and region. You could choose any one of these attributes for your filter and have your pivot table display data for only certain products, certain months or certain regions. Changing the filter field would determine which values for that attribute are shown.

5

Force the Pivot Table Wizard or Field List to launch by clicking a cell inside the pivot table.

6

Drag and drop the column label field name you wish to apply as a filter to the "Report Filter" section of the pivot table field list.  

This field name may already be in the "Column Labels" or "Row Labels" section.

It may be in the list of all field names as an unused field.

7

Set the filter to display one of the values for the field.  

You can set the filter to display all values or only one. Click the arrow beside the filtered label and check the "Select Multiple Items" check box if you would like to select certain values for your filter.

Explanation:

PLZ MARK ME AS A BRAINLIST ;)

4 0
3 years ago
Alarm filtering is alarm clustering that may be based on combinations of frequency, similarity in attack signature, similarity i
Angelina_Jolie [31]
Wait what is the question? All you are saying is a fact. :|
4 0
3 years ago
Assume a computer uses pipelining of 9 stages. Each stage demands 3 clock cycles to finish its task. How many clock cycles are n
serg [7]

Answer:

Explanation:

b) Each stage requires one clock cycle; ... Calculate how many clock cycles will take execution of this segment on the regular (non- pipelined) ... Instruction. Clock cycle number . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... It is possible ... It means that all stages of 5-stage pipeline are always busy (no stalls) during the task.

8 0
2 years ago
Other questions:
  • Extend the flow properties and definitions to the multiple-source, multiple- sink problem. Show that any flow in a multiple-sour
    13·1 answer
  • Where can you change your web page SafeSearch settings?
    8·1 answer
  • Typically, a dvd has how many times more capacity than a cd?
    5·1 answer
  • Assume that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 month
    13·1 answer
  • Most large organizations store data through a strategy called a(n) ________ to promote efficient and safe use of data across the
    11·1 answer
  • How often does colleges update the cost of attendance on their website?.
    13·1 answer
  • ou and a friend decide to watch a movie on your computer. The movie is saved on a second hard drive on your system. When you are
    7·1 answer
  • DTE just installed 500kW of solar capacity on the MCCC campus. the cost of the installation was about $3 million. what was the c
    10·1 answer
  • Gray London is a retired race car driver who helped Dale Earnhardt, Jr. get his start. He is writing a book and making a video a
    9·1 answer
  • Why does it keep saying this when I’m putting my right credit card number
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!