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
What type of hardware and software does Instagram use?
Vlad [161]

Answer:

Social networking platform and  WindowsandroidIOS

Explanation:

Social media mostly uses Social networking platform and  WindowsandroidIOS.

Hope this helps!

Feel free to ask if you have anymore questions!

5 0
3 years ago
Read 2 more answers
For the following 4-bit operation, assuming these register are ONLY 4-bits in size, which status flags are on after performing t
m_a_m_a [10]

Answer:

All flags are On ( c, z , N  )

Explanation:

Given data:

4-bit operation

Assuming 2's complement representation

<u>Determine status flags that are on after performing </u> 1010+0110

    1   1

    1  0   1  0

    0  1   1  0

  1  0 0 0 0

we will carry bit = 1 over

hence C = 1

given that: carry in = carry out there will be zero ( 0 ) overflow

hence V = 0

also Z = 1      

But the most significant bit is  N = 1

8 0
3 years ago
What type of computer is IBM 1401 ?<br><br>​
rjkz [21]

Answer:

The IBM 1401 is a variable-word length decimal computer that was announced by IBM on October 5, 1959.

7 0
2 years ago
In which of the following situations would you want to use a word processing template?
creativ13 [48]
<h2>Answer:</h2>

<u>The correct answer is A. </u><u>You need to write a letter to a company you’d like to work with, and have specific questions to ask.</u>

<h2>Explanation:</h2>

Applying for a job is a very formal type of document which contains all the required and necessary information about a person who wants to apply. So a letter is typed in Microsoft word format to keep the document aligned and beautiful. Word template can make it professional which otherwise becomes hard to apply for a job in the absence of quality editing.

5 0
3 years ago
Read 2 more answers
Please help me. i will mark you brailiest
Stolb23 [73]

Answer:

Simple, really

Explanation:

3Rd one is pretty easy, all you have to do is read closely.

3 0
2 years ago
Other questions:
  • What type of rain happens when cold air meets warm air
    14·1 answer
  • What software is typically used for larger systems?
    11·1 answer
  • How can i take out a random (double) number in between 5.0 to 15.0 in c++?
    7·1 answer
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast gpu and 1gb of memory onboa
    15·2 answers
  • Need 2.5 Code Practice Answers
    14·2 answers
  • How would you define media literacy?
    12·1 answer
  • What does the FixedUpdate loop do? Why do developers use it?
    14·1 answer
  • PLZ HELP I AM TIMED!!!!
    11·2 answers
  • Write a recursive, string-valued method, reverse, that accepts a string and returns a new string consisting of the original stri
    15·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!