assign11 - Job Offers Probability 0 19.6 1 25.1 2 21.6 3...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercise #11 A university is interested in the employment prospects of its graduating students. Each graduating student is expected to have between N 1 and N 2 job interviews (inclusive of these limits), with each possibility being equally likely, and each interview has a P % chance of producing a job offer. Write a C++ program that repeatedly reads in values for N 1 , N 2 and P until -1 -1 -1 is entered. For each set of values entered your program should produce either an error message (if the values don’t make sense), or a table like that shown below. It gives the probability distribution for job offers. In this example, each student has a 19.6% chance of getting no job offers, a 25.1% chance of getting one offer, and so on.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Job Offers Probability (%) ------------------------------ 0 19.6 1 25.1 2 21.6 3 15.9 4 9.9 5 4.7 6 2.3 7 0.9 8 or more 0.2 Do not attempt to solve this problem analytically. Instead you must use simulation. Your program must include: 1) A function that, given N 1 and N 2 , decides how many job interviews a particular student will have 2) A boolean function that, given P , decides whether or not a particular interview will result in a job offer, 3) A function that, given N 1 , N 2 and P , simulates a single graduating student and returns the number of job offers received by that student Note that P is to be entered as a percentage. Call your program “ jobOffers.cpp ” and submit as Assignment #11....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online