anonymous
  • anonymous
I'm hoping someone could help me get started on a cpp assignment I have :/ I'm not looking for anyone to straight up do it for me, or anything like that, but I'm really hoping someone could help me get started with it, as I'm pretty much totally lost :( any help would be sincerely appreciated, as, as sad as it is, I'm horrible with programming, but it's a class that I have to stay in! I will post the description of the assignment in a response to this.
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
"A small airline has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Your program should display the following menu of alternatives—Please type 1 for "FirstClass" and Please type 2 for "Economy". If the person types 1, your program should assign a seat in the first class section (seats 1-5). If the person types 2, your program should assign a seat in the economy section (seats 6-10). Your program should print a boarding pass indicating the person’s seat number and whetherit is in the first class or economy section of the plane. Use a one-dimensional array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available. Your program should, of course, never assign a seat that has already been assigned. When the first class section is full, your program should ask the person if it is acceptable to be placed in the economy section (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message "Next flight leaves in 3 hours."
rsmith6559
  • rsmith6559
If you're lost at this point, take the description of the assignment (I hope it's in electronic form) and break it into individual sentences. Many of them will end up being either functions, or blocks of code. Rearrange them to where they're a workable sequence of instructions to do the job. Translate into code.
anonymous
  • anonymous
Do you sort of mean like a flow chart (ie: the option of what seating, and then branch the individual things off of those different options), if so, I got a similar suggestion from a friend, and it seemed like a pretty good idea.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

rsmith6559
  • rsmith6559
If you like to draw, go for it. At this point, the task is to "decompose" the problem. In English, break it down into manageable parts. Flow charts can do this for linear problems, but go to heck pretty quick on non-linear problems. What I was trying for suggesting re-editing the problem, was to help you see the different steps that the description has. Rearranging it into sections, moving things around according to what you need first, and so on. If the problem is well broken down, code can be pretty simple to write. That said, someday I really should take my own advice!
anonymous
  • anonymous
Okay, I think I get what you're saying, that does make sense! If you don't mind my asking, what would you suggest I include/declare (I'm not sure how much it may vary depending on how I end up writing the code), for some reason I always get confused when deciding what I should put in :/
rsmith6559
  • rsmith6559
You and me both. You'll certainly need iostream, but I think that will do it.
anonymous
  • anonymous
I shouldn't need to declare anything you don't think? Sorry if that's a really dumb question, my last assignment had to deal with min/max/average type stuff, and I had to make a bunch of declarations for that one
rsmith6559
  • rsmith6559
iostream would be an include, not a declaration. Worry about breaking down the problem, then worry about the coding.

Looking for something else?

Not the answer you are looking for? Search for more explanations.