Skip to content

Commit

Permalink
Julia
Browse files Browse the repository at this point in the history
Hello World and basicMath!
  • Loading branch information
JakobPapirov authored Jan 8, 2022
1 parent 71d5c79 commit aa603c5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Julia/Hello World.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://datatofish.com/install-julia/
# https://julialang.org/downloads/
# https://www.geeksforgeeks.org/hello-world-in-julia/
# https://docs.julialang.org/en/v1/manual/getting-started/
# https://juliabyexample.helpmanual.io/

print("Hello World!")

#println("Hello World!") # Prints to a new line
29 changes: 29 additions & 0 deletions Julia/basicMath.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://juliabyexample.helpmanual.io/
# https://www.geeksforgeeks.org/taking-input-from-users-in-julia/

println("What's your name?")

inputName = readline()

if inputName == ""
inputName = "Jakob"
end

println("Type in a number, ", inputName)

inputVar1 = readline()

println("Type in another number, ", inputName)

inputVar2 = readline()

println("Now add $inputVar1 and $inputVar2 = ")

inputSum = readline()

if parse(Int64, inputSum) == parse(Int64, inputVar1) + parse(Int64, inputVar2)
println("Good job $inputName !")
else
println("Incorrect answer $inputName !")
println("Correct answer is: ", parse(Int64, inputVar1) + parse(Int64, inputVar2))
end

0 comments on commit aa603c5

Please sign in to comment.