Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 842 Bytes

assignment.md

File metadata and controls

26 lines (22 loc) · 842 Bytes

Kotlin I Assignment I Variables and Conditionals


The Kotlin assignment has three components:

  • short answer questions.

  • writing code.

  • ...

Note: You must save your solution as solution_part2.kt for Part II.

Part I - short answer questions.


Question 1 - what is the type of this Variable var age:int = 19:

Answe 1:

Question 2 - What is the output of this code:

var age:int = 19

 if(age < 18 ) {
print("you are not adult") 
}else {
print("you are adult")
}

Answe 2:

Part II - writing code.


Write a kotlin program that has two players with there healthPoints and let the program check if the healthPoint is less than 90 out 100 print the player's health is fine and if the healthPoint is less than 50 print the player's health is awful .