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]
3 years ago
10

A combination lock has the following basic properties:

Computers and Technology
1 answer:
fomenos3 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
Can someone explain to me how to do circuit calculations
GenaCL600 [577]

Use the following rules:

- The sum of currents that enter and exit a node (junction) is always zero. So if you have 3 wires that connect, through one flows 2A, the other 3A, then the third must deliver 5A (taking the direction into account!)


- The sum of voltages across different components should always add up. So if you have a battery of 10V with two unknown resistors, and over one of the resistors is 4V, you know the other one has the remaining 6V.


- With resistors, V=I*R must hold.

With these basic rules you should get a long way!

7 0
3 years ago
Becca is working on a program that will store data. The program will need quick access to data and data persistence is not impor
borishaifa [10]

Based on the information given the data should be stored in flash memory.

<h3>What is flash memory:</h3>

Flash memory is a memory storage space that is used to store data or information on a computer.

Flash memory is vital as it help to retain information or data that are stored on a computer after power is removed which inturn means that store data can be retrieve when needed.

Example of flash memory are:

  • CompactFlash  
  • Memory Stick
  • BIOS chip etc

Inconclusion the data should be stored in flash memory.

Learn more about flash memory here:brainly.com/question/6835146

7 0
2 years ago
Is the disk in the C: drive fixable or removable disk
katrin2010 [14]

Answer:

The disk is a removable disk.

8 0
3 years ago
Read 2 more answers
Cisco cyber security would classify this email?
Nookie1986 [14]

Cisco cyber security would classify this email as security threats.

<h3>How do Cisco cyber security classify email security threats?</h3>

They classify them as:

  • Malware Delivery via Spam.
  • Credential Theft
  • Business Email Compromise, etc.

Note that in the case above, Cisco cyber security would classify this email as security threats

Learn more about Cisco from

brainly.com/question/23388335

#SPJ12

8 0
2 years ago
Write the declaration statement for a two-dimensional array X of integers with five rows and five columns that accepts 25 intege
madreJ [45]

Answer:

int[ ][ ] X = new int[5][5];

It can also be declared and initialized this way:

  int[][] X = {

               {1,2,3,6,8},

               {4, 5, 6, 9},

               {7,5,6,8,9},

               {8,5,8,8,9},

               {10,2,6,8,11},

       };

Explanation:

Above is a declaration of a two-dimensional array that can hold 5*5=25 int values. A java program is given below:

public class JavaTwoD{

   public static void main(String args[ ]) {

       // creating the 5X5 array

       int[ ][ ] X = new int[5][5];

       // looping through the array to add elements

       for (int i = 0; i < X.length; i++) {

           for (int j = 0; j < X[i].length; j++) {

               X[i][j] = i * j;

           }

       }

5 0
3 years ago
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • What is the name of a robot astronaut created by NASA
    14·2 answers
  • Which files track internet usage and personal information when people visit websites?
    14·2 answers
  • Where is authorization management app on tablet?
    7·1 answer
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • What does cmyk stand for?
    5·2 answers
  • A new attack involves hacking into medical records and then offering these records for sale on the black market. A medical recor
    14·1 answer
  • 13. By adding built-in writable memory to its cartridge, Nintendo’s _________________ was the first console game that gamers cou
    9·1 answer
  • ASAP BRAINLIEST!!!
    6·1 answer
  • 14 Copy a picture of a crane on the next page. Do not trace them. Make a freehand sketch. (2) 2 Look at the placed where the Mar
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!