Enrollments closing soon for **Post Graduate Certificate Program in Applied Data Science & AI** By **IIT Roorkee** | 3 Seats Left

- Home
- Assessment

17 / 53

Let's try to solve a simple problem in Scala - Calculation of the simple interest.

We want to calculate what would be the simple interest for 5 years if the principal amount is 500 and the interest rate is 12% annually.

We will need to define 3 variables and perform the calculation to get the interest.

Open Jupyter notebook on the right-hand side tab.

Declare integer variables as described below.

`principal`

- assign a value of 500`interest_rate`

- assign a value of 12`years`

- assign a value of 5Now, declare a new variable

`interest`

which will be assigned the value of calculation of interest like below:`interest`

= [calculation of simple interest using above defined variables]Press Shift+Enter in each of the cells where you wrote the code.

Click on "Submit Answer".

XP

Taking you to the next exercise in seconds...

Want to create exercises like this yourself? Click here.

Checking Please wait.

Success

Error

Fetching hint, please wait...

Error

Fetching answer, please wait...

Error

**Note - **Having trouble with the assessment engine? Follow the steps listed
here

## Loading comments...