Execute the internal loop of the method

Assignment Help JAVA Programming
Reference no: EM131591480

Assignment:

This assignment will consist of three methods in addition to the main method. Class name is: Roots

Method names are: roots
You may not substitute other names. You must use the names provided above.

Requirements

Main method

1. Shall prompt the user using a print or println to input a single integer value.

2. Shall use a Scanner object to input a single integer value.

3. Shall call the "roots" method with the single int value provided by the Scanner.
First method (roots)

4. Shall have only one formal int parameter.

5. Shall have a void return type.

6. The parameter shall determine how many times to execute the internal loop of the method. Within the loop the method:
6.1. Shall prompt and input two integer values.
6.2. Shall use a Scanner object to input two integer values when prompted.
6.3. Shall print your name on one line.
6.4. Shall call the second "roots" method from inside of the print statement of "6.3". 6.5. Shall pass the second "roots" method the two input integer values as parameters.
6.6. Shall print the result of the call to the second roots method on the next line after the
requirement in "6.3."
6.7. Note : Only two lines will be printed for each iteration of this loop (from this method).
Second method (roots)

7. Shall have two formal int parameters.

8. Shall have a double return type.

9. Shall cast the two int parameters as doubles and pass to the third "roots" method.

10. The return value from the third "roots" method shall be printed on a single line. (from this method)

11. Shall compute and return the square root of the sum of the squares of the two int parameters ( Calculations to be performed in floating point). Algebraically it would look like this, (a^2 + b^2)^1/2
12. Note: you will need to use the Math package to compute the square root
Third method (roots)

12. Shall have two formal double parameters.

13. Shall have a double return type.

14. Shall compute and print the first parameter times 3 on one line. Ex: (first * 3.0)

15. Shall compute and return the result of the following computation:
    15.1. First parameter times 100.0 with the result divided by 3 times the second parameter. Algebraically it looks like:

       15.1.1. (first * 100.0) /(second * 3) Output Example

Your output should look like the following example, but it will have different numeric values (based on your input) and of course your name, not mine. If you follow the requirements strictly, you get the same results:

Enter a single integer value =>
2
Please enter two integer values =>
3 4 9.0 25.0
Don Phanco
5.0
Please enter two integer values =>
6 8,
18.0
25.0
Don Phanco

Reference no: EM131591480

Questions Cloud

Define instructional design : Define instructional design and describe its purpose. can it be more than 100 words please. References are required.
Understanding of how the human resource function : The objective of this assessment is to demonstrate your understanding of how the human resource function interacts with other functions in the organization.
Discuss the three faces of leadership : Critically discuss the relevance of the above perspective in the contemporary organisational context. Support your discussion with ideas from relevant theories.
Does the nature of the business itself : Does the nature of the business itself (the services provided) impact the location of the expansion (regional, national, global)? Why or why not?
Execute the internal loop of the method : The parameter shall determine how many times to execute the internal loop of the method. Within the loop the method
What is the monthly return on this investment vehicle : What is the monthly return on this investment vehicle? What is the effective annual return?
Create an imaginary profile of a family of four members : Create an imaginary profile of a family of three to four members providing details such as sex, age, health status, nutritional status, and medications.
Calculate the mean absolute deviation : Project - In a workbook for Eller Software Services, you calculate deviation statistics for sales by product and city
After-the-fact project evaluation : What are the major purposes served by an after-the-fact project evaluation?

Reviews

Write a Review

JAVA Programming Questions & Answers

  What wc produces on a linux system

Write a Java program (completely documented according to the class documentation guidelines, of course) named Prog3.java that counts lines, words, and bytes (characters) of text files.

  Use of java api to perform interactive i/o in java

To gain experience designing and writing your own Java Program, To use of Java APIs to perform interactive I/O in Java programming, To declare variables and constants appropriately

  Hypothetical situation

Hypothetical Situation - A company lowers its price of an economy car a small amount   ($15,000 to $14,000) Sales go from 10,000 units to 50,000 units. Another company lowers its price on a luxury car a large amount ($80,000 to $40,000). Its sales go..

  Concept of object oriented programming

What is the significance of the concept of inheritance within the concept of object oriented programming?

  Compare the first and second items

Compare the first and second items. If they are out of order, swap them - Compare the second and third item. If they are out of order, swap them

  Write a simple application which implements the stockwatcher

Write a simple application which implements the StockWatcher interface (attached file)

  Assignment on java applets and activex controls

Go online and search for information about security threats posed by Java applets and ActiveX controls. Note that most of these programs are small in size and downloaded onto computers over the Internet.

  Determine the classes that are required for the design

MN404- T1 2017 Fundamentals of Operating Systems and Java Programming Assessment. Determine the classes that are required for the design

  Write following java expressions in mathematical notation

Write the following Java expressions in mathematical notation.

  Create a 2d array of randomly generated ints

Write a complete Java class that will create a 2D array of randomly generated ints that of size 5 rows and 10 columns. Print the values of each cell to a 5x10 table.

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Create a time design

Create a time design. The requirements are as follows: Clock system must be self-contained object that can be instantiated, and given start, pause, fast forward, and slow down settings

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd