Question: Can you do this java question using my previous questions DOING D3.3-IMPLEMENTATION 105 first method co The tit The second computes the outstanding balance after
DOING D3.3-IMPLEMENTATION 105 first method co The tit The second computes the outstanding balance after a given number of y method computes the monthly payment, and as a bonus, it also formats it analysis table) and returns it formatted as we like. For example, here is a fi years (needed the monthly payment (rounded to the nearest cent with that outputs the outstanding balance on the 2hd anniversary (rounded separator, and right-justified in a field of 16 characters): a 1000-separator) and to the nearest dollar, with a 1000 MPro mp new MProO; np.setPrinciple( 40000e; mp. setAmortization("20); mp.set Interest("5"); System ouerprintin(np.computePayment(%2f")); System.out.printtn(p.outstandingAfter(2, ", 16.0f")); This fragment should output 2,639 .82 in the first line and 375,490 in the second u can see, the MPro API provides all the pieces needed to compose the sought analysis. The composition would start with something like this: String s- "Monthly Payment-" + mp, computePayment(-%,2P); s"By making this payments monthly for " The idea is to build the analysis string s little by little using the + operator. To insert a new- hne in your string, embed "n" in it. This is known as an esape sequence and it allows us to embed characters that cannot be typed in, such as the ENTER, TAB, and non-English letters. The rows of the analysis table are then appended to s by using something like thiss s String, format("%8d", ) + mp.outstandingAfter(0, in String, format("%8d", 1) + mp.outstandingAfterC1, The "%,16.0f.); "%,16.0f"); usage of fixed field widths (8 for the first column, 16 for the second) enables us to make e output look like a table without using complex tabular UI widgets. the composition of s is completed, we poke it in the view: (CTextview) findVi ewByIdCR.id.output)).setText (s)i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
