1 Emport java.util.Scanner; 2 3 public class CallMagicFormula { 4 5 6 7 8 9 10...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 Emport java.util.Scanner; 2 3 public class CallMagicFormula { 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 } // DO NOT MODIFY magic! public static double magic(int a, long b, double c) { return a * b + c * b; } public static void main(String[] args) { // Your code needs to do the following in order: // 1.) Prompt the user to enter a long // 2.) Read in a long from the user } // 3.) Prompt the user to enter a double // 4.) Read in a double from the user // 5.) Prompt the user to enter an int // 6.) Read in an int from the user // 7.) Call the magic method with the aforementioned parameters // 8.) Print out the result returned by the magic method. // // Correct output is shown below, where 1234567890, 32.78, // and 55 were all inputs from the user: // // Enter a long: 1234567890 // Enter a double: 32.78 // Enter an integer: 55 // Magic formula result: 1.0837036938420001E11 // // Your code needs to match the above output. // TODO - write your code below this comment 1 import java.util.Scanner; [ 2 алршл 3 public class Circle Area { 7 8 9 10 11 HAHAHAHAH 12 13 14 15 16 17 18 19 20 } 21 public static void main(String[] args) { // Your code needs to do the following, in order: // 1.) Prompt the user to enter a radius // 2.) Read in the radius from the user, as a double // 3.) Calculate the area. Use the value 3.14 for pi. // 4.) Print out the area. // } // Correct output is shown below, where 12 was the specific // value the user input: // // Enter radius: 12 // Area: 452.16 // // Your code needs to match the above output. // TODO - write your code below this comment 1 Emport java.util.Scanner; 2 3 public class CallMagicFormula { 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 } // DO NOT MODIFY magic! public static double magic(int a, long b, double c) { return a * b + c * b; } public static void main(String[] args) { // Your code needs to do the following in order: // 1.) Prompt the user to enter a long // 2.) Read in a long from the user } // 3.) Prompt the user to enter a double // 4.) Read in a double from the user // 5.) Prompt the user to enter an int // 6.) Read in an int from the user // 7.) Call the magic method with the aforementioned parameters // 8.) Print out the result returned by the magic method. // // Correct output is shown below, where 1234567890, 32.78, // and 55 were all inputs from the user: // // Enter a long: 1234567890 // Enter a double: 32.78 // Enter an integer: 55 // Magic formula result: 1.0837036938420001E11 // // Your code needs to match the above output. // TODO - write your code below this comment 1 import java.util.Scanner; [ 2 алршл 3 public class Circle Area { 7 8 9 10 11 HAHAHAHAH 12 13 14 15 16 17 18 19 20 } 21 public static void main(String[] args) { // Your code needs to do the following, in order: // 1.) Prompt the user to enter a radius // 2.) Read in the radius from the user, as a double // 3.) Calculate the area. Use the value 3.14 for pi. // 4.) Print out the area. // } // Correct output is shown below, where 12 was the specific // value the user input: // // Enter radius: 12 // Area: 452.16 // // Your code needs to match the above output. // TODO - write your code below this comment
Expert Answer:
Answer rating: 100% (QA)
Question 1 import javautilScanner public class CallingMagicFormula public static double magicint a l... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
4.22 Consider the left-shift operator on l (N), S : l (N) l (N), S(x1, x2,...) := (x2, x3, . . . ). (i) Show that S is a bounded linear operator. (ii) Show that S is not an isometry. (iii) Find the...
-
It is initially at 25\deg C. The warehouse is desired to be cooled to 5\deg C. The heat transferred from the external environment to the tank is 1.2 kW. Accordingly, a cooling system with H kW power...
-
Historical returns for the past three years for Stock B and the stock market portfolio are Stock B: 30 percent, 0 percent, 30 percent; market portfolio : 18 percent, 20 percent, 28 percent. The...
-
A car costs 12,000. It will be kept for three years, and then sold for 3,000. Calculate the depreciation for each year using (a) the reducing balance method, using a depreciation rate of 35 per cent,...
-
In a 250-turn automobile alternator, the magnetic flux in each turn is B = (2.50 x 10-4 Wb) cos (wt), where w is the angular speed of the alternator. The alternator is geared to rotate three times...
-
A steam turbine operates adiabatically at a power level of 3,500 kW, Steam enters the turbine at 2,400 kPa and 500oC and exhausts from the turbine as saturated vapor at 20 kPa. What is the steam rate...
-
Ruby Pharmacy allocates indirect expenses to its three departments on the basis of sales. For the year ended 30 June 2024, the following allocations were made. Required (a) Determine the allocation...
-
Partial adjusted trial balance data for Wilder Company is presented in BE3-9. The balance in Owners Capital is the balance as of January 1. Prepare an owners equity statement for the year assuming...
-
The loading Code AS1170.1 requires that the reading room (without a bookstore) at the library be designed for a floor live load of Q = 2.5 kPa. If the spans between two steel beams are L = 12 m as...
-
Skylar and Walter Black have been married for 25 years. They live at 883 Scrub Brush Street, Apt. 52B, Las Vegas, NV 89125. Skylar is a stay-at-home parent and Walt is a high school teacher. Skylars...
-
Do a brief analysis on the Canada Lotto 649 lottery. Briefly describe how it works (go online and get info as needed, you must put references in your submission). How many numbers do you get to...
-
The structure below supports a 400-kg mass at G and is supported by a pin joint C and a rope AB. The structure consists of the vertical bar CDE, the L-shaped bar DF, and the horizontal bar BEFG. The...
-
Crazy rich Ellen offered her newly acquired Ford Explorer to her friend Portia for $2,300,000.00, which the latter gladly accepted given the discounted price. As a gift for paying in cash, Ellen...
-
compute discounts, evaluate how discounts are used to influence consumer purchases, and identify the best discount option when shopping. Calculating the example: Disount is: $29.99 x 15% = $4.50 Sale...
-
It was the first pregnancy for Barbara Ann, 29 years old, and it was normal. During pregnancy, she reported a "small" breast enlargement. Your child is breastfed for the first time within 2 hours...
-
1.Time Line-Show the time line for $450 cash outflow today, a $539.55 Cash outflow in year two and a 10% interest rate. 2.One Year Future Value- What is the future value of $600 deposited for one...
-
Select a state that contains at least 3 Dillard’s stores and provide a solution for each request below using Microsoft SQL Server Management Studio. Provide a screenshot for each solution, with...
-
A parking lot charges $3 for the first hour (or part of an hour) and $2 for each succeeding hour (or part), up to a daily maximum of $10. (a) Sketch a graph of the cost of parking at this lot as a...
-
Mike sells his home to Jane on April 2, 2012. Jane pays the property taxes covering the full calendar year in October, which amount to $2,500. How much may Mike and Jane each deduct for property...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Leslie and Leon Lazo are married and file a joint return for 2012. Leslie's Social Security number is 466-47-3311 and Leon's is 467-74-4451. They live at 143 Snapdragon Drive, Reno, NV 82102. For...
-
Find the maximum of the function using Trust region method \(f=15 x_{1}+8 x_{1} x_{2}+5 x_{2}\) subject to \(x_{1}+x_{2} \leq 10\)
-
Define trust region fidelity.
-
Calculate the reduction ratio \(r_{k}=\frac{f\left(X_{k} ight)-f\left(X_{k}+s_{k} ight)}{m_{k}\left(X_{k} ight)-m_{k}\left(X_{k}+s_{k} ight)}\) for the function given in problem 1 .
Study smarter with the SolutionInn App