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
alukav5142 [94]
3 years ago
14

c++ design a class named myinteger which models integers. interesting properties of the value can be determined. include these m

embers: a int data field named value that represents the integer's value. a constructor that creates a myinteger object with a specified int value. a constant getter that returns the value
Computers and Technology
1 answer:
klemol [59]3 years ago
4 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. class myinteger {
  4.    
  5.    private:
  6.        int value;
  7.        
  8.    public:
  9.        myinteger(int x){
  10.            value = x;
  11.        }
  12.        
  13.       int getValue(){
  14.           return value;
  15.       }
  16.        
  17. };
  18. int main()
  19. {
  20.    myinteger obj(4);
  21.    cout<< obj.getValue();
  22.    return 0;
  23. }

Explanation:

Firstly, we use class keyword to create a class named myinteger (Line 5). Define a private scope data field named value in integer type (Line 7 - 8).

Next, we proceed to define a constructor (Line 11 - 13) and a getter method for value (Line 15 -17) in public scope. The constructor will accept one input x and set it to data field, x. The getter method will return the data field x whenever it is called.

We test our class by creating an object from the class (Line 23) by passing a number of 4 as argument. And when we use the object to call the getValue method, 4 will be printed as output.

You might be interested in
Unscramble thr words <br>1.Nsieg Wiev<br>2.Seeathdat ievw​
valentinak56 [21]

Answer: genis view       headset view

Explanation:

6 0
2 years ago
Read 2 more answers
The application layer in the tcp/ip protocol suite is usually considered to be the combination of ________ layers in the osi mod
navik [9.2K]
Application Presentation and Session Layers.
8 0
3 years ago
SHORT ANSWERS:
dem82 [27]

Answer:

Hard drive Microsoft have the highest priority actions

7 0
3 years ago
Which of the following savings vehicles usually requires a high minimum balance
GuDViN [60]
A Savings Vehicle is an effective way to hold your savings. It could be a savings account. But some requires a high minimum balance such as Certificate of Deposit (CD). It is generally issued by commercial banks.  It is a time deposit too and restricts you from withdrawing funds.
7 0
3 years ago
A customer uses an app to order pizza for delivery. Which component includes aspects of the customer's interaction with an enter
MissTica

The available options are:

Understand the customer journey

Identify customer requirements based on their behavior and interactions

Provide a steady stream of marketing-qualified leads to the sales team

Help curate the right kind of content for customers

Provide feedback to the operations team regarding product quality

Answer:

Identify customer requirements based on their behavior and interactions

Explanation:

The component that includes aspects of the customer's interaction with an enterprise platform is "Identify customer requirements based on their behavior and interactions."

The above statement is true because when a customer uses an app to order pizza for delivery, the app can identify the customer's requirements based on the interaction between the customer and the app.

The customer uses the app to ask for what he wants, which is the requirements based on his behavior; the app identifies these wants and acts accordingly. This also shows interactions between the app and the customer.

8 0
2 years ago
Other questions:
  • 3. Discuss the disadvantages of file-based systems.
    13·1 answer
  • To insert a clip art you must do the following
    14·1 answer
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • What is one way to improve the upward flow of information?
    12·1 answer
  • What is the output of 1101 x 10 == 11000 + 10?
    12·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • Define a function print_feet_inch_short(), with parameters num_feet and num_inches, that prints using ' and " shorthand. End wit
    6·2 answers
  • What is the minimum number of bits you would need to represent a number on a 0 to 10 scale
    15·1 answer
  • What technique is most commonly associated with the use of malicious flash drives by penetration testers
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!