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
postnew [5]
3 years ago
9

Write a full class definition for a class named Counter, and containing the following members:________

Computers and Technology
1 answer:
kipiarov [429]3 years ago
3 0

Answer:

The class definition for above problem in java is as follows:-

Explanation:

class Counter // class counter

{

  int counter; // variable counter

  Counter(int v) // construtor

  {

      counter=v;

  }

  void increment() //increment function

  {

      counter=counter+1;

  }

  void decrement() //decrement function

  {

      counter=counter-1;

  }

  int getValue() //getvalue function

  {

      return counter;

  }

}

Code Explanation:

  • The above class definition is in java language.
  • In this code, the name of the class is a Counter and it holds the three functions (increment, decrement and getvalue) and one constructor which is mentioned in the question.
  • To call the above class and their function firstly the user needs to create an object of the counter class in the main function by passing the one integer value on it.
  • The object declaration statement calls the constructor.
  • And then any function can be called by the object of the class with the help of the dot operator.
You might be interested in
A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption
Charra [1.4K]

Answer: Yes

Explanation:

Public key encryption is the encryption technique that is used for private keys and public keys for securing the system.Public key is used for encryption and private key is for decryption.Public keys can only open content of the system

  • According to the question, public key encryption is secure for coffee shop customer payment process as they are stored on digital certificates in long form for verifying digital signature and encrypting information.Its computation is difficult to crack through power computer access.  
  • Other options is incorrect as encryption is not a problem for payment procedures. Thus, the correct option is yes ,public key encryption is secure method for coffee shop customers .
8 0
3 years ago
g You and your friend both send documents to the printer, but the printer can only print one document at a time. What does it do
Sedbober [7]

Answer:

It places the document in a buffer

Explanation:

Since the printer can only print a document at a time, the other document is going to be placed in a buffer.

The print buffer can be described as a location in memory that has the function of holding data that is going to be sent to a computers printer. A print job such as in this scenario may remain in the buffer because another document is to be printed first.

Sometimes a document could be put in the buffer because the computer is waiting for the printer to respond. This is just another reason why documents are placed in a buffer.

5 0
3 years ago
2. Research, find and use a better (different from the simple Shift Cipher) encryption technique to encrypt a string of your cho
Kruka [31]

Answer:

There are two better techniques for encryption as compared to shift cipher. One is block cipher. Such techniques use one key for both encryption and decryption. For example Advanced Encryption Standard (AES). This is based on symmetric key encryption.

The other way is to use asymmetric key encryption technique which based on two keys i.e. public and private key for encryption and decryption. For example, Rivest-Shamir-Adleman (RSA).

Explanation:

What is AES?

Advanced Encryption Standard (AES) is a symmetric key block cipher  which uses 128, 192 or 256-bit keys  length to encrypt and decrypt a block of plain text or message. It is stronger and faster than Shift Cipher encryption technique. It can encrypt data blocks of 128 bit using the above mentioned bit key lengths. The greater then key length the greater the security. the number of rounds in AES is variable and depends on the length of the key. The length of these keys determines the number of rounds for example 128 bit keys has 10 rounds, 12 rounds for 192 bit keys and 14 rounds for 256 bit keys. Each rounds involves some processing. This process is explained below:

How AES works?

The data is divided into each of size 128 bits makes a matrix of 4x4 columns of 16 bytes. (bytes because AES takes 128 bit plain text block as 16 bytes)

Substitution: First the data is substituted using a fixed substitution table which is predetermined. This makes a matrix of rows and columns.

Shifting: Each rows of the matrix is shifted to the left and the dropped entries in row are inserted on the right. Shift is carried out as follows −  

Mixing columns: Use a mathematical method/equation to transform the columns where the input of the method is each column of data which is then replaced by this function into a different new matrix of data(bytes). This is basically the first round to transform plain text to cipher text. Now consider these bytes as 128 bits, the first round key is added to these resultant column bits by XOR. A separate portion of the encryption key length is used to perform the transformation on each column. The number of rounds depend on the the key length.

After the first round key comes the second round key and so on and when the last round key is added then this whole process goes back to Substitution phase, then shifting rows phase, then mixing columns and another round key is added after this. For example, if 128 bit key is used this means there will be nine such rounds.

Advantages

AES supports large key sizes which makes it more secure and stronger than shift cipher encryption techniques which can be cracked because of their small key space. If someone wants to decrypt a message and knows it's encrypted by a Shift Cipher technique then the key space of all possible keys is only the size of the alphabet. This is a very small scale.  An attack such brute force attack attempting all 26 keys or even using exhaustive technique will easily crack this. So AES having large key size is more robust against cracking. For example in AES in order to crack an encryption for 128 bit around 2128 attempts are needed. Also for a 256 bit key, 2256 different combinations attempts are needed to ensure the right one is included which makes it harder to crack and makes is more secure.

I have used an internet solver to encrypt a string and i am attaching the result of the encryption. The plain text is: Two One Nine Two

The key is Thats my Kung Fu

and the cipher text in hexadecimal after using AES is:

29 c3 50 5f 57 14 20 f6 40 22 99 b3 1a 02 d7 3a

8 0
3 years ago
Janet has to create a web page for a software company that should be accessible from both desktop computers and mobile devices.
kenny6666 [7]

create a responsive website which adapts to every screen/devices. Answer is B.

3 0
2 years ago
Read 2 more answers
Derek has an interest in designing video games. What requirements should he fulfill to be a game designer? To be a game designer
4vir4ik [10]

Answer:

2. Marketing, communication or advertising

Explanation:

5 0
3 years ago
Other questions:
  • Walking paths across the part is represented by the equation why equals -4x - 6​
    9·1 answer
  • AirPods se están despintando al ponerlos en quitaesmalte ayudaaaa?
    6·1 answer
  • for which is a chart legend used? a.all of the time b.whenever you are comparing data that is the same c.whenever you are compar
    9·2 answers
  • Adult learners understand a topic best by doing it. It gives them both new skills and confidence in their ability to carryout th
    6·1 answer
  • What is the name of the most expensive car and how much is it and what are its features
    15·1 answer
  • In the __________ Standard, chemical manufacturers, importers, and distributors are required to provide hazard information by wa
    10·1 answer
  • Which of the following would be useful to understand if you wanted to build a web page
    15·1 answer
  • Why can’t I message people? It doesn’t let me, please help.
    12·2 answers
  • Group of programs are software <br>​
    11·1 answer
  • Kinda strange, and im good
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!