Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c language please 1. Create a program that does the following, make sure you can complete this before moving to further questions, when compiling

in c language please image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions