# Field Manual for Hackers

## Java A bank offers 14%,15% and 16% interest on 1 year , 2 year and 3 year deposit. Write a programme to rate deposit amount and compute and print maturity amount.

A bank offers 14%,15% and 16% interest on 1 year , 2 year and 3 year deposit. Write a programme  to rate deposit amount and compute and print maturity amount.

1. This comment has been removed by the author.

2. import java.util.Scanner;
//1yr 14
//2yr 15
//3yr 16
class Test{

public static void main(String ar[])
{

Scanner sc=new Scanner(System.in);
double deposit,maturityamt1,maturityamt2,maturityamt3;
System.out.println("Enter Deposit Amount");
deposit=sc.nextDouble();

maturityamt1=((14*1*deposit)/100)+deposit;
System.out.println("For Depositing 1 Year @14% Interest, Maturity Amount = "+maturityamt1);

maturityamt2=((15*2*deposit)/100)+deposit;
System.out.println("For Depositing 2 Years @15% Interest, Maturity Amount = "+maturityamt2);

maturityamt3=((16*3*deposit)/100)+deposit;
System.out.println("For Depositing 3 Years @16% Interest, Maturity Amount = "+maturityamt3);

}
}

3. import java.util.Scanner;
class MaturityAmount
{
public static void main(String ar[])
{ double DepositAmt,MaturityAmt;int year;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the Deposit Amount");
DepositAmt=scan.nextDouble();
System.out.println("Press 1 to check Maturity Amount for one year");
System.out.println("Press 2 to check Maturity Amount for two year");
System.out.println("Press 3 to check Maturity Amount for three year");
year=scan.nextInt();
switch(year)
{
case 1:
MaturityAmt=((14*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your Maturity Amount for one year @14%Interest="+MaturityAmt);
break;
case 2:
MaturityAmt=((15*2*DepositAmt)/100)+DepositAmt;
System.out.println("Your Maturity Amount for two year @15%Interest="+MaturityAmt);
break;
case 3:
MaturityAmt=((16*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your Maturity Amount for three year @16%Interest="+MaturityAmt);
break;
}

}}

4. This comment has been removed by the author.

5. import java.util.Scanner;
class Amount
{
public static void main(String args[])
{
System.out.println("enter the amount ");
Scanner sc=new Scanner(System.in);
double amount=sc.nextDouble();
System.out.println("press.1 deposit the amount for 1 year");
System.out.println("press.2 deposit the amount for 2 year");
System.out.println("press.3 deposit the amount for 3 year");
double interest;
double maturityamt;
int i;
i=sc.nextInt();
if(i==1)
{
interest=amount*0.14;
maturityamt=amount+interest;
System.out.println("interest amount="+interest);
System.out.println("maturity amount="+maturityamt); //total amount after 1 year
}
else if(i==2)
{
interest=amount*0.15*2;
maturityamt=amount+interest;
System.out.println("interest amount="+interest);
System.out.println("maturity amount="+maturityamt); //total amount after 2 year
}
else if(i==3)
{
interest=amount*0.16*3;
maturityamt=amount+interest;
System.out.println("interest amount="+interest);
System.out.println("maturity amount="+maturityamt); //total amount after 3 year
}
else
System.out.println("wrong choice!");

}
}

6. This comment has been removed by the author.

7. import java.util.Scanner;

class Test
{

public static void main(String ar[])
{
double deposit_amt,maturity_amt;
int year,rate;
System.out.print("Enter the deposit amount: ");
Scanner o= new Scanner(System.in);
deposit_amt=o.nextDouble();
System.out.print("Enter the year: ");
year=o.nextInt();
if(year==1||year==2||year==3)
{
rate=14;
deposit_amt=deposit_amt+(deposit_amt*0.14);
if(year==2||year==3)
{
rate=15;
deposit_amt=deposit_amt+(deposit_amt*0.15);
}
if(year==3)
{
rate=16;
deposit_amt=deposit_amt+(deposit_amt*rate/100);
}
System.out.println("Maturity amount is: "+deposit_amt);
}
else
System.out.println("Wrong choice");
}

}

8. import java.util.Scanner;
class maturityamount
{
public static void main(String ar[])
{
double DepositAmt,MaturityAmt;
int year;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the Deposit Amount");
DepositAmt=scan.nextDouble();
System.out.println("Press 1 to check Maturity Amount for one year");
System.out.println("Press 2 to check Maturity Amount for two year");
System.out.println("Press 3 to check Maturity Amount for three year");
year=scan.nextInt();
switch(year)
{
case 1:
MaturityAmt=((14*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for one year @14% interest = "+MaturityAmt);
break;
case 2:
MaturityAmt=((15*2*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for two year @15% interest = "+MaturityAmt);
break;
case 3:
MaturityAmt=((16*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for three year @16% interest = "+MaturityAmt);
break;
}
}
}

9. import java.util.Scanner;
class Operator{
public static void main(String ar[]){
Scanner obj=new Scanner(System.in);

double deposit,ma1,ma2,ma3;
System.out.println("Enter Deposit Amount");
deposit=obj.nextDouble();

ma1=((14*1*deposit)/100)+deposit;
System.out.println("For Depositing 1 Year @14% Interest, Maturity Amount = "+ma1);

ma2=((15*2*deposit)/100)+deposit;
System.out.println("For Depositing 2 Years @15% Interest, Maturity Amount = "+ma2);

ma3=((16*3*deposit)/100)+deposit;
System.out.println("For Depositing 3 Years @16% Interest, Maturity Amount = "+ma3);

}
}

10. import java.util.Scanner;
class Maturity{
public static void main(String ar[]){
double m,d;
int year;
Scanner scan=new Scanner(System.in);
System.out.println("enter deposit amount");
d=scan.nextDouble();
System.out.println("Enter time");
year=scan.nextInt();

switch(year)
{
case 1:
{
m=((14*1*d)/100)+d;
System.out.println("Maturity Amount for 1 year is "+m);
break;}

case 2:
{
m=((15*2*d)/100)+d;
System.out.println("Maturity Amount for 2 year is "+m);
break;}

case 3:
{
m=((16*3*d)/100)+d;
System.out.println("Maturity Amount for 3 year is "+m);
break;}
default:
System.out.println("invalid!");

}
}
}

11. import java.util.Scanner;

class Mat{
public static void main(String ar[]){

double depamt,matamt;
int rate;

Scanner scan=new Scanner(System.in);
System.out.println("Enter the amount to be deposited:");
depamt=scan.nextDouble();

System.out.println("Enter the rate");
System.out.println("1. 14%");
System.out.println("2. 15%");
System.out.println("3. 16%");
rate=scan.nextInt();

switch(rate){
case 1: matamt=((depamt*14*1)/100)+depamt;
System.out.println("Maturity amount at 14%:"+matamt);
break;

case 2: matamt=((depamt*15*2)/100)+depamt;
System.out.println("Maturity amount at 15%:"+matamt);
break;

case 3: matamt=((depamt*16*3)/100)+depamt;
System.out.println("Maturity amount at 16%:"+matamt);
break;
}
}
}

12. package com.example.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Interest extends Activity {

int interest,time,amt,total;
Button btint;
EditText etint1,etint2;
TextView tvint;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.interest);
btint=findViewById(R.id.btint);
etint1=findViewById(R.id.etint1);
etint2=findViewById(R.id.etint2);
tvint=findViewById(R.id.tvint);

btint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
amt=Integer.parseInt(etint1.getText().toString());
time=Integer.parseInt(etint2.getText().toString());

if (time == 1){
interest=amt*14/100;
total=amt+interest;

tvint.setText("Total Amt is="+total);

}else if (time==2){
interest=amt*15/100;
total=amt+interest;

tvint.setText("Total Amt is="+total);

}else if (time==3){
interest=amt*16/100;
total=amt+interest;

tvint.setText("Total Amt is="+total);
}
}
});
}
}

13. import java.util.Scanner;
public class Testx
{
public static void main(String ar[])
{
double DepositAmt,MaturityAmt;
String Name;
int Year;
Scanner scan=new Scanner(System.in);
System.out.println("Welcome th Your maturity plan for money");
Name=scan.next();
System.out.println("Welcome"+Name);
System.out.println("Enter ther Deposite Amount \n");
DepositAmt=scan.nextdouble;
System.out.println("Press 1 depeosit for the Amount for a 1 year @14% \n");
System.out.println("Press 2 depeosit for the Amount for a 2 year @15%\n");
System.out.println("Press 3 depeosit for the Amount for a 3 year @16%\n");
Year=scan.nextInt();
switch(Year)
{
case 1:
MaturityAmt=((14*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for one year @14% interest = "+MaturityAmt);
break;
case 2:

MaturityAmt=((15*2*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for two year @15% interest = "+MaturityAmt);
break;
case 3:
MaturityAmt=((16*1*DepositAmt)/100)+DepositAmt;
System.out.println("Your maturity amount for three year @16% interest = "+MaturityAmt);
break;
}
}
}

14. This comment has been removed by the author.

15. import java.util.Scanner;
class Amount{
public static void main(String ar[]){
double deposit,maturity,m1;
int year;
Scanner s=new Scanner(System.in);
System.out.println("Enter the amount to be deposited:");
deposit=s.nextDouble();
System.out.println("Enter the year(limit is upto 3 years)");
System.out.println("For 1 year the rateofinterest is 14%");
System.out.println("For 2 years the rateofinterest is 15%(added with matamt for 1year)");
System.out.println("For 3 years the rateofinterest is 16%(added with matamt for 2years)");
year=s.nextInt();
switch(year){
case 1: maturity=((deposit*0.14)+deposit);
System.out.println("Maturity amount :"+maturity);
break;
case 2: maturity=((deposit*0.14)+deposit);
maturity+=(maturity*0.15);
System.out.println("Maturity amount in 2years:"+maturity);
break;
case 3:maturity=(deposit*0.14)+deposit;
maturity+=(maturity*0.15);
m1=maturity;
m1+=(m1*0.16);
System.out.println("Maturity amount in 3 years:"+m1);
break;
}
}
}