Answer:
Following are the program in the Python Programming Language.
#set the infinite while loop
while(True):
#get string input from the user
name=input()
#get integer input from the user
num=int(input())
#set the if statement to break the loop
if(num==0):
break
#otherwise, print the following output
else:
print("Eating {} {} a day keeps the doctor away.".format(num, name))
<u>Output</u>:
oranges
5
Eating 5 oranges a day keeps the doctor away.
apple
0
Explanation:
<u>Following are the description of the program</u>:
- Set the loop that iterates at infinite times and inside the loop.
- Declare two variables which are 'name' that get string type input from the user and 'num' that get integer type input from the user.
- Set the if conditional statement for break the infinite while loop.
- Otherwise, it prints the following output.
Answer: Codeacademy. One of the most popular free places to learn coding is Codeacademy.
Explanation:
Answer:
By presuming the question expect us to write a program to address the problem and the solution code written in Python is as follow:
- beer_name = input("Enter beer name: ")
- abv = int(input("Enter ABV value: "))
-
- if(abv > 10):
- label = "Very High"
- elif(abv >=6):
- label = "High"
- elif(abv >=3):
- label = "Average"
- else:
- label = "Low"
-
- print("Beer Name: " + beer_name)
- print("ABV value: " + str(abv))
- print(label)
Explanation:
Firstly, we can use input function to prompt user to input beer name and ABV value (Line 1 - 2).
Next, create if else if statements to check abv fallen into which range of value and then set a label accordingly (Line 4 -11). For example if abv is 4, the label will be set to "Average".
At last, print the information of beer that includes beer name, abv value and label (Line 13 - 15).
3 is correct because if brings you to the lock screen and lets you restart the computer
1 is wrong because if you disconnect it there is a chance if won't connect and power it anymore.