answer.
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
____ [38]
1 year ago
9

Write a class called Counter that represents a simple tally counter, which might be used to count people as they enter a room. T

he Counter class should contain a single integer as instance data, representing the count. Write a constructor to initialize the count to zero. Write a method called click that increments the count and another method called get Count that returns the current count. Include a method called reset that resets the counter to zero. Finally, create a driver class called CounterTest that creates two Counter objects and tests their methods.
Computers and Technology
1 answer:
Sonja [21]1 year ago
4 0

Answer:

Code is in java

Explanation:

Code is self explanatory, added come comments to explain more about the code.

public class CounterDriver {

   public static void main(String[] args){

       // Creating counter first object

       Counter counter1 = new Counter();

       //performing 2 clicks

       counter1.click();

       counter1.click();

       // displaying counter 1 click count

       System.out.println("Total Number of counter1 clicks :"+counter1.getCount());

       // resetting counter 1 click count

       counter1.reset();

       // again displaying click count which will be 0 after reset

       System.out.println("Total Number of counter1 clicks :"+counter1.getCount());

      // Same operation goes with counter 2  

       // the only difference is that it performs 3 clicks

       Counter counter2 = new Counter();

       counter2.click();

       counter2.click();

       counter2.click();

       System.out.println("Total Number of counter2 clicks :"+counter2.getCount());

       counter2.reset();

       System.out.println("Total Number of counter2 clicks :"+counter2.getCount());

   }

}

class Counter{

   int count;

// defining constructor which will initialize count variable to 0

   public Counter(){

       this.count=0;

   }

// adding click method to increment count whenever it's called

   public void click(){

       this.count++;

   }

// getCount method will return total count

   public int getCount(){

       return this.count;

   }

// reset method will set count to 0

   public void reset(){

       this.count = 0;

   }

}

You might be interested in
4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
Vikentia [17]

Answer:

Incremental model

Explanation:

Incremental model is the best modification in older version are feasible and can be easily managed.

Incremental model involves the technique of developing soft ware in which the product is designed implemented and tested in stages until the product is finished. The term finished here means the product as meet all its requirement.

This model entails development as well as maintenance.

7 0
1 year ago
When should a technician record a system's baseline data?
bija089 [108]

Baseline data is a record of all the system performance specifications when the system is operating as designed. A technician should record a system's baseline data On a new system after it is installed.


3 0
2 years ago
Which type of word processing programs enables us to include illustrations within the program?
bonufazy [111]

Answer:

C.  full featured

Explanation:

You need to make use of the full-featured version of the word processing programs to use the illustrations that are part of the program. And simple versions might not have that. By fully featured it means you need to have the license included or else you will be able to use it for a few days or a maximum of 3 months, and that is certainly not a good idea.

5 0
1 year ago
Select the examples that best demonstrate likely employers for Journalism and Broadcasting workers. Check all that apply.
Delicious77 [7]

Answer:

a radio station

a newspaper

a television network

Explanation:

4 0
1 year ago
Read 2 more answers
Determining the Services Running on a Network Alexander Rocco Corporation has multiple OSs running in its many branch offices. B
Sladkaya [172]

Answer: provided in the explanation section

Explanation:

 Network’s vulnerabilities:

           Vulnerability is a weak spot in your network that might be exploited by a security threat. Risks are the potential consequences and impacts of unaddressed vulnerabilities. In other words, failing to do Windows Updates on your Web server is vulnerability.

           Regularly scheduled network vulnerability scanning can help an organization identify weaknesses in their network security before the bad guys can mount an attack. The goal of running a vulnerability scanner or conducting an external vulnerability assessments is to identify devices on your network that are open to known vulnerabilities without actually compromising your systems.

           The overall objective of a Vulnerability Assessment is to scan, investigate, analyze and report on the level of risk associated with any security vulnerabilities discovered on the public, internet-facing devices and to provide your organization with appropriate mitigation strategies to address those discovered vulnerabilities.

         

Network topology issues:

Coverage Topology

           Coverage problem reflects how well an area is monitored or tracked. The coverage and connectivity problems in networks have received considerable attention in the research community in recent years

 

Geographic routing

           Geographic routing uses geographic and topological information of the network to achieve optimal routing schemes with high routing efficiency and low power consumption

Port Numbers

           Port Numbers While IP addresses determine the physical endpoints of a network connection, port numbers determine the logical endpoints of the connection. Port numbers are 16-bit integers with a useful range from 1 to 65535.

Port numbers are assigned by an organization called IANA and ports are allocated to various needs to avoid confusion.

Ports are classified into 3 main categories.

Well Known Ports (Port numbers 0 - 1023)

           In a client-server application, the server usually provides its service on a well-known port number. Well-known port numbers are a subset of the numbers which are assigned to applications. According to RFC1700 [5], well-known port numbers are managed by the Internet Assigned Numbers Authority (IANA). They used to be in the range from 1 to 255, but in 1992 the range was increased up to 1023.

Registered Ports (Port numbers1024 - 49151)

Such ports are used by programs run by users in the system.

           In addition to the well-known ports below 1024 there are more port numbers assigned to applications but are located anywhere from 1024 to 65535.

Private or Dynamic Ports (Port numbers 49152 - 65535)

           Private ports are not assigned for any specific purpose.

         

Discuss the concepts of well-known ports and give a brief description of the most commonly used ports: 20, 21, 23, 25, 53, and 110.

Commonly Used Port Numbers

The following port numbers are unofficial list of commonly used for linux/unix based servers.

         

20&21               TCP                FTP (File server protocol)

           FTP is one of the most commonly used file transfer protocols on the Internet and within private networks. An FTP server can easily be set up with little networking knowledge and provides the ability to easily relocate files from one system to another. FTP control is handled on TCP port 21 and its data transfer can use TCP port 20 as well as dynamic ports depending on the specific configuration.

23                   TCP/UDP          Telnet

           Telnet is the primary method used to manage network devices at the command level. Unlike SSH which provides a secure connection, Telnet does not, it simply provides a basic unsecured connection. Many lower level network devices support Telnet and not SSH as it required some additional processing. Caution should be used when connecting to a device using Telnet over a public network as the login credentials will be transmitted in the clear.

25                   TCP/UDP         SMTP   (for sending outgoing emails)

           SMTP is used for two primary functions, it is used to transfer mail (email) from source to destination between mail servers and it is used by end users to send email to a mail system.

53         TCP/UDP        DNS Server (Domain name service for DNS request)

           The DNS is used widely on the public internet and on private networks to translate domain names into IP addresses, typically for network routing. DNS is hieratical with main root servers that contain databases that list the managers of high level Top Level Domains (TLD) (such as .com). T

110             TCP                 POP3 (For receiving emails)

           POP version 3 is one of the two main protocols used to retrieve mail from a server. POP was designed to be very simple by allowing a client to retrieve the complete contents of a server mailbox and then deleting the contents from the server.

4 0
2 years ago
Other questions:
  • What permanent magnets of a motor are replaced with more powerful ones, what effect do you think this would have on motor rotati
    12·2 answers
  • In three to four sentences, describe why CEOs (the chief executive officers, that is, the leaders of large companies) make very
    9·1 answer
  • As you are planning your informative speech on the prevalence of Internet memes in pop culture and you wonder if your audience w
    14·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    11·1 answer
  • A program is divided into 3 blocks that are being compiled on 3 parallel computers. Each block takes an Exponential amount of ti
    6·1 answer
  • Quantum units of information deploy the properties of entanglement and ____ to offer exponentially greater computing power.
    9·1 answer
  • Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from mini
    6·1 answer
  • Write a program that takes a single integer input from the user and stores it in a variable. Your program should increase the va
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!