Find Jobs
Hire Freelancers

random number generator

$25-30 USD

Завершено
Опублікований over 22 years ago

$25-30 USD

Оплачується при отриманні
Problem: Write a program that generates simple arithmetic questions using the random number generator. The program prints out the question on the terminal and asks the user to input the answer. The program then waits a fixed time for the answer to be entered, prints out the correctness of the answer provided and the correct answer if it was wrong (or a message indicating the time ran out) on standard output and then moves on to the next question. Method: The main function will set up a loop, generate a question within the loop. The questions have only two operands. The operators including +, -, * and / are also to be random generated. The loop stops when the user sends interrupt signals (e.g. ctrl-C). The program then print out statistics such as how many questions have been attempted, and what is the percentage of the questions that were not answered. Here is how the program should go: loop (until interrupt signal is received) print the question fork in the child: read the answer, output the result, exit in the parent process: set a flag to indicate no answer sleep for required number of seconds if still no answer kill the child print out that time's up flush any pending characters from stdin * wait for the child (to avoid zombies) end of the loop clean up If the child terminates before the sleep is completed, it sends a signal called SIGCHLD to the parent. This signal interrupts the parent and, provided the parent has an interrupt handler for it, enables the parent to change the value of the (global) flag to indicate that an answer has been received. The program should accept one command line argument: the wait time per question. (No error checking is required in this assignment.) ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. ## Deadline information i need within 1 day n must run under unix
ID проекту: 2830275

Про проект

7 пропозицій(-ї)
Дистанційний проект
Активність 23 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
See private message.
$17 USD за 14 дні(-в)
4,9 (7 відгуки(-ів))
2,0
2,0
7 фрілансерів(-и) готові виконати цю роботу у середньому за $21 USD
Аватарка користувача
See private message.
$10,20 USD за 14 дні(-в)
5,0 (26 відгуки(-ів))
3,8
3,8
Аватарка користувача
See private message.
$21,25 USD за 14 дні(-в)
4,5 (33 відгуки(-ів))
4,2
4,2
Аватарка користувача
See private message.
$25,50 USD за 14 дні(-в)
4,4 (12 відгуки(-ів))
3,5
3,5
Аватарка користувача
See private message.
$25,50 USD за 14 дні(-в)
4,5 (1 відгук)
1,3
1,3
Аватарка користувача
See private message.
$21,25 USD за 14 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0
Аватарка користувача
See private message.
$25,50 USD за 14 дні(-в)
0,0 (2 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор AUSTRALIA
Australia
5,0
3
На сайті з жовт. 2, 2001

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.