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-02-simple-calculations.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -615,7 +615,7 @@ Next, test the solution locally using [**Ctrl+Shift+F10**] and by entering sampl
615
615
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#3](https://judge.softuni.bg/Contests/Practice/Index/649#3).
616
616
617
617
618
-
### Exercise: Trapezoid аrea
618
+
### Exercise: Trapezoid area
619
619
620
620
Write a program that reads three numbers from the console **b1**, **b2** and **h** and calculates **the area of a trapezoid** with bases **b1** and **b2** and height **h**. The formula for the area of trapezoid is **(b1 + b2) * h / 2**.
621
621
@@ -638,9 +638,9 @@ The code on the picture is consciously blurred for you to give a thought and fin
638
638
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#4](https://judge.softuni.bg/Contests/Practice/Index/649#4).
639
639
640
640
641
-
### Exercise: Circle Area and Perimeter
641
+
### Exercise: Circle area and perimeter
642
642
643
-
Write a program that reads from the console **a number r** r and calculates and prints **the area and perimeter of the circle**/**round** with **radius r**.
643
+
Write a program that reads from the console **a number r** r then calculates and prints **the area and perimeter of the circle**/**round** with **radius r**.
644
644
645
645
#### Sample input and output
646
646
@@ -651,7 +651,7 @@ Write a program that reads from the console **a number r** r and calculates and
651
651
652
652
#### Hints and guidelines
653
653
654
-
For the calculations you may use the following formulas:
654
+
For the calculations, you can use the following formulas:
655
655
-**`Area = Math.PI * r * r`**.
656
656
-**`Perimeter = 2 * Math.PI * r`**.
657
657
@@ -660,7 +660,7 @@ For the calculations you may use the following formulas:
660
660
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#5](https://judge.softuni.bg/Contests/Practice/Index/649#5).
661
661
662
662
663
-
### Exercise: Rectangle Area
663
+
### Exercise: Rectangle area
664
664
665
665
**A rectangle** is defined by the **coordinates** at two of its opposite angles (x1, y1) – (x2, y2). Calculate its **area and perimeter**. **The input** is read from the console. The numbers **x1, y1, x2 и y2** are given one per line. **The output** is printed on the console and it has to contain two lines, each with one number – the area and the perimeter.
666
666
@@ -679,7 +679,7 @@ Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#5
679
679
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#6](https://judge.softuni.bg/Contests/Practice/Index/649#6).
680
680
681
681
682
-
### Exercise: Triangle Area
682
+
### Exercise: Triangle area
683
683
684
684
Write a program that reads from the console **a side and height of a triangle** and calculates its area. Use **the formula** for triangle area: **area = a * h / 2**. Round the result to **2 digits after the decimal point using `Math.round(area, 2)`**.
685
685
@@ -697,9 +697,9 @@ Write a program that reads from the console **a side and height of a triangle**
697
697
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#7](https://judge.softuni.bg/Contests/Practice/Index/649#7).
698
698
699
699
700
-
### Exercise: Converter – from °C Degrees to °F Degrees
700
+
### Exercise: Converter – from °C (Celsius) to °F (Fahrenheit)
701
701
702
-
Write a program that reads **degrees on Celsius scale** (°C) and converts them to **degrees on Fahrenheit scale** (°F). Look on the Internet for a proper [formula](http://bfy.tw/3rGh"Търсене в Google"), to do the calculations. Round the result to **2 digits after the decimal point**. Here are a few examples:
702
+
Write a program that reads **degrees on Celsius scale** (°C) and converts them to **degrees on Fahrenheit scale** (°F). Look on the Internet for a proper [formula](http://bfy.tw/3rGh"Търсене в Google"), to do the calculations. Round the result to **2 digits after the decimal point**. Here are a few sample data:
703
703
704
704
#### Sample input and output
705
705
@@ -715,9 +715,9 @@ Write a program that reads **degrees on Celsius scale** (°C) and converts them
715
715
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#8](https://judge.softuni.bg/Contests/Practice/Index/649#8).
716
716
717
717
718
-
### Exercise: Converter – from Radians to Degrees
718
+
### Exercise: Converter – from radians to degrees
719
719
720
-
Write a program, that reads **ъan angle in [radians](https://bg.wikipedia.org/wiki/Радиан)** (**`rad`**) and converts it to **[degrees](https://bg.wikipedia.org/wiki/Градус_(ъгъл))** (`deg`). Look for a proper formula on the Internet. The number **π** in Java programs is available through **``Math.PI``**. Round the result to the nearest integer using the method **``Math.round(…)``**.
720
+
Write a program, that reads **an angle in [radians](https://en.wikipedia.org/wiki/Radian)** (**`rad`**) and converts it to **[degrees](https://en.wikipedia.org/wiki/Degree_(angle))** (**`deg`**). Look for a proper formula on the Internet. The number **π** in Java programs is available through **``Math.PI``**. Round the result to the nearest integer using the method **``Math.round(…)``**.
721
721
722
722
#### Sample input and output
723
723
@@ -735,7 +735,7 @@ Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#9
735
735
736
736
### Exercise: Converter – USD to BGN
737
737
738
-
Write a program for **conversion of US dollars** (USD) **into Bulgarian levs** (BGN). **Round** the result **2 digits**след десетичния знак. after the decimal point. Use a fixed rate between a dollar and levs: **1 USD = 1.79549 BGN**.
738
+
Write a program for **conversion of US dollars** (USD) **into Bulgarian levs** (BGN). **Round** the result **2 digits** after the decimal point. Use a fixed rate between a dollar and levs: **1 USD = 1.79549 BGN**.
739
739
740
740
#### Sample input and output
741
741
@@ -750,15 +750,15 @@ Write a program for **conversion of US dollars** (USD) **into Bulgarian levs** (
750
750
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#10](https://judge.softuni.bg/Contests/Practice/Index/649#10).
751
751
752
752
753
-
### Exercise: \* Currency Converter
753
+
### Exercise: \* Currency converter
754
754
755
755
Write a program for **conversion of money from one currency into another**. It has to support the following currencies: **BGN, USD, EUR, GBP**. Use the following fixed currency rates:
756
756
757
-
|Course| USD | EUR | GBP |
757
+
|Exchange rate| USD | EUR | GBP |
758
758
|:------:|:-------:|:-------:|:-------:|
759
759
| 1 BGN | 1.79549 | 1.95583 | 2.53405 |
760
760
761
-
**The input** is **sum for conversion**, **input currency** and **output currency**. **The output** is one number – the converted value of the above currency rates, rounded **2 digits** after the decimal point.
761
+
**The input**consists of three lines - the first is **a sum for conversion**, the second is the **input currency**, and the third is **output currency**. **The output** is one number – the converted value according to the above exchange rates, rounded **2 digits** after the decimal point.
762
762
763
763
#### Sample input and output
764
764
@@ -774,9 +774,9 @@ Write a program for **conversion of money from one currency into another**. It h
774
774
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/649#11](https://judge.softuni.bg/Contests/Practice/Index/649#11).
775
775
776
776
777
-
### Exercise: ** Date Calculations – 1000 Days on the Earth
777
+
### Exercise: ** Date calculations – 1000 days on the Earth
778
778
779
-
Write a program that enters a **birth date** in format **`dd-MM-yyyy`**and calculates the date on which **1000 days** are turned since this birth date and prints it in the same format.
779
+
Write a program that reads from the console a **birth date** in format **`dd-MM-yyyy`**then calculates the date on which **1000 days** are turned since this birth date, and prints the output in the same format.
780
780
781
781
#### Sample input and output
782
782
@@ -789,7 +789,7 @@ Write a program that enters a **birth date** in format **`dd-MM-yyyy`** and calc
789
789
|14-06-1980|11-03-1983|
790
790
791
791
#### Hints and guidelines
792
-
* Look for information about the data type **`Date`**, **`Calendar`** and **`SimpleDateFormat`** in Java and in particular look at the methods **`Calendar.setTime(date)`**, **`Calendar.add(countDays)`** and **`SimpleDateFormat.format(date)`**. With their help you can solve the problem without the need to calculate days, months and leap years.
792
+
* Look for information about the types **`Date`**, **`Calendar`** and **`SimpleDateFormat`** in Java and in particular look at the methods **`Calendar.setTime(date)`**, **`Calendar.add(countDays)`** and **`SimpleDateFormat.format(date)`**. With their help, you can solve the problem without the need to calculate days, months, and leap years.
793
793
***Don't print** anything additional on the console except for the wanted date!
0 commit comments