Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!