Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using nested loops Problem 1) Code a program that calculates the sum of all the numbers between -49 to-11 using a single loop. Problem 2)
Using nested loops
Problem 1) Code a program that calculates the sum of all the numbers between -49 to-11 using a single loop. Problem 2) Using nested loops write the code that prints the following pattern: 12 123 1234 2345 123456 1234567 12345678 123456789 1234567890 Problem 3) Using nested loops, write a program that prints a checkered board like the one below Problem 4) Write a program that calculates the amount of a loan using the composite interest formula. The principal was $5,000, compounded quarterly at a 1.5% interest. Calculate and print the amount for t-1 year to t-15 years using a single loop. Amount at years : 5076-422930676268 lnount at 2 yeaES5151 98358504E8 Anouas a 3 years : 5229.6991262025475 Anouts at 4 years : 5308.68972118631 Amount atyeazs:$465 5505000563 Amount as 7 years ; SSS2.460003041 Anours a@ years : 5636.219120.10532 Amount at 9 years : 5721 239161024449 Anount at 10 yeES5807 541685949309 Anount a 11 yeazs5895 246048745087 Amount at 2 years : s504, 071007097282 Amount at 13 yeazs074 3352345277 Anoun a 14 years : 626$.960024 Anouns a 15 years : 6259.979102620842 BUILD SUCCESSFUL (otal sime:seconds T-Mobile LTE 6:22 PM 86% Lab 7 Nested loops swccd.instructure.com Problem 4) Write a program that calculates the amount of a loan using the composite interest formula. The principal was $5,000, compounded quarterly at a 1.5% interest. Calculate and print the amount for t-1 year to t-15 years using a single loop. Amount at i years: 5075-422930676268 Amount at 2 years $151.90358504609 Amount at 3 Amount at 4 years : 5308.586972118632 Anount at 5 yeazs 5388.E648095559385 Amount at yeazs5469.950588029s5 Amount at 7 yeazs 5552.4252883041 Amount at years$636.21912010932 Amount at 9 years 6721.2391610244495 Amountat 10 yeazs 5807-541685949309 years : 5229.699126202947 Amount at 12 years:$504.071007097202 Amount at 13 years:6074.33913491775 Anoun at 14 yoa: s : 165. 96802 6813159 Amount at 16 ye rs : 2S8.979|02620042 BUILD SUCCESSFUL (total tine: 0 seconds) Problem 5) Code a loop that evaluates the function f(z) = sin(z) + cos(z) in the interval [ , 2] at intervals of T6. Use the fact that sin(x) is coded as Math.sin(x) and cosl) is coded as Math.cos(x). t(ax 1.366025403784438 0.5235987755982988 1.0471975511965976 1 .s7079632 7948 966 2.0943951023531953 2.17993877991494 3.1415926535897927 3. 651914291880914 4.1887902047863905 4.71238898038469 5.235987755982989 5-759586531581288 1.0 0.302540370443093 -0.302540378443815 -0.9999999999999994 -1.360254037844384 -1.360254037844388 -0.30254037844385 0.360254037844391S Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started