You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter-03-simple-conditions-exam-problems.md
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ if (bool expression) {
21
21
22
22
After having revised how to write simple conditions, let's solve a few exam problems to practice the **`if-else`** construction:
23
23
24
-
## Problem: Transportation Price
24
+
## Problem: Transport Price
25
25
26
26
A student has to travel **n kilometers**. He can choose between **three types of transportation**:
27
27
***Taxi**. Starting fee: **0.70** BGN. Day rate: **0.79** BGN/km. Night rate: **0.90** BGN/km.
@@ -97,13 +97,13 @@ After we have checked the distance conditions and we have **calculated the price
97
97
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/930#0](https://judge.softuni.org/Contests/Practice/Index/930#0).
98
98
99
99
100
-
## Problem: Pipes in Pool
100
+
## Problem: Pipes In Pool
101
101
102
102
A pool with **volume V** fills up via **two pipes**. **Each pipe has a certain flow rate** (the liters of water, flowing through a pipe for an hour). A worker starts the pipes simultaneously and goes out for **N hours**. Write a program that finds the state of the pool **the moment the worker comes back**.
103
103
104
104
### Input Data
105
105
106
-
**Four numbers are passes to the function** (arguments):
106
+
**Four numbers are passed to the function** (arguments):
107
107
* The first line (argument) contains a number **V – the volume of the pool in liters** – an integer in the range of [**1 … 10000**].
108
108
* The second line (argument) contains a number **P1 – the flow rate of the first pipe per hour** – an integer in the range of [**1 … 5000**].
109
109
* The third line (argument) contains a number **P2 – the flow rate of the second pipe per hour** – an integer in the range of [**1 … 5000**].
@@ -112,7 +112,7 @@ A pool with **volume V** fills up via **two pipes**. **Each pipe has a certain f
112
112
### Output Data
113
113
114
114
Print on the console **one of the two possible states**:
115
-
* To what extent the pool has filled up and how many percent each pipe has contributed with. All percent values must be formatted to an integer (without rounding).
115
+
* To what extent the pool has filled up and how many percent each pipe has contributed. All percent values must be formatted to an integer (without rounding).
116
116
117
117
* "The pool is **[x]**% full. Pipe 1: **[y]**%. Pipe 2: **[z]**%."
118
118
* If the pool has overflown – with how many liters it has overflown for the given time – a floating-point number.
@@ -280,7 +280,7 @@ After having done these calculations, we are ready to **calculate the quantity o
280
280
281
281
#### Checking The Conditions and Processing Output Data
282
282
283
-
After having done the necessary calculations, the next step is to **check** whether the liters of wine that have been produced, **is enough**. For that, we will use **a simple conditional statement** of the **`if-else`** type and we will check whether the liters of wine from the harvest are **more than** or **equal to** the **needed liters**.
283
+
After having done the necessary calculations, the next step is to **check** whether the liters of wine that have been produced, **are enough**. For that, we will use **a simple conditional statement** of the **`if-else`** type and we will check whether the liters of wine from the harvest are **more than** or **equal to** the **needed liters**.
284
284
285
285
If the condition returns **`true`**, from the task requirement we see that **on the first line** we have to print **the wine that has been produced from the harvest**. That value has to be **rounded down to the nearest integer**, which we will do by using both the method **`Math.floor(…)`** and a **placeholder** when printing it.
286
286
@@ -355,5 +355,4 @@ If **the time is not enough**, we print the additional hours that are needed for
355
355
356
356
### Testing in The Judge System
357
357
358
-
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/930#4](https://judge.softuni.org/Contests/Practice/Index/930#4).
359
-
358
+
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/930#4](https://judge.softuni.org/Contests/Practice/Index/930#4).
0 commit comments