Hints and Guidelines

Try to solve the problem on your own first. If you do not succeed, go through the hints.

Idea for Solution

As it is with any programming task, it is important to build an idea for its solution, before having started to write code. Let' s carefully go through the problem requirements. We have to write a program that calculates the number of working places in a training lab, where the number depends on the hall length and height. We notice that the received input will be in meters and the information about how much space the working places and hallway take, will be in centimeters. To do the calculations, we will use the same measuring units, no matter whether we choose to convert length and height to centimeters or the other data in metres. The first option is used for the presented solution.

Next, we have to calculate how many columns and how many rows with desks will fit. We can calculate the columns by subtracting the width by the necessary space for the hallway (100 cm) and divide the difference by 70 cm (the length of a working place). We find the rows by dividing the length by 120 cm. Both operations can result in a real number with whole and fractional part but we have to store only the whole part in a variable. In the end, we multiply the number of rows by the number of columns and divide it by 3 (the lost places for entrance door and podium). This is how we calculate the wanted value.

results matching ""

    No results matching ""