How to compile your program

Assignment Help C/C++ Programming
Reference no: EM13321810

Problem 1 (C++ program that should run on Unix server)

Only two websites allow are and should be referenced in code. 

https://computing.llnl.gov/tutorials/pthreads/

https://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html

At a particular college, there are two admissions counselors, and five parking spots near the admissions office for visitors. There are 100 prospective students driving around trying to park and perform their admissions interview. When a prospective student sees a parking spot, he/she (generic he from now on as your book uses) pull into the spot, wait to be advised and then leave(freeing a parking lot space for one of the ones driving around). The advisors will advise a prospective student and then select one of the remaining students in the parking lot to advise next. If there are no prospective students in the parking lot, the tired advisor snoozes at his desk.

You will need your program to start 100 "prospective student" threads and two councilor threads. Each thread should print a message when it is created. Students should print when they get parking spaces and when they are advised.

When compiling, compile using the -lpthread flag. So for example, if you wrote the program as a c++ program in a file called problem1.cpp you might use

g++ -g -lpthread problem1.cpp -o problem1

Submitting:

In addition to the solutions to your programs above, you need to write a readme.txt it should contain

Well commented program. 

how to compile your program (including the actual compile command) and how to run it (including command line arguments, if any)

A description of your solution to these two problems, including what you did to solve the problem, and why you did it that way

A description of what problems still exist, what doesn't quite work right and so on.

Reference no: EM13321810

Questions Cloud

What advantages might a socialist system : What advantages might a socialist system have responding to the needs of people struck by an emergency situation like the earthquake that occurred in Haiti in January of 2010
What changes in society helped starbucks become successful : What advantages does McDonald's have in competing with Starbucks for coffee sales? What changes in society helped Starbucks become successful? What strategic factors account for Starbuck's long-term success in building brand equity? What recommendati..
Staff development programs to their curriculum : What measures can schools take to align their staff development programs to their curriculum? Provide a rationale for the measures suggested.
Community hospital uses a job-order costing system : Southwest Community Hospital uses a job-order costing system to track charges for each patient. The following charges relate to Candice O'Dea, who had laparoscopic knee surgery:
How to compile your program : how to compile your program (including the actual compile command) and how to run it (including command line arguments, if any) A description of your solution to these two problems, including what you did to solve the problem, and why you did it that..
Solve the currently very un-pc cigarette smokers problem : Write solution to solve the currently very un-PC"cigarette smokers problem" in java using Java threads, and monitors (using the "synchronized" keyword) (If it bothers your PC sensibilities, think of it at the Pot-smokers problem and then it is all pr..
Personal pollution-water pollution-air-noise-heat pollution : Remember that after you stand up from bed in the morning almost every activity of your day is going to produce some kind of pollution. Personal pollution could include: water pollution, air pollution, noise pollution, heat pollution, solid waste poll..
Null and entity subtypes : Describe the relationship between columns that can be null and entity subtypes. Under what circumstances would these columns lead to more than one entity subtype?
Delegation is a key role for all health professionals : Delegation is a key role for all health professionals. What are three factors to consider when delegating to unlicensed personnel in the health care setting?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to read a data file and extract parameters

Write a C/C++ program to read a data file and extract parameters. The program must obtain the filename via a command-line argument.

  Create class integerset

Create class IntegerSet for which each object can hold integers in the range 0 through 100. Represent the set internally as a vector of bool values. Element a[i] is true if integer i is in the set. Element a[j] is false if integer j is not in the set..

  Write a c program that copies the contents of one file

write a c program that copiest the contents of one file to a destination file. This program works by first prompting the user for the name of the source file and destination file.

  Static field holds total winnings for all horses in stable

static field holds total winnings for all horses in the stable // total winnings are shown after each horse wins,

  Dealerships are awarded the rebate

Dealerships are awarded the rebate on a quarter-by-quarter basis, only for quarters where their actual sales exceeded expected volumes for that quarter. Expected sales volumes for each quarter are as follows:

  Function that accepts a pointer to a c-string

Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. Also have it display the average number of letters in each word.

  The two-dimensional array

1. Given the two-dimensional array declared by the following statement int myArray[4][3] = {{2,4,6},{1,8,10},{3,5,7},[9,11,13}}; what is the value of myArray[1][2]

  The function should return a value

The function should return a value of 1 when it is given a valid score to process and 0 when the received value is out side of the 0-10 range. In this case it should print a waring message on the screen

  Calculates the position of a cannonball

Write a c++ program that calculates the position of a cannonball that is fired straight up in the air. Use short time intervals (.01 seconds) and display the position and velocity every second.

  Once the user enters a 0

Once the user enters a 0 you will exit the loop, close the file and execute the code as previously designed until you have displayed all of the scores and the average handicap.

  Generate a two-dimensional array

Generate a two-dimensional array of integers of 10 rows by 10 columns that contains 100 random numbers between 0 and 9. Print out the array (well formatted) and do the following computations

  It would be cool if a device was actually part

Have you ever been low on cash and couldn't go beyond a certain dollar limit when shopping? You sort of need a calculator in your head. It would be cool if a device was actually part of the cart and as you add an item into the cart it would increm..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd