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
seraphim [82]
4 years ago
6

My programming lab 9.2 C++ Write a full class definition for a class named Counter, and containing the following members:_______

.
A) A data member counter of type int.
B) A constructor that takes one int argument and assigns its value to counter
C) A function called increment that accepts no parameters and returns no value.
D) Increment adds one to the counter data member.
E) A function called decrement that accepts no parameters and returns no value.
F) Decrement subtracts one from the counter data member.
G) A function called getValue that accepts no parameters.
H) It returns the value of the instance variable counter.
Computers and Technology
1 answer:
cupoosta [38]4 years ago
8 0

Answer:

class Counter {    

 public:

   int counter;

   Counter(int counter) {     // Constructor

     counter = counter;

   }

   void increment(){

      counter++;

  }

 

   void decrement(){

      counter--;

   }

    int getValue(){

       return counter;

   }

};

<h2><u>Explanation:</u></h2>

// Class header definition for Counter class

class Counter {    

// Write access modifiers for the properties(data members) and methods

 public:

  //a. Create data member counter of type int

   int counter;

   //b. Create a constructor that takes one int argument and assigns

   // its value to counter.

   Counter(int counter) {     // Constructor  with argument counter

    counter = counter;         // Assign the argument counter to the data

                                              // member counter

   }

   // c. Create a function increment that accepts no parameters

   // and returns no value (i.e void)

   void increment(){

      counter++;   // d. increment adds one to the counter data member

  }

 

   // e. Create a function decrement that accepts no parameters

   // and returns no value (i.e void)

   void decrement(){

      counter--;   // f. decrement subtracts one from the counter data member

   }

   // g. Create a function called getValue that accepts no parameters.

   // The return type is int, since the data member to be returned is of

   // type int.

    int getValue(){

       return counter; // h. it returns the value of the instance var counter

   }

}; // End of class declaration

Hope this helps!

You might be interested in
1⁰=?<br> Is equal to...........
Murrr4er [49]

Answer:

1

Explanation:

Anything to the 0th power is 1. However, 0⁰ is undefined.

5 0
4 years ago
Read 2 more answers
__________ is a strategy of using multiple types of technology that prevent the failure of one system from compromising the secu
Anastaziya [24]

Answer:

<u>Redundancy</u> is a strategy of using multiple types of technology that prevent the failure of one system from compromising the security of information.

Explanation:

Redundancy means having extra or duplicate resources available to support the main system. It is a backup or reserve system that can step in if the primary system fails. The reserve resources are redundant most of the time as they are not being used if everything is working properly.

8 0
3 years ago
Please help can’t get a bad grade!
SOVA2 [1]

Answer:

Algorithms are a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

Pseudo code is an informal description of an algorithm or how a program will function.

a. An example of an algorithm using coding terminology would be a function to find the largest or smallest number in a user-defined array.

b. A function that could include an algorithm would be a function that compares input.

c. Pseudo code could be used to outline a part of a program that has to carry out a specific function.

I hope that helped! If you have any questions I am glad to help.

5 0
3 years ago
What is an example of value created through the use of Deep Learning?
Leya [2.2K]

Answer:

B. reducing multi-language communication friction in a company through automatic language translation.

Explanation:

Deep learning is a branch of artifical intelligence whereby computer systems are programmed to operate in such a way they imitates tbe functioning of the human brain. Hence, emplyins network of neurons structures to learn, gain insight and make predictions. Using layers of network architectures, deep learning in predictive, including facial recognition, virtual assistants, language translation and many more. Deep learning is able to create value not by abrogating humans from the work fold but by enhancing and bridging the gap in areas which need the leverage of technology such as language translation as it enables individuals with different language prowee to be able to communicate through automatic translation.

5 0
3 years ago
What is the name for non-paid active links returned by an Internet search engine in the search results?
otez555 [7]

Answer:

organic links

Explanation:

7 0
3 years ago
Other questions:
  • Look at the following array definition:
    11·1 answer
  • . When you have multiple graphics positioned on a page, you can _______________ them so that they are a single graphic instead o
    9·1 answer
  • What is an implicit benefit to Monetary Policy?
    6·1 answer
  • Assume that play_list refers to a non-empty list, and that all its elements are integers. Write a statement that associates a ne
    7·1 answer
  • What information may be obtained from a ResultSetMetaData object?(TCOs 1–6) What information may be obtained from a ResultSetMet
    9·1 answer
  • TRY IT Choose the Right Technology MP3 player Widescreen laptop computer Smartphone Tablet computer with wireless Internet Suppo
    8·2 answers
  • ____ is the amount of effort (usually in hours) required to perform cryptanalysis on an encoded message so that it may be decryp
    8·1 answer
  • How to beat level 50 in give up robot 2
    5·1 answer
  • Sidney needs to create a decimal number variable that will be added to another number. What kind of variable is required?binaryB
    15·1 answer
  • state how to transfee information from website to el processing document in computers and technology.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!