# Simple Interest Using Scala

Apr 19, 2022
``` Machine Problem

Write a  simple interest program that will ask the principal amount, rate of the loan, and a number of years.  The program will compute the interest rate of the loan of the customer and display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My mobile number here in the Philippines is 09173084360.

=================================================

Want to support my channel?

GCash Account

09173084360

Paypal

Patreon

Thank you very much for your support

```

Program Listing

``````/* Simple_Interest.scala
Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
November 12, 2021  2:22 PM Friday
Bacolod City, Negros Occidental
*/

import java.util.Scanner;

object Simple_Interest {

def main(args: Array[String]) : Unit = {

var input = new Scanner(System.in);

print("\n\n");
print("\tSimple Interest Using Scala");
print("\n\n");
print("\tEnter the Principal Amount  : ");
var principal = input.nextDouble();

print("\tEnter Rate                  : ");
var rate = input.nextDouble();

print("\tEnter Time (No. of Years)  : ");
var time = input.nextDouble();

var interest = (principal * time * rate) / 100;

print("\n");
print("\tThe Principal Amount     : PHP  " + f"\$principal%5.2f" );
print("\n");
print("\tThe Interest Rate        :      " + f"\$rate%5.0f" + "%");
print("\n");
print("\tThe Time Duration        :      " + f"\$time%5.0f");
print("\n");
print("\tThe Simple Interest      : PHP  " + f"\$interest%5.2f" );
print("\n\n");
print("\tEND OF PROGRAM");
print("\n\n");
}
}
``````