Answer:
how the frog grows through its life
Explanation:
Answer:
#include<stdio.h> //header file
int main() //main function
{
float num; // variable declaration
printf("Enter a number to test:\n"); // getting variable for test
scanf("%f", &num);
if (num>45.6) //Testing weather greater or smaller
printf("\n %f is greater than 45.6", num); // Result if greater
else
printf("\n %f is not greater than 45.6", num); // Result if smaller or equal
return 0;
}
Explanation:
- First of all , a variable will be declared in float (data type ).
- User will input data in variable.
- The variable will be compared using logical operator with 45.6
- If it is greater, A phrase will be passed that number is greater than 45.6
- Else if the number will not greater the phrase will say that the number is not greater than 45.6
Answer:
Z = A + B
Explanation:
The logic network can be seen attached below. This basically shows that if either of the two inputs are True then the output would apply. In this scenario, the output would be the alarm going off. Since either one of the windows being opened in this scenario would set off the alarm then the logic operator that needs to be used would be OR. In this scenario, the two windows are represented by the variables A and B while the output can be represented by the variable Z. Using these variables, we can apply the following boolean expression.
Z = A + B
Answer:
- import time
- import threading
- response = None
- def checkAnswer():
-
- if response != None:
- time.sleep(10)
- return
- print("\nInput time out")
- thread1 = threading.Thread(target=checkAnswer)
- thread1.start()
- response = input("Enter your name: ")
- print("Welcome " + response)
Explanation:
The solution code is written in Python 3.
Firstly import time and threading module (Line 1 -2). We are going to use sleep method from time module to set the interval time and also the Thread class from threading module to create a parallel running thread to check user response.
Let's initialize response variable with None (Line 4). Next, we define a function checkAnswer (Line 6). In the function, we set time interval 10 seconds using the sleep method and create an if condition to evaluate if the response is not None simply trigger the return statement or display the message input time out (Line 7- 10).
Next, we create a thread to run checkAnswer function (Line 12 - 13). While the thread1 is running, prompt the user to input name and display their name (Line 15 -16). Since the thread1 is running, if there is no response from user, the Input time out message will be displayed.