Skip to content
Open
Show file tree
Hide file tree
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
Binary file modified .gradle/7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file added out/production/classes/MainKt.class
Binary file not shown.
43 changes: 36 additions & 7 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
fun main(args: Array<String>) {
fun main() {
println("Part I ==============================================================")
//Create a map with 4 elements
val favoAnimeChar = mutableMapOf("Kakash" to "Naruto", "Levi" to "Attack On Titan", "Hanametchi" to "Slam Dank")
println(favoAnimeChar)
// add new char
favoAnimeChar.put("Kelwa", "Hunter X Hunter")
println(favoAnimeChar)
// edit
favoAnimeChar["Kelwa"] = "HunterXHunter"
println(favoAnimeChar)
// remove
favoAnimeChar.remove("Hanametchi")
println(favoAnimeChar)
//===================================================================================
println("Part II==============================================================")
// Create a map of 3 elemnts
val myInterests = mutableMapOf(1 to "Orchid", 2 to "Indian Jasmine", 3 to "Sunflower")
// create 3 elements of list & add the list to the map
myInterests.putAll(listOf(4 to "Coding", 5 to "Drowing", 6 to "Cats"))
println(myInterests)
// ===============================================================================
println("(Bonus Q1: print Stars)========================================")
val n = 3
for (i in 0..n) {
for (j in 0 until i) { print("*") }
for (k in 0 until n - i) { print(" ") }
println(" ") }
//===================================================================================
println("(Bonus Q2:multiplication table of 5)=================================")
val num1 = 5
for (i in 1..num1) {
for (j in 1 .. i) { print("$j * $i| ") }
println(" ") }
println("=============================Finish ================================")


// your code here



}
}