You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 17, 2024. It is now read-only.
Write a program to assign values to variables principle and time. If time is more than 2 years, calculate and print the simple interest with rate 8% else calculate with rate 12%.
12/06/23 */
publicclassProgram012 {
publicstaticvoidmain() {
doubleprinciple = 2304.5;
doubletime = 3.0;
intrate = time > 2.0 ? 8 : 12;
doublesi = (principle * time * rate) / 100;
System.out.println("The simple interest is " + si);