This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="styles.css"> | |
<!-- back e doar culoarea din fundal --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="styles.css"> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="styles.css"> | |
<style> | |
#ball { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package quizzz | |
fun main(args: Array<String>) { | |
println(isVeryHot(36)) //true | |
// println(whatShouldIDoToday("happy", "sunny")) | |
// println(whatShouldIDoToday("sad")) | |
print("How do you feel?") | |
println(whatShouldIDoToday(readLine()!!)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
println(shouldChangeWater("Friday")) | |
} | |
fun getDirtySensorReading() = 20 | |
//acum, jos in functia shouldChangeWater inlocuiesc 20-ul cu functia asta, iar cand se va schimba functia asta(valoarea parametrii etc), in functia mare nu mai modific nimic | |
fun shouldChangeWater( | |
day: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//cerinta exercitiului era: | |
//Exercise: Fit More Fish | |
//Create a function that checks if we can add another fish into a tank that already has fish in it. | |
//How many fish in a tank? | |
// | |
//The most widely known rule for stocking a tank is the one-inch-per-fish-per-gallon-of-water rule. However that's assuming the tank doesn't have any decorations in it. | |
// | |
//Typically, a tank with decorations can contain a total length of fish (in inches) less than or equal to 80% of the tank size (in gallons). A tank without decorations can contain a total length of fish up to 100% of the tank size. | |
//For example: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package academy.learnprogramming.calculator | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.widget.EditText | |
import android.widget.TextView | |
class MainActivity : AppCompatActivity() { | |
//varianta1 | |
//we tell kotlin that we're using a non-nullable variable, but that we'll delay giving it a value until later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.* | |
fun main(args: Array<String>) { | |
println("Hello, ${args[0]}!") | |
feedTheFish() | |
} | |
fun feedTheFish(){ | |
val day = randomDay() //we call the function here | |
val food = fishFood(day) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.math.pow | |
import java.util.* | |
fun main(args: Array<String>) { | |
//extra-practice: | |
//Use a for loop to run the program 10 times, or until the "Take it easy" fortune has been selected. | |
var fortune: String | |
for (i in 1..10) { | |
fortune = getFortune() | |
println("\nYour fortune is: $fortune") |
NewerOlder