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
n200080 [17]
2 years ago
10

A combination lock has the following basic properties:

Computers and Technology
1 answer:
fomenos2 years ago
5 0

Answer:

public class CombinationLock {

   

    private int combinationNumber1 = 0;

    private int combinationNumber2 = 0;

    private int combinationNumber3 = 0;

   

   CombinationLock(int combinationNumber1, int combinationNumber2, int combinationNumber3){

       this.combinationNumber1 = combinationNumber1;

       this.combinationNumber2 = combinationNumber2;

       this.combinationNumber3 = combinationNumber3;

   }

   

   public boolean open(int number1, int number2, int number3){

       if(number1 == combinationNumber1 && number2 == combinationNumber2 && number3 == combinationNumber3)

           return true;

       else

           return false;

   }

   

   public boolean changeCombo(int number1, int number2, int number3, int newNumber1, int newNumber2, int newNumber3){

       

       if (open(number1, number2, number3)){

           combinationNumber1 = newNumber1;

           combinationNumber2 = newNumber2;

           combinationNumber3 = newNumber3;

           return true;

       }else

           return false;

   }

}

Explanation:

- <em>Three variables</em> are created to hold the combination.

- A <em>constructor</em> is created to set the combination.

- A boolean method called <em>open</em> is created to check if the given numbers are correct, and <u>returns true</u> (<u>otherwise returns false</u>).

- A boolean method method called <em>changeCombo</em> is created to check if given numbers are correct. If they are correct, it assigns new values for the combination and <u>returns true</u> (<u>otherwise returns false</u>).

You might be interested in
A technician, joe, has replaced a faulty 500 gb hard drive in a pc system with a 1 tb hard drive. however, after the replacement
Brums [2.3K]

The best possible solution for the technician to do is to go into the disk management and find out what exactly is going on. The technician should check whether there is partition that has unallocated space. It is 100% the case that the rest of the 500 GB is in the unallocated space.

The techie need to grow his partition. Possible option for a scenario like this is delete the unallocated 500 GB space using NTFS. He can then recreate the available 500 GB free space as 1TB partition.

5 0
3 years ago
Which statement is NOT true:
RSB [31]

Answer:

The correct answer for the given question is   "Machine languages can be used to write programs that can run on any machine."

Explanation:

The machine language consist of binary digit i. e 0 and 1 .Computer can understand only the machine language .The machine language consist of code that is written in bits so it is used  to express algorithms.When any program is compiled the compiler are converted into machine code so the machine language is produced by the compiler .

Machine language cannot used to write a program that run on any machine.

5 0
3 years ago
What are the characteristics of:<br> Master file<br> Transaction file<br> Reference file
IRISSAK [1]
<h3>Master File :-</h3>
  • Master files contain descriptive data, such as name and address, as well as summary information, such as amount due and year-to-date sales.

<h3>Transaction File :-</h3>
  • Fast performance with a rapid response is critical. Organisations rely heavily on their TPS with failure possibly stopping business.

<h3>Reference File :-</h3>
  • Information in one drawing can be overlaid on a different drawing, eliminating the need to redraw information.
  • Proper use of reference files will result in significant time savings and greater coordination of drawings.

Explanation:

<h3>Hope it helps you!</h3>
7 0
1 year ago
) Consider a router that interconnects four subnets: Subnet 1, Subnet 2, Subnet 3 and Subnet 4. Suppose all of the interfaces in
erik [133]

Answer:

Check the explanation

Explanation:

223.1.17/24 indicates that out of 32-bits of IP address 24 bits have been assigned as subnet part and 8 bits for host id.

The binary representation of 223.1.17 is 11011111 00000001 00010001 00000000

Given that, subnet 1 has 63 interfaces. To represent 63 interfaces, we need 6 bits (64 = 26)

So its addresses can be from 223.1.17.0/26 to 223.1.17.62/26

Subnet 2 has 95 interfaces. 95 interfaces can be accommodated using 7 bits up to 127 host addresses can represented using 7 bits (127 = 27)

and hence, the addresses may be from 223.1.17.63/25 to 223.1.17.157/25

Subnet 3 has 16 interfaces. 4 bits are needed for 16 interfaces (16 = 24)

So the network addresses may range from 223.1.17.158/28 to 223.1.17.173/28

4 0
3 years ago
HELP PLEASE!! WILL MARK FIRST AND MOST RELIABLE ANSWER BRAINLIEST!!~~~~What is the primary difference between sort and filter?
tatiyna

Answer:

A

Explanation:

Example: when scrolling through a list of shows, if you filter for action shows, only shows that match the action description would appear

3 0
3 years ago
Other questions:
  • How Java provides protection through stack inspection approach ?
    7·1 answer
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    10·1 answer
  • You are setting up your Windows computer to connect to the Internet and notice that when you type www.microsoft, the browser doe
    15·1 answer
  • Jamey did a lot of research on his paper topic but can't figure out where to start writing. He has a loose plan in mind, but it'
    9·2 answers
  • Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
    11·2 answers
  • Pls help! for computers edge 2021
    7·1 answer
  • Discuss TWO changes in ICMP that took place with the development of IPV6 and indicate why those changes were made.
    7·1 answer
  • Which of the following statements should be avoided when developing a mission statement?
    13·1 answer
  • Which diagram is NOT a good model of 3÷14?
    12·2 answers
  • When an event occurs, the agent logs details regarding the event. what is this event called?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!