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
Someone claims that the big O notation does not make sense at all, and they give the following example. An algorithm A that proc
Svetllana [295]

Answer:

Big Oh notation is used to asymptotically bound the growth of running time above and below the constant factor.

Big Oh notation is used to describe time complexity, execution time of an algorithm.

Big Oh describes the worst case to describe time complexity.

For the equation; T(N) = 10000*N + 0.00001*N^3.

To calculate first of all discard all th constants.

And therefore; worst case is the O(N^3).

7 0
2 years ago
What elements of SANS 20 you could leverage to reduce the TCP/IP vulnerabilities of your workstation
Vlada [557]

Answer:

- limitation and control of network ports, protocols and services.

- Continuous vulnerability assessment and remediation.

Explanation:

The TCP or transmission control protocol is a layer 4 protocol (transport), that reliably transports packets in sequential segments to an application in the destination computer, using the ip address and the port number of the application.

The ICMP sent during the TCP/ip activities, can render the network vulnerable to attacks. limitation and control of the network ports, protocols and services and continuous assessment would mitigate the vulnerability of the TCP/ip model.

5 0
1 year ago
Your network administrator finds a virus has been successfully inserted into the network software. The virus itself is now consi
Svetlanka [38]

Answer: Vulnerability of

Explanation:

The network administrator was able to identify that virus before it led to denial of service to users. Since it has been discovered, it is no longer a threat as measures will be taken to eliminate it. But a virus that was successful uploaded shows how vulnerable the system is or how bad the security protections put in place are. Steps has to be taken to ensure it does not reoccur.

7 0
1 year ago
Read 2 more answers
6. Write pseudo code that will perform the following. a) Read in 5 separate numbers. b) Calculate the average of the five number
Alex

Answer:

Pseudo CODE

a)

n= Input “Enter 5 integer value”

b)

sum=0.0

For loop with i ranging from 0 - 5

Inside loop sum=n[i]+sum

Outside loop avg= sum/5

Print avg

c)

small=n[0] # assume the first number in the list is smallest

large= n[0] # assume the first number in the list is largest

For loop with i ranging from 0 - 5

Inside loop if n[i]<small #if any another number is smaller than small(variable)

Inside if Then small=n[i]

Inside loop if n[i]>large # if any another number is larger than large(variable)

Inside if then large=n[i]

Print small

Print large

d)

print avg

print small

print large

8 0
2 years ago
Which of the following corresponds to the computer interface technology that uses icon, etc?
Aleksandr [31]

Answer:

D) GUI

Explanation:

GUI an acronym for Graphical user interface, is a type of user interface where a user interacts with a computer or an electronic device through the use of graphics. These graphics include icons, images, navigation bars etc.

GUIs use a combination of technologies and devices to create a layout that users can interact with and perform tasks on. This makes it easier for users who do have basic computer skills to utilize.

The most common combination of these elements is the windows, icons, menus and pointer paradigm (WIMP) . GUIs are used in mobile devices, gaming devices, smartphones, MP3 players etc.

6 0
1 year ago
Other questions:
  • What is a cursor?
    6·2 answers
  • In a spreadsheet, the instructions for carrying out calculations are called __________. recalculations formulas templates macros
    13·1 answer
  • A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
    8·2 answers
  • In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
    15·1 answer
  • A communication pattern in which the parties slowly reduce their dependence on one another, withdraw, and become less invested i
    9·1 answer
  • Please answer this a due tomorrow!!!
    12·1 answer
  • Which of the registration patterns is best suited for complex architecture? A. Client side discovery pattern B. Third party regi
    13·1 answer
  • Choose the attribute used to provide accessibility by configuring a text alternative that is available to browsers and other use
    14·1 answer
  • In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
    12·1 answer
  • In a particular field, there are trees in a l single row from left to right. Each tree has a value V You cut trees from left to
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!