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]
4 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]4 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
.Assume the following schedule for a set of three jobs, A, B, and C, with a single CPU. Assume that there is no i/o. --A runs fi
Fiesta28 [93]

Answer:

Check the explanation

Explanation:

Kindly check the attached images below to the see the step by step explanation to the question above.

7 0
4 years ago
In your organization, each department has a folder on a shared drive. Your boss frequently copies the folder to his local comput
podryga [215]

Put it in read any mode or zip it

Explanation:

5 0
4 years ago
For homework, we were given this photo and to figure out what it is. It is up close and labelled “ too close to tell” but I have
dalvyx [7]
I honestly have no idea on what this is... but im guessing its some sort of tool or food in somebodys mouth... probably isn't but oh well..
7 0
3 years ago
How might the design be changed so that additional copies of print statements would not be needed?
bogdanovich [222]

A design be altered so that additional copies of print statements would not be needed by changing the format spring.

<h3>What is the aim of a print statement?</h3>

The PRINT statement is known to be often sent data so that it is taken to the display terminal or to another kind of print unit.

Note that A design be altered so that additional copies of print statements would not be needed by changing the format spring.

Learn more about design from

brainly.com/question/1020696

#SPJ1

5 0
2 years ago
What can be written to perform a certain number of iterations or to iterate until a specific result is achieved?
OlgaM077 [116]

Answer:

The answer to this question is given below in the explanation section. However, the correct option is B. i.e a for loop.

Explanation:

The correct answer to this question is for-loop. Beause, in the for loop is written to perform a certain number of iterations or to iterate until a specific result is achieved.

for example, to calculate the average of 10 numbers, we use the for loop to iterate statements written in its body 10 times to calculate the average.

when the specific numbers of the iteration are reached it will get terminated.

for example

for (int i=0; i<=10; i++)

{

// perfrom average, code

}

this loop iterate 10 times or less, when it reached above the limit it gets stopped.

however, the other options are not correct, because an ordered data structure is like a list of order data, print function print something to the user or on screen. while an array is like a list of data of the same data type.

7 0
3 years ago
Other questions:
  • Given the following Area class, how would I call the calcAreaSquare method in AreaTest.java with square with side length of 6? p
    5·1 answer
  • ​When converting plain text to hexadecimal for use with ProDiscover, you need to place ____________ between each character's hex
    6·1 answer
  • Mario wants to make his document more accessible to those who do not have access to a Word application. He
    9·2 answers
  • A team is in the process of developing a motion picture. Currently, they are creating ideas for advertisements to make people in
    6·1 answer
  • ask user to input a string. (assume length of input string is 1) If the string is lower case, print its upper case If the string
    7·1 answer
  • Aisha designed a web site for her school FBLA club. Which item should Aisha consider for improved responsive design?
    6·2 answers
  • Mention how to install antivirus software in your computer, either by following the instructions given on installation CDs or we
    6·1 answer
  • Kerry is debugging a program. She identifies a line of code to begin execution and a line of code to end execution so that she i
    11·1 answer
  • Will this website ever get itself together to stop people from sending links?
    9·1 answer
  • A ________ implementation involves considerable modifications to the erp software
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!