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

  In psuedocode, design an application

In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values

  Write a c++ program that prompts the user for a double

Write a C++ program that prompts the user for a double that should be between 0 and 100. If the value entered is outside of the interval the program will print an error message. The program should continue to repeat until the user enters an appropria..

  Make a c program that will calculate the gross pay

Write a C program that will calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

  We base our need to implement composition upon

What criterion, or criteria, should be used to include objects of a class as data members of another class? In other words, what should we base our need to implement composition upon?

  Create a 1-dimensional (1d) array

Write a program to create a 1-dimensional (1D) array that contains 15 characters and display to the screen a count of the occurrences of each of the vowels a, e, i, o, and u in the array.

  Individual genes are substrings of a genome

Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..

  Accepts a pointer to a c-string as an argument

Write a function that accepts a pointer to a C-string as an argument and capitalizes the fist character of each sentence in the string. For instance, if the string argument is "hello

  Implement a graphics system that has classes

Implement a graphics System that has classes for various figures: rectangles, squares, triangles and circles. A rectangle has data members height, width, color , and center point. A square has center point and an edge and color

  Write a program that allows a user to enter 12 double values

Write a program that allows a user to enter 12 double values representing store sales for each month of one year. After all 12 values are entered,

  Create a bar chart showing the average monthly mean temperat

Write a ++ program to create a bar chart showing the average monthly mean temperature for College Station from 2004 to 2013. The point of the exercise is to compute the sie and location of the rectangles rather than explicitely hardcode that informat..

  Maze program

Maze program. In this assignment you will represent a maze with a binary tree. . The starting point is node N and the ending point is node Z.

  How would you put a empty space between output

How would you put a empty space between output, right now it prints 6 rows but how do i add a space or a "\n" for example row1 row2 row3

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