Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I need to write this program in C language. Please don't incorporate any arrays, user defined functions, pointers as we haven't covered those topics

Hello, I need to write this program in C language. Please don't incorporate any arrays, user defined functions, pointers as we haven't covered those topics yet. It should all be one program that satisfies each task. I've included pictures of what some sample outputs should be and all the requirements. Thanks much for your help!

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

11.16 Project 1b - Creating Seating Charts Description of Programming Tasks Task 1 - Empty Classroom Seating Chart Write a program that prints a seating chart (similar to that from the Project 1a Description) for an empty classroom of size specified by the user. Have the user enter in both the number of rows and the number of seats per row. Make sure the user input is reasonable, by checking that the number of rows is 26 or less, that the number of seats per row not greater than 30, and that both are at least 1. Then, print to screen a carefully formatted seating chart where each row is represented with a letter, and every seat in each row is uniquely identified with a letter and a number (see the sample output section below for examples) Some important considerations The format of your seating chart must match the sample output precisely (including whitespaces) in order to pass the test cases.. o Capital letters Two digits for all numbers (e.g. A05, K14, W24, etc.). o Single space after each seat (including the last seat per row, before the new line character In"), which means each seat uses a total of 4 characters. The first row is at the bottom of the seating chart, and thus must be printed last. To achieve this task for general input from the user, a nested loop must be used. However, arrays and/or structs must not be used as they are beyond the scope of the course to this point. Task 2 - Every-Other Seating Chart Extend your program to also print out a seating chart where every other seat is taken by a student. Represent a taken seat as an "X. To keep the formatting neat, make sure to still reserve 4 total characters for each seat, i.e. if seat B12 is taken, replace it with an "X* that has one space before the "X* and two spaces after (again, see the sample output section below for examples). Additionally, report the number of students that can be seated using this arrangement. One important consideration: The first seat, A01, is taken, in addition to every other seat in row A. Then, the taken seats in row B are offset from row A, and the pattern repeats for all the rows Task 3 - More-Complicated Seating Chart Extend your program to also print out a seating chart that matches the pattern from the Project 1a filled seating chart. Use the logic you developed for your Project 1a program, wrap it into appropriate loop(s), and modify the functionality for general user input for number of rows and seats per row (again, see the sample output section below for examples). Additionally, report the number of students that can be seated using this arrangement Sample Input/Output The following are sample executions of the program with mixed input and output. Recall: the program should only take in two integer inputs for the number of rows and number of seats per row. Enter number of rows: 11 Enter number of seats per row: 16 Empty Classroom Seating Chart: K01 K02 K03 K04 KO5 K06 K07 K08 K09 K10 K11 K12 K13 K14 K15 K16 J01 JO2 JO3 J04 JO5 JO6 JO7 J08 JO9 J10 J11 J12 J13 J14 J15 J16 I01 I02 103 I04 105 106 107 108 I09 I10 I11 I12 113 I14 115 I16 HOI H02 H03 H04 H05 H06 H07 H08 H09 H10 H11 H12 H13 H14 H15 H6 G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 G11 G12 G13 G14 G15 G16 F01 F02 F03 F04 FO5 F06 F07 F08 FO9 F10 F11 F12 F13 F14 F15 F16 E01 E02 E03 E04 E05 E06 E07 E08 E09 E10 El1 E12 E13 E14 E15 E16 DO1 DO2 DO3 DO4 DO5 D06 DO7 DO8 DO9 D1O Di1 D12 D13 D14 D15 D16 Col C02 C03 C04 C05 C06 C07 C08 C09 C10 C11 C12 13 C14 C15 C16 Bol B02 B03 B04 B05 B06 B07 B08 B09 B10 Bil B12 B13 B14 B15 B16 AOI A02 A03 A04 A05 A06 A07 A08 A09 A10 All A12 A13 AI 4 A15 A16 Every-other Seating Chart: X I02 X I04 X I06X 108X I10 X I12 X I14 X I16 H01 X H03 X H05 X H07 XH09 X H11 X H13 X H15 X X G02 X G04 X G06 X G08 X G1O X G12 X G14 X G16 X E02 X E04 X E06 X E08X E1OX E12 X E14 X E16 DO1 X DO3 X DO5 X D07 XD09 X D11 X D13 X D15 X X C02 X C04 X C06 X CO8X C10 X C12 X C14 X C16 *88 students have seats in this arrangement* More-Complicated Seating Chart: I01 X XI04 105 X X I08 I09XX I12 I13 X X I16 G01 X G03 X G05 XG07 X G09 X G1l X G13 X G15 X D01 X D03 X D05 X D07 X D09 X D11 x D13 x D15 X A01 X A03 X A05 A07 X A09 X A1l X A13 X A15 X *100 students have seats in this arrangement* Enter number of rows: 5 Enter number of seats per row: 7 Empty Classroom Seating Chart: E01 E02 E03 E04 E05 E06 E07 DO1 DO2 DO3 D04 DO5 D06 DO7 CO1 C02 C03 C04 CO5 C06 C07 B01 B02 B03 B04 BO5 B06 B07 A01 A02 A03 A04 A05 A06 A07 Every-other Seating Chart: X E02 X E04 XE06 X X CO2 X C04 X C06 X B01 X B03 X BO5 X B07 X A02 X A04 X A06 X *18 students have seats in this arrangement* More-Complicated Seating Chart: X XE03 X X E06 X C01 X X CO4 C05 XX X X B03 XX B06 X A01 X A03 X A05 X A07 *20 students have seats in this arrangement* Enter number of rows: 30 Too many rows! Max. number of rows is 26 Enter number of rows:0 Number of rows must be at least 1. Enter number of rows: 15 Enter number of seats per row: 50 Too many seats per rows! Max. number of seats per row is 30 Enter number of rows: 11 Enter number of seats per row: 0 Number of seats per rows must be at least 1

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_2

Step: 3

blur-text-image_3

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

5. Explain the supervisors role in safety.

Answered: 1 week ago

Question

7. Explain how an employee could reduce stress at work.

Answered: 1 week ago