answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dsp73
1 year ago
13

Write a program to determine all pairs of positive integers, (a, b), such that a < b < 1000 and [a2 + b2 + 1)/(ab) is an i

nteger.
Computers and Technology
1 answer:
alina1380 [7]1 year ago
5 0

Answer:

1. We must import the packages for the array list

2. We create the array to store the data

3. We make the first for cycle for 1000 values

4. The second for cycle for the variable a

5. We make the operation

6. Cast the result to an Integer and check if they are equivalent

7. We print the result

Explanation:

package javaapplication16;

import java.util.ArrayList;

public static void main(String[] args) {

ArrayList result = new ArrayList();

       for(int b = 0; b < 1000; b++) {

           for(int a = 0; a < b; a++) {

               double calculatedResult = (Math.pow(a, 2) + Math.pow(b, 2) + 1) / (a * b);

               if (calculatedResult == (int)calculatedResult) {

                   result.add("[" + a + "," + b + "]");

               }

           }

       }

       System.out.println("Result: " + result);

}

You might be interested in
Earlier in the day, you created a user account for Brenda Cassini (bcassini). When she tries to log in, she can't. You realize t
kolezko [41]

Answer:

idk

Explanation:

how bout idk maybe ask ur teacher dont be afraid to ask thats what they're there for

just saying not tryna be rude or anything

7 0
2 years ago
Read 2 more answers
Which feature of Badoo helped members make their profile more prominent?
Tamiku [17]

rise up was correct just finished the test

4 0
1 year ago
Ana works in the medical records department at a large medical office. Her job includes scanning and uploading medical records i
iragen [17]
“Ana girl you need to stop going on the internet like that you know we can’t do that stuff on the work computers, and what if they check the history or the IT has that thing we’re you can see stuff on your computer on his computer?” ... “ Girl you finna get in some trouble and it’s gonna be your fault because you wanted Victoria Secret perfume” ... “Girl cut it out I’m telling you, and plus how do you know if I’m not IT I could like get you in trouble girl so yeah stop”
8 0
2 years ago
Let's assume that the smallest possible message is 64 bytes (including the 33-byte overhead). if we use 100base-t, how long (in
Ostrovityanka [42]

As we know that 10-bAse data travels at the rate of 10 mbps, therefore at 1 sec we have 10240 bytes.

We have to calculate for 64 bytes travelling in one second. Multiply both sides by 64.

64 sec = 10240 x 64 bytes

64 bytes = 64 / 10240 sec

Now we have to calculate for light of speed

1 sec = 186000 miles

Substitute this value to the formula above

64 bytes = 64 / 10240 x 1 sec = 64 / 10240 x 186000 miles = 64 / 10240 x 186000 x 5280 feet = 6138x10^3 feet

Therefore, 64 bytes is equal to 6138 x 10^3 feet long message

3 0
1 year ago
3) 5, 10, 15, 20 are items of data. Explain how these could become information and what knowledge
yKpoI14uk [10]

For example when there is research on how many people shoplift in a shopping centre per week. These numbers could show a increase in the number of shoplifters per week.

8 0
1 year ago
Other questions:
  • De'Von is graduating from college and wants to create a professional development plan in order to prepare for his future. What i
    8·1 answer
  • A small company is moving towards sharing printers to reduce the number of printers used within the company. The technician has
    14·1 answer
  • Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla
    14·1 answer
  • 14.28. Consider the relation R, which has attributes that hold schedules of courses and sections at a university; R = {Course_no
    7·1 answer
  • Sara is having a tough time finding the cause of a problem on a computer she is troubleshooting. She found a possible problem bu
    15·1 answer
  • Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
    12·1 answer
  • Using virtualization comes with many advantages, one of them being performance. Which of these is NOT another realistic advantag
    7·1 answer
  • Write an expression that continues to bid until the user enters 'n'.
    9·1 answer
  • Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is 2000 2, t
    5·1 answer
  • The most likely reason a firm would decide to establish an extranet would be the desire to Multiple Choice speed the flow of inf
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!