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]
4 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]4 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
As designs incorporate new technologies, it can seem like an actor is walking through a projection or even become part of a proj
katovenus [111]

Answer:

The answer to the given question is "True".

Explanation:

In computer science, Design is an oriented programming language, that includes text, graphics, style elements, etc.  It is used to convert the projection into 3D to 2D which means a three-dimensional to two-dimensional object and uses to display the improve projection.

That's why the answer to this question is "True".    

4 0
3 years ago
Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consisting of a single positive in
Reika [66]

Answer:

see explaination for program code

Explanation:

scalar_product = 0

li=[]

li2=[]

#reading numbers1.txt and numbers2.txt intoli and li2 respectively

with open('numbers1.txt') as n1, open('numbers2.txt') as n2:

for line1 in n1:

li.append(int(line1))

for line2 in n2:

li2.append(int(line2))

#storing min list size into variable l

a=len(li)

b=len(li2)

if a<b:

l=a

else:

l=b

#calculating scalar product

for i in range(l):

scalar_product=scalar_product+li[i]*li2[i]

print("scalar product is",scalar_product)

6 0
4 years ago
You are creating a classification model from a DataFrame that contains data about traffic on highways in a US state, which conta
torisob [31]

Answer:

Split the data into two randomly sampled DataFrame,and then train the model with one DataFrame and test it with the other .As we have know labels in the data frame ,so this approch will give us a better picture on how accuractly our model is trained

Explanation:

Split the data into two randomly sampled DataFrame,and then train the model with one DataFrame and test it with the other .As we have know labels in the data frame ,so this approch will give us a better picture on how accuractly our model is trained

3 0
3 years ago
Jim maintains attendance records for his employees for the year. Row B includes the dates of attendance, and column A includes t
EastWind [94]
To lock multiple rows (starting with row 1), select the row below the last row you want frozen, choose the View tab, and then click Freeze Panes. To lock multiple columns, select the column to the right of the last column you want frozen, choose the View tab, and then click Freeze Panes<span>.
</span>
4 0
4 years ago
Read 2 more answers
What is a binary message
noname [10]
Binary SMS messages allow sending of various types of rich-content, such as transfering ringtones, telphone system settings and WAP-Push via text messaging. Any binary SMS message has 140 bytes of data which can be used. This data is split into two distinct parts - the user data header (UDH) and the message data.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
    9·1 answer
  • Which of the following statements is true?
    12·1 answer
  • Technology will not? A. change the way work is done B. process information faster C. slow the pace of work D. link companies and
    8·1 answer
  • A={a,b,c,d} B={p,q,r,s} find the value of A-B and B-A​
    13·1 answer
  • Using the triple DES algorithm, which is the cipher text?
    8·1 answer
  • A general rule for printing is to use _____ fonts for headlines and serif fonts for body text
    6·1 answer
  • When does MMF2 inactivate an Active object? A. When the score is higher than the game's previous high score B. When the player d
    15·1 answer
  • Can anyone help and write a sample answer to this please x
    7·1 answer
  • Will give brainliest
    14·1 answer
  • Which longstanding restaurant chain closed its last location in lake george, new york?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!