can some one help me align my output with out using printf? public class numbers
ID: 3652370 • Letter: C
Question
can some one help me align my output with out using printf?public class numbers {
public static void main(String[] args) {
int deposit = 1000;
int initialdeposit = 0;
double interestrate = 6.5;
double currentvalue =0;
double interest ;
double newbalance;
int years = 25;
System.out.println("years currentbalance interest new balance ");
for( int i=1; i<= years; i++ ) {
{
initialdeposit = deposit;
currentvalue = deposit;
}
newbalance =currentvalue*Math.pow((1+(interestrate/100)), 1);
interest = newbalance - currentvalue;
System.out.println(years); System.out.print( currentvalue); System.out.print( interest); System.out.print(newbalance);
deposit = 100;
currentvalue = newbalance + deposit;
}
}
}
Explanation / Answer
public class numbers { public static void main(String[] args) { int deposit = 1000; int initialdeposit = 0; double interestrate = 6.5; double currentvalue =0; double interest ; double newbalance; int years = 25; System.out.println("years currentbalance interest new balance "); for( int i=1; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.