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");
}
}
}
#First we define the variables to house the temperatures
#temp is an empty array that will be used to store the temperature
Temp = []
#The months is defined as stated below
months = 12
#Ask the user for the temperature input and unit if possible
print("Kindly enter the temperature here")
#the program enter loop to get the temperatures.
for x in range(months):
InitTemp = str(input("Kindly add the unit behind the number .eg C for celcius"))
Temp.append(InitTemp)
j=0
for x in range(len(Temp)):
j=j+1
print("The Temperature is", " ", Temp[x], "for the ", j, "Month" )
#there is an attached photo for the flowchart
Answer:
The answer is below
Explanation:
There are various reasons to apply arrays in a program. Some of which includes:
1. Arrays provides users to easily save specified numbers of the element in them.
2. It easily store data of similar types and sizes.
3. It allows users to store data in various dimensional arrays.
4. It eliminates deficit of memories for the location of its elements
Answer:
Transducer is a type of device that converts one type of signal into another.