1answer.
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
weqwewe [10]
4 years ago
7

Project 4: Strictly Identical arrays

Computers and Technology
1 answer:
geniusboy [140]4 years ago
3 0

Answer:

import java.util.Scanner;

public class StrictlyIdentical

{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int[] list1 = new int[5];

 int[] list2 = new int[5];

 System.out.println("Enter the numbers for list1: ");

 for (int i=0; i<5; i++) {

        list1[i] = input.nextInt();

    }

    System.out.println("Enter the numbers for list2: ");

    for (int i=0; i<5; i++) {

        list2[i] = input.nextInt();

    }

 

 if (equals(list1, list2))

     System.out.println("the lists are strictly identical.");

 else

     System.out.println("the two lists are not strictly identical.");

}

public static boolean equals(int[] array1, int[] array2) {

    boolean isIdentical = true;

    for (int i=0; i<5; i++) {

        if (array1[i] != array2[i])

            isIdentical = false;

    }

    return isIdentical;

}

}

Explanation:

Create a function called equals that takes two parameters, array1, and array2

Initialize the isIdentical as true, this will be our control variable to change its value if two arrays are not identical

Create a for loop that iterates through the arrays. If corresponding elements of the arrays are not equal, set isIdentical as false.

When the loop is done, return the isIdentical

Inside the main:

Declare two arrays

Ask the user to enter numbers for the arrays using for loop

Check if two arrays are identical using the <em>equal</em> function. Print the appropriate message

You might be interested in
when files on storage are scattered throughout different disks or different parts of a disk, what is it called
mestny [16]

Answer:

File Fragmentation or Fragmented Files

3 0
3 years ago
How to check the balance on a visa gift card?
marta [7]
There should be a website found on the back of the card you can go to and type in your card number and check. Another way is the phone number found on the back of the card.
7 0
4 years ago
Robert brought 10 shares apex company for $18 each and later sold all of them at $17 each. This transaction resulted in what typ
Ghella [55]

Answer:

$1 loss

Explanation:

purchase share=$18

Sold share=$17

Profit/Loss statement=sell- purchase=17-18=-1

If it contain negative value so it is loss

Loss=$1

4 0
3 years ago
Read 2 more answers
A company uses DHCP servers to dynamically assign IPv4 addresses to workstations. The address lease duration is set as 5 days. A
nikitadnepr [17]

Answer:

FF-FF-FF-FF-FF-FF and 255.255.255.255

Explanation:

FF-FF-FF-FF-FF-FF can be defined as the layer 2 address broadcast which is often used on ethernet frames as well as help to broadcast all equipment due to the fact broadcast is made possible through Ethernet networks in which the Frames are addressed to reach every computer system on a given LAN segment as far as they are addressed to MAC address FF:FF:FF:FF:FF:FF.

255.255. 255.255 can be seen as the layer 3 address which help to address the exact same hosts because it enables the broadcast address of the zero network which is the local network due to the fact that the IP broadcasts are often used by BOOTP and DHCP clients to find and send requests to their respective servers in which a message sent to a broadcast address may be received by all network-attached hosts.

Therefore the Layer 2 and Layer 3 destination addresses which the message contain are FF-FF-FF-FF-FF-FF and 255.255.255.255

7 0
4 years ago
Supose that there are exactly 733 monks in the world.
kramer

A statement which is true about the monks is that: There is a day of the year that is the birthday of at least 3 monks.

<h3>What is a conditional statement?</h3>

A conditional statement can be defined as a statement that can be written to contain both a hypothesis and conclusion. Thus, it typically has the form "if P then Q."

Where:

P and Q represent sentences.

<h3>What is a converse statement?</h3>

A converse statement can be defined as a type of statement that is obtained by switching (reversing) the hypothesis and conclusion of a conditional statement. This ultimately implies that, the converse of a statement is obtained by switching (reversing) the hypothesis and  conclusion of a conditional statement.

In this context, we can reasonably infer and logically deduce that a statement which is true about the monks is that there is a day of the year that is the birthday of at least 3 monks because a year only has 365 days.

Read more on conditional statement here: brainly.com/question/16951916

#SPJ1

Complete Question:

Suppose that there are exactly 733 monks in the world.

Which one of the following statements is true about the monks?

Every day of the year, it's a monk's birthday.

There is a day of the year that is the birthday of exactly 3 monks

There is a monk who celebrates his birthday on a Tuesday

There is a day of the year that is the birthday of at least 3 monks

Some monk turns years at the weekend

None of the above.​

5 0
2 years ago
Other questions:
  • Which button limits your search to the files and folders in your storage locations on the device being search?
    11·1 answer
  • A hub transmits all incoming messages to all of its ports except the port where the messages came in. A switch usually sends mes
    14·2 answers
  • legacy application that has hard-coded static IP addresses and is running on an EC2 instance, what is the best failover solution
    11·1 answer
  • When you buy an Xbox 360 can you play online for free
    12·2 answers
  • What is the difference between primary storage, secondary storage and off-line storage?
    5·1 answer
  • A printer would be considered _____. Select 2 options. 1 an input device 2 an output device 3 hardware 4 software 5 storage
    10·1 answer
  • Sales management wants a small subset of users with different profiles and roles to be able to view all data for compliance purp
    7·1 answer
  • The amount of RAM storage is measured in A: GB The rule of thumb that predicts that CPU capacity will double every 2 years is ca
    11·1 answer
  • Which of the following is NOT an acceptable way to create a color?
    14·1 answer
  • many police departments coordinate youth-oriented programs as part of their prevention efforts. which of the following is not an
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!