Question: This is a zybooks C++ assignment I need to fix my code to get this output instead of the one I am getting My Code:

This is a zybooks C++ assignment I need to fix my code to get this output instead of the one I am getting

This is a zybooks C++ assignment I need to fix my code

My Code:

#include #include #include #include

using namespace std; /* define constant for seat count, booked and empty seat. */ #define SEAT_COUNT 30 #define BOOKED 1 #define EMPTY 0 int main() { int iterations; int numAttempted; int seed; double successRate;

/*variables needed in program */ double observedSuccessRate; int attemptTransaction = 0; int successTransaction = 0;

/*seat array to make record for booked seat per iteration */ int seats[SEAT_COUNT]; /* to store temporary random seat for each transaction */ int selectedSeat;

cin >> iterations; cin >> numAttempted; cin >> successRate; cin >> seed;

if(iterations 1)){ cout

for (int i = 0; i

for (int k = 0; k

cout

cout

cout

if(observedSuccessRate

getchar();

return 0; }

2 Compare output 0/10 Cutpit ditters. See highlights below. Inpt 10 100 0.5 1 Average atencted sales: 100 Your output AverdgeuunpleLed&ale Expected outpt Average eieted sales 28.80 n accaprabia rang Compare outputA 0/10 Oulpul difrers, Sve highlights below Iripu 3 30 0.90 10 average accoctad zal: 30 Your output Average eeted ales: 20 nverage ccmplctad salcs: 19 observed succes zate : 066

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!