Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java code please. Thank you so much in advance l T-Mobile LTE 10:50 AM 66% swccd.instructure.com For this assignment, you must solve the following 3

Java code please. Thank you so much in advance
image text in transcribed
image text in transcribed
image text in transcribed
l T-Mobile LTE 10:50 AM 66% swccd.instructure.com For this assignment, you must solve the following 3 problems. . Print the output of your program in a nice looking way. Use escape sequences when needed to make columns and align Do manual calculations before running your program, so you will know the answer beforehand . Use variables for printing results. For example, do not use something like "X x instead. 2.8712" inside print or printin. Use "X " + . Be sure to use the proper data type for each variable. For example, do not use integers for calculations if your solution is likely to be a double precision number. . Use proper indentation. Bad indentation will cause your grade . Use proper, descriptive names for the variables when . Submit a single Java file. All your code must be in it. Look to decrease. below for a sample rum. Problems: 1. Prime numbers do not occur in a predictable way. There are sequences of primes which can be partially described in a formula, but sooner or later the formula breaks down. One formula invented by Leonhard Euler (1707-1783). generates prime numbers regularly for the series of consecutive numbers from 0 to 15 and then stops. The formula is x2x 17, in which x is any number from 0 to 15. o Use Euler's formula to print the prime numbers generated using x- 5, 11 and 15. in sequence. o Calculate and print the sum of all these 3 prime numbers. o Calculate and print the mean of all these 3 prime numbers 2. Solve the equation: 2.8a5.12 -3.79 0 using the quadratic formula. o Use the code from Lab3 to get the solutions o Remember that a quadratic equation has two solutions. o In Lab 3 we coded only one solution, the one with the +in front of the square root. l T-Mobile LTE 10:50 AM 66% swccd.instructure.com Problems: 1. Prime numbers do not occur in a predictable way. There are sequences of primes which can be partially described in a formula, but sooner or later the formula breaks down. One formula invented by Leonhard Euler (1707-1783), generates prime numbers regularly for the series of consecutive numbers from 0 to 15 and then stops. The formula is x2+x+17, in which x is any number from 0 to 15. o Use Euler's formula to print the prime numbers generated using x = 5, 11 and 15, in sequence. o Calculate and print the sum of all these 3 prime numbers. o Calculate and print the mean of all these 3 prime numbers 2. Solve the equation: 2.85.12z 3.79 o using the quadratic formula. o Use the code from Lab3 to get the solutions o Remember that a quadratic equation has two solutions. o In Lab 3 we coded only one solution, the one with the in front of the square root. o You must code the second solution and print both. 3. Calculate the amount for a $10,000 loan after 5, 10 and 15 years if the interest is compounded every month at a rate of 1% compounded every month. Assume no payments are being made. The formula for composite interest is A P(1 . where: o A is the amount after t years, P is the initial amount. o r is the interest rate (use decimal values, not percentages) and o n is the number of times the interest is compounded per year l T-Mobile LTE 10:50 AM 66% swccd.instructure.com compounded every month. Assume no payments are being made. The formula for composite interest is A P(1) . where: o A is the amount after t years, o r is the interest rate (use decimal values, not percentages) o n is the number of times the interest is compounded per P is the initial amount. and year For example, the amount after 2 years will be calculated using P-10000, r-0.01, n-12 and t-2 Look at the following sample run. Your program must print your results in a similar way. Results are blurred on purpose: Problem 1 The prime numbers ares Their sum is Their mean is: Problem 2 Problem3 Amount after 5 years- Amount after 10 years- Amount after 15 years - BUILD SUCCESS FUL (total times 0 seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions