Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C - language please 1. Create a program that does the following, make sure you can complete this before moving to further questions, when compiling
C - language please
1. Create a program that does the following, make sure you can complete this before moving to further questions, when compiling add the -Ipthread argument, if you are using gcc use the -pthread argument. Creates two threads, the first uses a function hello world() which prints hello world, the second uses a function goodbye() which prints goodbye. Each function has a random sleep duration before printing the output - After running your program a few times you should notice that the order of hello world and goodbye being printed to the screen is not consistent, as each thread is executing independently. 2. Create a program the does the following. - Prompts the professor for five student's grades. Creates 5 threads, one for each student. Each thread uses a function called bellcurve(grade) which takes as an argument the grade and bellcurves it by multiplying the grade by 1.50 and then printing the bellcurved grade to the terminal. - The program must create the 5 threads and initialize them only after receiving all 5 grades Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started