COMP2401 - Assignment #1 (Due: Sun. Jan 26, 2020 @ 6pm)
(1) Window Tinting
Assume that you have a company that tints building windows. You have found a good price on nice gold tinting film that comes in rolls that are 5 feet wide and 92 feet long.
You want to write a program that determines the number of rolls that will be needed to be purchased to cover a building completely. Your program should assume that each window is the exact same size in the building and that the windows are always less than or equal to 5 feet wide. The program should ask the user for the number of floors in the building, the number of windows on each floor (includes all sides of the building) and the dimensions of the window (in inches). The program should then calculate the number of rolls needed. Note that when tinting a window, it must be done with one entire piece of film. That is, you CANNOT cut pieces of film to fit on the windows. You should determine whether the 5 foot width of tint roll is able to cover two or more windows. For example, if the windows are 12" x 24", then you can cover five windows with just two feet of roll … but if placed sideways, you can only cover 4 windows, with a little waste left over (see picture below). You should choose the best option in this case. However, you must not apply any other “packing/fitting” algorithm … for the purpose of marking consistency. Just choose which direction to put the tint on … up and down … or left to right.
The program should output the correct number of tinting rolls that need to be purchased. Make sure to define appropriate constants in your code, as this represents proper coding style. Also, make sure to test adequately.
(2) Scheduling Reservations
Write a program called reservations.c that simulates some people trying to reserve seats at a restaurant for dinner. The program MUST work as follows:
IMPORTANT SUBMISSION INSTRUCTIONS:
Submit all of your c source code files as a single tar file containing:
1.A Readme text file containing
- your name and studentNumber
- a list of source files submitted
- any specific instructions for compiling and/or running your code
2.All of your .c source files and all other files needed for testing/running your programs.
3.Any output files required, if there are any.
The code MUST compile and run on the course VM, which is COMP2401-W20.
- If your internet connection at home is down or does not work, we will not accept this as a reason for handing in an assignment late ... so make sure to submit the assignment WELL BEFORE it is due !
- You WILL lose marks on this assignment if any of your files are missing. So, make sure that you hand in the correct files and version of your assignment. You will also lose marks if your code is not written neatly with proper indentation and containing a reasonable number of comments. See course notes for examples of what is proper indentation, writing style and reasonable commenting).
2020-01-20