Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

my loop is supposed to go until tickets available >= 0, but it stops when I have 53 tickets available. what did I do wrong?

my loop is supposed to go until tickets available >= 0, but it stops when I have 53 tickets available. what did I do wrong?
image text in transcribed
#include ostreams using namespace std; int main() int ticketsAvail - 100, buyers = 0; int ticketssold; 1/100p until tickets are sold out while (ticketsAvail >= 0) { cout > ticketsSold; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 buyers++; if (ticketsSold == 4) ticketsAvail = ticketsAvail - 4; else if (ticketssold 3) ticketsAvail = ticketsAvail - 3; BE else if (ticketsSold == 2) ticketsAvail = ticketsAvail 2; else if (ticketsSold == 1) ticketsAvail = ticketsAvail 1; else cout

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions