Skip to content

Sarah Alenezi#23

Open
sarahalenezi96 wants to merge 11 commits intoJoinCODED:mainfrom
sarahalenezi96:main
Open

Sarah Alenezi#23
sarahalenezi96 wants to merge 11 commits intoJoinCODED:mainfrom
sarahalenezi96:main

Conversation

@sarahalenezi96
Copy link

Task 1 completed

fun main(){
var double = 37.4
var boolean = "true"
var char = 'S'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should name our variables meaningful names that are descriptive.
Examples:

  • double can be temperature
  • boolean can be isRaining
  • char can be firstNameInitiail

@@ -0,0 +1,8 @@
fun main(){
var double = 37.4
var boolean = "true"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By setting the variable to "true", it does not set it as a boolean, but rather a string.

Why? Because you used quotation marks ". Boolean values don't need quotation marks. You should also use types to specifically avoid this issue

@sarahalenezi96
Copy link
Author

sarahalenezi96 commented Feb 11, 2025 via email

@sarahalenezi96
Copy link
Author

I fixed it and pushed again! I believe they're merged now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants