Answered step by step
Verified Expert Solution
Link Copied!

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

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

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

Step: 3

blur-text-image

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

What is a status bar? When might a status bar be inappropriate?

Answered: 1 week ago

Question

Question How are VEBA assets allocated when a plan terminates?

Answered: 1 week ago

Question

Question May a taxpayer roll over money from an IRA to an HSA?

Answered: 1 week ago

Question

Question What is the doughnut hole in HSA coverage?

Answered: 1 week ago