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 3 steps with 1 images
- Suppose you have a thermometer in a lab that displays temperaturesin Fahrenheit. You would like to convert the reading into Celsius andconnect a digital screen to display a message. If the temperature is 40 o Cor more, the screen would display "hot temperature", between 39 o C and30 o C would display "warm temperature", between 29 o C and 11 o C woulddisplay "good temperature", and anything from 10 o C or lower would display"Winter is here...". Write a program in python that would get the unit converter anddisplay screen working.arrow_forwardWrite a program that prints the numbers from 1 to 100 (inclusive), one per line. However, there are three special cases where instead of printing the number, you print a message in its place:1. If the number you would print is divisible by 3, print the message: Better three hours too soon than a minute too late.2. If the number you would print is divisible by 5, print the message: Where do you see yourself in five years?3. If the number you would print is divisible by both 3 and 5, instead print out: In the future, everyone will be world famous for 15 minutes.Make sure to print the exact strings given above!arrow_forwardWrite a Java program that allows the user to enter the expenses’ in term of AED by using a while loop to calculate the average. The number of expenses is unknown. To stop entering the expenses, the user needs to enter a negative value. Show the total, average and the count.arrow_forward
- 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_forwardWrite a program that reads a string (password) and a number. The maximum number of attempts (3). The program with stop asking data if the word ‘quit’ is provided in the password value. If user provide correct credential the message access granted will be displayed otherwise the message access denied with be generated.arrow_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_forward
- Write 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_forwardIt is a python program. Make sure it works and run in IDLE 3.10. Please show the code screenshot and output screenshot.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