menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
write the header file (.h file) of a class acc2 containing: a data member named sum of type int. a constructor accepting no parameters. a function named getsum that accepts no parameters and returns an
asked
Nov 2, 2023
30.4k
views
4
votes
write the header file (.h file) of a class acc2 containing: a data member named sum of type int. a constructor accepting no parameters. a function named getsum that accepts no parameters and returns an int.
Computers and Technology
high-school
Wyatt Barnett
asked
by
Wyatt Barnett
8.1k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
5
votes
// acc2.h
// c++ class header for acc2
class acc2
{
public:
// getsum()
int getsum()
{
return sum_;
}
// Default constructor
acc2()
{
sum_ = 0;
}
private:
int sum_;
}
SuperM
answered
Nov 8, 2023
by
SuperM
8.6k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Sep 18, 2020
117k
views
Write a full class definition for a class named Acc2, and containing the following members: A data member named sum of type integer. A constructor that accepts no parameters. The constructor initializes
Komal Bansal
asked
Sep 18, 2020
by
Komal Bansal
7.7k
points
Computers and Technology
college
2
answers
5
votes
117k
views
asked
Apr 7, 2024
230k
views
Which of the following function prototypes is illegal? A. int getSum(int y, int z, int*); B. int getSum(int[ ], int y, *k); C. int getSum(int z, int k = 4); D. int getSum(int[10]);
Manjesh V
asked
Apr 7, 2024
by
Manjesh V
8.1k
points
Computers and Technology
high-school
1
answer
2
votes
230k
views
asked
Dec 25, 2020
76.5k
views
Write a class definition of a class named 'Value' with the following: a constructor accepting a single integer parameter a constructor with no parameters a method 'setVal' that accepts a single parameter,
Aretha
asked
Dec 25, 2020
by
Aretha
8.6k
points
Computers and Technology
high-school
1
answer
2
votes
76.5k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Explain why binary codes are used to represent characters, numbers and symbols :)
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org