Computer Science, asked by Kishnatiwari, 1 year ago

Please solve Q. 19 and use Scanner class. ​

Attachments:

Answers

Answered by kavya176
1

b) ci= p* ((1+R/100)t-1)


Kishnatiwari: Wrong ans.
kavya176: I am sorry by mistake.
Kishnatiwari: Can you solve it?
kavya176: yes
kavya176: I have done the wrong typing
Kishnatiwari: ok
Kishnatiwari: Give me a attachment by writing it on a paper.
Answered by shambhavi2807
1

Answer:

import java.util.*;

class Interest

{

public static void main(String args[ ])

{

Scanner in=new Scanner (System.in)

System.out.println("Enter the principal amount, rate of interest and time period");

double p=in.nextDouble();

double r=in.nextDouble();

double t=in.nextDouble();

double I=0.0;

System.out.println("Enter the type of interest. S for simple and C for compound interest.");

char i=in.nextChar();

if(i== 'S')

{

I=(p*r*t)/100;

}

else if(i=='C')

{

I=p[(1+r/100)^t)-1];

}

else

{

System.out.println("Wrong input");

}

double amt= p+I;

System.out.println("Interest on "+p+"="+I);

System.out.println("Total sum after interest="+amt);

}

}

Please mark as Brainliest if understood. If any doubt then please ask.


Kishnatiwari: How can i ask more questions?
shambhavi2807: By uploading it
Kishnatiwari: how to upload?
Kishnatiwari: shanbavi how to upload
shambhavi2807: like you uploaded the first question
Similar questions