Related questions
Write a program that creates a child process. The remaining of your program depends
on the last digit of your student number (9 digit number) (consider zero as an even number).
If the last digit of your student number (9 digit number) is an odd number:
After creating the child process, the parent process will set an alarm using the
SIGALRM signal to expire in X minutes. The value of X is calculated using the
last digit of your student number (9 digit number) plus 5. While the alarm timer does not expire, the
child process will print on the screen the message "The clock is ticking for Y
minutes!", where Y is the current amount of minutes passed since the first
message sent by the child process. Therefore, the child prints the message at
one minute intervals. When the alarm timer expires, the parent kills the child
process, waits for the child to die and then prints: "The child task is
completed!", and exits the program.
If the last digit of your student number (9 digit number) is an even number:
After creating the child process, the child process will set an alarm using the
SIGALRM signal to expire in X minutes. The value of X is calculated using the
last digit of your student number (9 digit number) plus 5. While the alarm timer does not expire, the
parent process will print on the screen the message "The clock is ticking for Y
minutes!", where Y is the current amount of minutes passed since the first
message was printed by the parent. Therefore, the parent prints the message
at one minute intervals. When the alarm timer expires, the child sends a
SIGINT signal to the parent process, sleeps for 2 seconds and terminates. When
the parent handles the SIGINT signal, it waits for the child to die and then prints:
"The child task is completed!", and exits the program.
Note: Inside the C code you must add meaningful explanatory comments to all major
commands and semantics of what the control structures are performing in relation to the
realisation of your unique example. Comments must be short, clear, and objective about
how the code will perform.
Step by stepSolved in 4 steps with 2 images
- Your team was asked to program a self-driving car that reaches its destination with minimum travel time. Write an algorithm for this car to choose from two possible road trips. You will calculate the travel time of each trip based on the car current speed and the distance to the target destination. Assume that both distances and car speed are givenarrow_forwardA patient suffering from asthma needs to keep a diary of their "peak flow" breathingreadings. This is just a number between 0 and 800 measuring how well they canblow air from their lungs. Their peak flow reading is the greatest of three readingstaken at one time. Write a Java procedural program to help the patient record their peak flow to show theirdoctor. The program should first ask the patient for the number their doctor has given themas being a dangerous reading. Any peak flow reading recorded that is less than thedanger level should lead to a message that they need to go to hospital immediately.Once entered, this value should not be changed.After storing this number, the program should go into a loop that only stops whenthey type 0 instead of a day. It should repeatedly ask them for the day of the monthwhich is a number from 1 to 31 (they may skip days) and then the three readingstaken that day. All the peak flow readings (ie the largest of each set of threereadings) should be...arrow_forwardWrite a program that reads an arbitrary number of integers that are in the range -25 to 25 inclusive and counts how many occurences of each are entered. Indicate the end of the input by a value outside of the range. After all input has been processed, print all of the values (with the number of occurences) that were entered one or more times.arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education