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
What specific record type is found in every zone and contains information that identifies the server primarily responsible for t
ValentinkaMS [17]

The SOA is the specific record type found in every zone and contains information that identifies the sever primarily responsible for the zone as well as some operational properties for the zone.

Explanation:

The Start of Authority Records (SOA) has the following information they are

Serial Number: This number is used to find when zonal information should be replicated.

Responsible person: The Email address of a person is responsible for managing the zone.

Refresh Interval: It specifies how often a secondary DNS server tries to renew its zone information.

Retry Interval: It specifies the amount of time a secondary server waits before retrying the zone information has failed.

Expires After: IT specifies the amount of time before a secondary server considers its zone data if it can't contact with the primary server.

Minimum TTL: It specifies the default TTL value for a zone data when a TTL is not supplied.

4 0
3 years ago
What is microsoft certification?
BabaBlast [244]
Microsoft certification is a series of programs that provide certification of competence in Microsoft products.
6 0
3 years ago
How has the use of computers impacted business
Svetlanka [38]
It has allowed for better organization, faster communication, and more advanced actions that people can't complete
3 0
3 years ago
Read 2 more answers
A list of the available non keyboard characters can be seen in windows by opening what utility
Leya [2.2K]
Character Map ... I hope This Helps
8 0
3 years ago
What are the features of G-mail <br><br>(Write in your own words)​
wlad13 [49]

Answer:

here is what I think!

Explanation:

G-mail is:

  1. secure
  2. easy to use
  3. fast
  4. can be used to sign in anywhere!<u>(including brainly)</u>
  5. you don't need to pay when creating one
  6. can help you in billing and buying apps and their paid product
  7. <em><u>you </u></em> can use it because <em>why no!</em>
  8. some websites need G-mail to be used

thats why you should use G-mail

tell me if you have an idea!

3 0
3 years ago
Read 2 more answers
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • All living organisms make up the (4 points)
    8·1 answer
  • (3 points) Write a program to process two large chunks of data (e.g., a large 3D array and an array of self-defined structures w
    11·2 answers
  • What type of ransomware was developed to block the user from accessing the computer and encrypts all the files on the user's dev
    5·2 answers
  • We will use linear interpolation in a C program to estimate the population of NJ between the years of the census, which takes pl
    10·1 answer
  • Write a method that determines the total number of chars in each string of an array.
    12·1 answer
  • Explain how SEO impacts the way you should interpret search engine results ???
    6·1 answer
  • How many comparisons will be done to find 8 in this list using a linear search?
    8·1 answer
  • KELLY Connect
    8·1 answer
  • Which option identifies the programming paradigm selected in thr following scenario? A student is writing a science fiction stor
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!