Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add For Loops HW #1449

Open
wants to merge 1 commit into
base: pb-java-march-20
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions EN/04-For-Loop/08-Homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ Prints:
| --- | --- |
| 5 | 32 |
| 2 | |

[hints]
[hint]
You can make a for loop and in every iteration do res *= p;
[/hint]
[/hints]

[/task-description]
[tests]
[test open]
Expand Down Expand Up @@ -254,6 +261,16 @@ Prints:
| 0 | |
| 0 | |
| -1 | |

[hints]
[hint]
When the possition is even, sum both numbers in the pair and add them to the even sum. Otherwise, add them to the odd sum.
[/hint]
[hint]
In the end, print the result (the difference)
[/hint]
[/hints]

[/task-description]
[tests]
[test open]
Expand Down Expand Up @@ -555,6 +572,13 @@ Create a program, that:
| 2 | 1 |
| a | |
| g | |

[hints]
[hint]
Iterate over every character of the work and check if it is present in the table, if it is - add the corresponding amount to the sum.
[/hint]
[/hints]

[/task-description]
[tests]
[test open]
Expand Down Expand Up @@ -669,6 +693,15 @@ The input consists of:
| 5 | |
| 30 | |

[hints]
[hint]
In the for loop, check if the age is above the needed one, and if it is - lower the amount of needed people.
[/hint]
[hint]
If that amount reaches 0, the print "The rollercoaster departures"
[/hint]
[/hints]

[/task-description]
[tests]
[test open]
Expand Down Expand Up @@ -1443,6 +1476,12 @@ Print the numbers on a single line, separated by a single space.
| --- | --- |
| (no input) | 7 17 27 ... 997 |

[hints]
[hint]
Use a for loop and check i % 7 == 0
[/hint]
[/hints]

[/task-description]
[tests]
[test open]
Expand Down