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
GarryVolchara [31]
3 years ago
7

Write a program that will prompt the user for some input, allow the user a certain amount of time to respond (e.g., 10 seconds),

and if no response is provided within the allotted time, an appropriate timeout message printed on the screen.
Computers and Technology
1 answer:
Nata [24]3 years ago
7 0

Answer:

  1. import time  
  2. import threading  
  3. response = None  
  4. def checkAnswer():
  5.    
  6.    if response != None:
  7.        time.sleep(10)
  8.        return  
  9.    print("\nInput time out")
  10. thread1 = threading.Thread(target=checkAnswer)
  11. thread1.start()
  12. response = input("Enter your name: ")
  13. 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.

You might be interested in
Links to the four default folders can be found on the left side of the file explorer window under the _________ heading:
dimulka [17.4K]

Answer:

Libraries

Explanation:

Document itself is a folder and is not a heading by the way.

Local simply means on the machine you are working and does not have default folders.

Desktop is  name of screen which is used as a gateway for using windows.

So, they cannot be correct answers.

4 0
3 years ago
Read 2 more answers
The _____ requirements are associated with the efficiency, maintainability, portability, reliability, reusability, testability,
melamori03 [73]

Answer: Non-functional

Explanation:

Non-functional requirement(NFR) are the the requirements that evaluates operation of any particular system.It consist of several factors for judging the system such as security, reliability, quality, utility, maintainability etc.These parameters depicts about how a system will perform the tasks.

Other options are incorrect because function requires are used for depicting about specific and certain function in system. Performance requirements deal with the parameter of operation execution.

Correctness and standard requirement are measure for correcting system and general needs in a system respectively.

7 0
3 years ago
Read 2 more answers
Object-Oriented Programming (Using Java Language)
Delicious77 [7]

Answer:

import java.util.Scanner;

class Main {  

 public static void main(String args[]) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter a decimal value (0 to 15): ");

       int num = scan.nextInt();

       scan.close();

       

       if (num < 0 || num >15) {

           System.out.printf("%d is an invalid input\n", num);

       } else {

           System.out.printf("The hex value is %X\n", num);

       }

 }

}

Explanation:

Hopefully this example will get you going for the other assignments.

3 0
3 years ago
_______ integrates all departments and functions throughout an organization into a single IT system (or integrated set of IT sys
aleksklad [387]

Answer:

ERP ( Enterprise Resource Planning )

Explanation:

ERP mainly stands for enterprise resource planning. ERP is system software which is a combination of many application which works together to automate a business process.  

It is a business management software which reduces the wastage of time by making tasks simpler like when we talk about accounting and stock in a company, it takes very much time when maintaining by humans but when it comes to ERP software, it only takes a while to give you detailed information about everything. It automates the manual process of a company and gives speed to the growth of the company.

3 0
3 years ago
If you want to change the speed of a layer's horizontal scrolling, what should you change?
kirill [66]

Answer: A; X coefficient

Explanation: Hope I helped out !

-Carrie

Ps. it would mean a lot if you marked brainliest

6 0
3 years ago
Other questions:
  • Which of these is not a combination of a keyboard and percussion musical instrument?
    13·1 answer
  • What financial behaviors will typically lead to a low credit score?
    14·1 answer
  • A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line u
    8·2 answers
  • Which type of drawer has three dispensing modes: single-dose, multi-dose, and matrix?
    13·1 answer
  • If two hosts are connected by five networks, how many frames will there be when one host sends a packet to the other host? 1 2 5
    13·1 answer
  • A company purchased a high-quality color laser printer to print color brochures and sales proposals. The printer is connected to
    5·1 answer
  • Match the items with their respective descriptions.
    6·2 answers
  • What is not true of efs
    11·1 answer
  • I have a Dell laptop and last night it said that it needed to repair it self and asked me to restart it. So I did but every time
    11·1 answer
  • LIST THE 7 BEST PROGRAMMING MOVIES 2020-2021.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!