Busy internship

Report a typo

Below, you can see two classes: the outer class Intern and the nested class Salary. Every intern works at least 20 hours a week (the baseWorkload for interns in the company) and gets the basePay 50 units for it. For each extra hour a week, the intern gets the extraHoursPay 2.8 units. Thus, an intern working 20 hours a week will get a base salary of 50 units, and an intern working 40 hours a week will get 106 units.

End the weeklySalary code line using the charging rules described above.

Write a program in Kotlin
class Intern(val weeklyWorkload: Int) {
val baseWorkload = 20

class Salary {
val basePay = 50
val extraHoursPay = 2.8
}

val weeklySalary = // put your code here
}
___

Create a free account to access the full topic