Skip to content

Commit 4d046c4

Browse files
Added some Comments
1 parent 81a88d4 commit 4d046c4

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

first.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/*
2+
!Create a birthday message in Kotlin
3+
4+
?Introduction
5+
>In this program you will create a short Kotlin program that prints a birthday message with a cake and a birthday banner.
6+
7+
?Prerequisites
8+
>How to open and edit code in https://developer.android.com/training/kotlinplayground, a browser-based Kotlin programming tool.
9+
>Understand the "Hello world!" program from the Write your first Kotlin program codelab.
10+
>How to use println() to write text to the console of the online Kotlin code editor.
11+
12+
?What you will learn
13+
> How to print more complex text from your program.
14+
> How to do basic math in Kotlin and store the results in variables for later use.
15+
> How to create a function to print the same string several times.
16+
> How to create a loop that prints a text snippet multiple times.
17+
18+
?What you will build
19+
> You will create a short program that you can use to print birthday messages, a text-based picture of a cake, and a banner.
20+
21+
?What you need
22+
> A computer with internet access and a modern web browser, such as the latest version of Chrome.
23+
24+
*Written by Google Developers Training team.
25+
*/
126
fun main() {
227
println("Hello, \nworld!")
328
println("Janshi")

fourth.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// !Modify a function to have two arguments
2+
/*
3+
Important: A variable declared using the val keyword can only be set once. You cannot change its value later in the program.
4+
You can declare a changeable variable with the var keyword
5+
*/
26
fun main() {
37
val border = "`-._,-'"
4-
val timesToRepeat = 4
8+
var timesToRepeat = 4
59
printBorder(border, timesToRepeat)
610
println(" Happy Birthday, Jhansi!")
711
printBorder(border, timesToRepeat)

sec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//In this we used function inside a function, we can return a function or rather use it normally.
1+
// !In this we used function inside a function, we can return a function or rather use it normally.
22
fun main() {
33
println("Hello, world!\n")
44
birthdayMessage()

0 commit comments

Comments
 (0)