Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to solve this question in C language, just include three chapters (introduction to C, Variables /assignments,Branches), Description of Programming Task Suppose a classroom
I need to solve this question in C language, just include three chapters (introduction to C, Variables /assignments,Branches),
Description of Programming Task Suppose a classroom has 11 rows of seats, each with 16 seats. Each row is labeled with a letter, and each seat in each row is uniquely identified with a letter and a number, which results in the following seating chart: - - - - - - - - - - - - - -- Back of Classroom K01 KO2 K03 K04 K05 K06 K07 K08 K09 K10 K11 K12 K13 K14 K15 K16 J01 J02 J03 J04 J05 J06 JO7 JOB JO9 J10 J11 J12 J13 J14 J15 J16 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 HO1 H02 HO3 H04 105 106 H07 HO8 H09 H10 H11 H12 H13 H14 115 116 G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 G11 G12 G13 G14 G15 G16 F01 F02 F03 F04 F05 F06 F07 F08 F09 F10 F11 F12 F13 F14 F15 F16 E01 E02 E03 E04 E05 106 E07 E08 E09 E10 E11 E12 E13 E14 E15 E16 D01 DO2 DO 3 D04 DO5 D06 DO7 DOB DO9 D10 D11 D12 D13 D14 D15 D16 C01 CO2 CO3 C04 205 206 207 208 209 C10 C11 C12 C13 C14 C15 C16 B01 BO2 BO3 B04 B05 B06 B07 308 309 B10 B11 B12 B13 B14 B15 B16 A01 A02 A03 A04 A05 A06 A07 A08 A09 A10 A11 A12 A13 A14 A15 A16 ------ Front of Classroom ---- Now, suppose 100 students attend class and fill in the seating chart as follows, where each 'X' represents a seat taken by a student: ---- Back of Classroom --- X X K03 X X K06 X X K09 X X K12 X X K15 X J01 X J03 X 105 X JO7 X JO9X J11 X J13 X J15 X 101 X X 104 105 X X 108 109 x x 112 113 X X 116 X X HO3 X X H06 X X H09 X X H12 X X H15 X G01 X 603 X 605 X 607 X G09 X Gil X 613 X 615 X F01 X X F04 F05 X X F08 F09 X X F12 F13 X X F16 X X E03 X X E06 X X E09 X X E12 X X E15 X D01 X DO3 X D05 X D07 X DO9 x D11 X D13 X D15 X C01 X X 004 C05 X X C08 C09 X X C12 C13 X X C16 X X BO3 X XB06 X X B09 X X B12 X X B15 X A01 X A03 X A05 X A07 X A09 x All X A13 X A15 X ---------- Front of Classroom ---------------------- Even though this seating chart looks like a bit of a mess, the students have been somewhat organized in their selection of seats. Look for repeating patterns in the rows and columns. Your programming task is to write a program that tells the user whether or not the user-specified seat is available. The program should read in a letter and a number (separately) from the user, which signifies the seat under consideration. Then, using the observed patterns in the above seating chart, together with logic and branching, have the program report that the seat is open or taken. Some helpful thoughts/hints: Look at the pattern in the first (A) row. Then, look at the pattern in the second (B) row. Then, look at the third (C) row. How are the patterns different? What mathematical operation allows us to represent these types of repeating patterns? Now look at all the rows. Does the pattern in the first row repeat? If so, how often? Once you recognize the patterns, utilize if-statements together with mathematical and logical operations to write the code generally That is, DO NOT set up a massive if-else structure with all 171 seats checked individually. Doing so would not utilize the power of branching and, more generally, is not programming! Instead, take advantage of the patterns to write a succinct and clean code to efficiently report the status of the requested seat. Pay careful attention to the formatting of the seat numbers. Note that they are always reported as two digits, even for single digit numbers (e.g. the first seat is A01, where the number is 01). Sample Input/Output The following are sample executions of the program with mixed input and output. Recall: the program should only take in two inputs, a letter and an integer. Enter the seat row letter: A Enter the seat number: 1 Seat A01 is open! Enter the seat row letter: C Enter the seat number: 2 Seat CO2 is taken! Enter the seat row letter: J Enter the seat number: 15 Seat J15 is open! Enter the seat row letter: G Enter the seat number: 25 Not a valid seat number! Enter the seat row letter: M Not a valid row! PLEASE READ THIS COPYRIGHT STATEMENT Copyright 2020 Scott Reckinger. This assignment description is protected by U.S. copyright law. Reproduction and distribution of this work, including posting or sharing through any medium, such as to websites like chegg.com, is explicitly prohibited by law and also violates UIC's Student Disciplinary Policy (A2-c. Unauthorized Collaboration, and A2-e3. Participation in Academically Dishonest Activities: Material Distribution Materialented an hirditalini riba t terillbarad Var Enter the seat number: 25 Not a valid seat number! Enter the seat row letter: M Not a valid row! PLEASE READ THIS COPYRIGHT STATEMENT Copyright 2020 Scott Reckinger. This assignment description is protected by U.S. copyright law. Reproduction and distribution of this work, including posting or sharing through any medium, such as to websites like chegg.com, is explicitly prohibited by law and also violates UIC's Student Disciplinary Policy (A2-c. Unauthorized Collaboration; and A2-e3. Participation in Academically Dishonest Activities: Material Distribution). Material posted on any third party sites in violation of this copyright and the website terms will be removed. Your user information will be released to the authorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started