Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C!! c programing Assignment #1 Instructions: Assigning Seats - planeseats Through this programming assignment, the students will learn to do the following: 1. Know how

C!! c programing

image text in transcribed

image text in transcribed

image text in transcribed

Assignment \#1 Instructions: Assigning Seats - planeseats Through this programming assignment, the students will learn to do the following: 1. Know how to use a Makefile. 2. Perform basic C commands. 3. Use arrays, integers and strings. This assignment asks the user to write a program to assign seats in an airplane. There will be 12 seats on the plane, 4 in first class and 8 in economy. Initialy all seats are empty. - The program should display the following menu for the user in a loop until the user types 0 to quit: Please type 1 for "first class" Please type 2 for "economy" Please type to quit - If the user types 1 then the user should be assigned a seat in first class. If the user types 2 then the user should be assigned a seat in economy. - The program should not assign a seat that has already been assigned. If all seats in the desired section are taken, but there are available seats in the other section, then the user should be asked if they want a seat in the other section. - If the user says no, tell them "The next flight will be tomorrow." - Otherwise give them a seat in the other section. - The program should print a line indicating the seat the person was assigned. It would be a number from 1 to 12. This would be like a boarding pass. - You must use an array to represent the seats on the plane. This would be a one-dimentional array of size 12. - If the user types 0 as a choice the program should exit with a 0 return code since it is ended as requested. - Create a simple Makefile to compile your program into an executable called planeseats. Formatting The source file should have your name \& PantherID included in it and it should have an affirmation of originality stating something like: "I affirm that I wrote this program myself without any help from any other people or sources rormatting The source file should have your name \& PantherID included in it and it should have an affirmation of originality stating something like: "I affirm that I wrote this program myself without any help from any other people or sources from the internet.". It is expected that this program and the programs from this class follow programming standards learned in previous classes. There should be a program description at the top as well as descriptions of all functions used in the code. Code should be nicely indented using a consistent style and commented appropriately. Indentation You can choose to indent your code 2,3 , or 4 spaces for each level of nesting as long as you are consistent through out the code. If you modify a file, then you should make all indentation in that file match your style. Curly Braces You can choose either style for your curly braces, but be consistent : Submissions You should submit a compressed zip file named FirstNameLastNameA1.zip with the following files. 1. The source code, planeseats.c 2. The Makefile file which should be called Makefile with no extension. I should be able to type make at the Submissions You should submit a compressed zip file named FirstNameLastNameA1.zip with the following files. 1. The source code, planeseats.c 2. The Makefile file which should be called Makefile with no extension. I should be able to type make at the command line to compile your program. Do not include any other files or folders in the zip file. Programs that do not compile and do something useful when run at the command line in Unix will not earn any credit at all

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

More Books

Students also viewed these Databases questions

Question

=+ Do computers have consciousness? Why or why not?

Answered: 1 week ago

Question

Using Language That Works

Answered: 1 week ago

Question

4. Are my sources relevant?

Answered: 1 week ago