Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Declare a constant exercises with value 9 and a variable exercisesSolved with value 0 . Increment this variable every time you solve an exercise (including
Declare a constant exercises with value 9 and a variable exercisesSolved with value 0 . Increment this variable every time you solve an exercise (including this one). Given the following code: age =16 print ( age ) age =30 print (age) Declare age so that it compiles. Did you use var or val? Consider the following code: val a: Int =46 val b: Int =10 Work out what answer equals when you replace the final line of code above with each of these options: // 1 val answer1: Int =(a100)+b //2 val answer2: Int =(a100)+(b100) //3 val answer3: Int =(a100)+(b/10)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started