Write a complete Java program, including comments, to do the following: Your program will compute the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a complete Java program, including comments, to do the following: Your program will compute the values of a formula that expresses y in terms of x. The formula is: 9x-27x-4x+12 -270xXx y= (3x+1)12 +15 -x 3. 2. where ... means "absolute value of" and (...)" means "square root of". (Use the built-in functions for these operations.) 1. Notes: 1. 2. 3. 4. The program should start by printing a message saying this is the output of your first program. Then, it should evaluate the formula starting with x--3, going up by 0.5 each time, until x reaches 4. Therefore, it will use values x: -3, -2.5,..., -0.5, 0, 0.5,..., 3.5, 4. For each value of x, the program should compute the corresponding value of y. It should print these values together with explanations of what the values represent, For example, it could print the string 'X', then the value of x, then the string 'Y-, then the value of y, and then a message. (It is also possible to use column headings instead if you desire.) The message should say one of three things: a) If the value of y is exactly 0, the message should say 'Y IS ZERO. b) If the value of y is positive, the message should say 'Y IS POSITIVE. c) If the value of y is negative, the message should say 'Y IS NEGATIVE'. A typical line of output would then be: X=-2.5 Y = 1.23456 (in actuality, this may not be the value for y). Y IS POSITIVE Once you have finished using x=4, the program should print a message (underneath the last line of output) stating that the program is halting. Then, stop. The output must be sent to a file When printing, use a precision of for the X value and a precision of 3 for the Y value. Make sure that your printed source code and printed output is neat!" Remember to include comments within your source code Optional: 1. 2. 3. Have your program find which of the y values is closest to 10 (either larger or smaller). have the program print the x value that gives this closest y value. Also, print how close the y value is to 10. Have your program count how many times the formula yields positive, negative, and zero results. Print these three values. Use a table, with appropriate column headings, to neatly display the output. Write a complete Java program, including comments, to do the following: Your program will compute the values of a formula that expresses y in terms of x. The formula is: 9x-27x-4x+12 -270xXx y= (3x+1)12 +15 -x 3. 2. where ... means "absolute value of" and (...)" means "square root of". (Use the built-in functions for these operations.) 1. Notes: 1. 2. 3. 4. The program should start by printing a message saying this is the output of your first program. Then, it should evaluate the formula starting with x--3, going up by 0.5 each time, until x reaches 4. Therefore, it will use values x: -3, -2.5,..., -0.5, 0, 0.5,..., 3.5, 4. For each value of x, the program should compute the corresponding value of y. It should print these values together with explanations of what the values represent, For example, it could print the string 'X', then the value of x, then the string 'Y-, then the value of y, and then a message. (It is also possible to use column headings instead if you desire.) The message should say one of three things: a) If the value of y is exactly 0, the message should say 'Y IS ZERO. b) If the value of y is positive, the message should say 'Y IS POSITIVE. c) If the value of y is negative, the message should say 'Y IS NEGATIVE'. A typical line of output would then be: X=-2.5 Y = 1.23456 (in actuality, this may not be the value for y). Y IS POSITIVE Once you have finished using x=4, the program should print a message (underneath the last line of output) stating that the program is halting. Then, stop. The output must be sent to a file When printing, use a precision of for the X value and a precision of 3 for the Y value. Make sure that your printed source code and printed output is neat!" Remember to include comments within your source code Optional: 1. 2. 3. Have your program find which of the y values is closest to 10 (either larger or smaller). have the program print the x value that gives this closest y value. Also, print how close the y value is to 10. Have your program count how many times the formula yields positive, negative, and zero results. Print these three values. Use a table, with appropriate column headings, to neatly display the output.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
How would one do the following in excel? PROJECT STEPS Donnie Cruz is a finance assistant for Oval Lake Hospital in south Florida. His current project is to format departmental data for the years...
-
A psychologist has been studying eye fatigue using a particular measure, which she administers to students after they have worked for 1 hour writing on a computer. On this measure, she has found that...
-
Consider a thermal energy reservoir at 1500 K that can supply heat at a rate of 150,000 kJ/h. Determine the exergy of this supplied energy, assuming an environmental temperature of 25C.
-
Describe and critique, in your own words, the configuration change control procedure.
-
The budget committee of DuBois Fashions, an upscale womens clothing retailer, has as sembled the following data. As the business manager, you must prepare the budgeted income statements for May and...
-
The accounting major is a valuable degree. Students often think only of employment at CPA firm. However, there are many other jobs available. In terms of jobs with the federal government: what is the...
-
The probability that machine A will be performing a useful function in five years time is 0.25, while the probability that machine B will still be operating usefully at the end of the same period is...
-
Ghost Goods: How to Spot Phantom Inventory What auditors have to know to uncover phony figures. BY JOSEPH T. WELLS June 1, 2001 Journal of Accountancy ust a hint of inventory fraud can be a...
-
Make a "Payment Scheme" for the franchise proprosal. The details about the business is in the safe link below, please refer to it to produce correct payment scheme. File Home Insert Draw Page Layout...
-
Transactions Oct. 1 7 13 8 Sales Invoice No. 16 to U. Makinmoenay, $760 for services performed, plus HST. 29 Cheque Copy No.08, Imyolandlord, payment for monthly rent $2,000 plus HST. 17 Cash Sales...
-
Please prepare the report to Steve addressing the following: Illustrate the transfer of the assets to the corporation under Section 85 in Excel using the attached T2057 election form template, be...
-
I created a data matrix; I need help expressing the relationships among taxa marking the derived character states at the node where they change. . # 1 # 2 #3 #4 #5 #6 #7 #8 #9 1. #10 #11. 1....
-
In preparing a company's statement of cash flows for the most recent year on the indirect method, the following information is available: 52,000-Net income for the year 18,000-AP decreased 25,000-AR...
-
Give an example of transitory income. What effect does this income have on the marginal propensity to consume?
-
Is the word anxiety a candidate for creating a stable pattern? If so, give reasons.
-
Define the real meaning of anxiety. What are the different meanings of this word?
-
Do you agree to the suggestion that anxiety pattern is applicable to all domains where it plays a major role?
Study smarter with the SolutionInn App