Question

members of a class non-friends, non-members of a class All of the above be 13. Why do you want to usually make data members p
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 13- option F is correct. We make private data member for data integrity, data abstraction and information hiding but we can use them.

Answer-14- answer D is correct option. For a Copy constructor all these 3 lines fulfill criteria of copy constructor.

Answer -15: option C is correct. Abstract data types are the types which are used by programmer without knowing the implementation details.

Answer-16- option D is correct. This is called information hiding. Interface, testing and debugging, implementation are different. A,B,C wrong options.

Answer- 17- option B is correct. We use dynamic array when we don’t confirm the size of array if user want to increase size of array it will increase automatically.

Answer -18- option should be void output (ostream&outFile) it will accept either cout or a file stream object as its argument.

Add a comment
Answer #2
Write the implementation of class called IC. This class includes the following private data members: String variable that contains the name of the IC, e.g. AND gate, Register, MUX, etc. -Double variable that contains the price of the IC. - Integer variable that number of pins of the IC. Provide constructor function that enables an object of this class to be initialized when it is declared, set and get functions to all data members. Part2: Write a program which contains a class called DSD (Digital System Design). DSD is any digital design. The private data members of this class include the following: • String variable which contain the name of the System design. For this class you should provide the following public member functions: Provide a constructor function that enables an object of this class to be initialized when it is declared. . A dynamic array of objects from class IC which contains all ICs the design need. The size of this array can be determined by the constructor. . Also, provide a destructor that frees all dynamically allocated memory when the object is destroyed. AddIC: add an IC to the array of ICs to a specified location in this array (i.e. takes the IC object and the array index as parameters). • AvgPrice: returns the average price of all ICs in a System design. Print: to print the values of all data members in a System design. Expensive: returns the IC with the highest price in the System design. Write a program to test your classes' functionality.
source: C++
answered by: Rwann123 Alngawi
Add a comment
Know the answer?
Add Answer to:
members of a class non-friends, non-members of a class All of the above be 13. Why...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type...

    Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type int Name of type String Balance of type float Public members void Init) method to enter the values of data members void Show) method to display the values of data members void Deposit(int Amt) method to increase Balance by Amt void Withdraw(int Amt) method to reduce Balance by Amt (only if required balance exists in account) float RBalance() member function that returns the value...

  • please write the code in C++ 2 Base class File 3 Derived class PDF 3.1 Class...

    please write the code in C++ 2 Base class File 3 Derived class PDF 3.1 Class declaration • The class PDF inherits from File and is a non-abstract class 1. Hence objects of the class PDF can be instantiated. 2. To do so, we must override the pure virtual function clone) in the base class • The class declaration is given below. • The complete class declaration is given below, copy and paste it into your file. . It is...

  • please write in c++. 4 Derived class JPG 4.1 Class declaration • The class JPG inherits...

    please write in c++. 4 Derived class JPG 4.1 Class declaration • The class JPG inherits from File and is a non-abstract class. 1. Hence objects of the class JPG can be instantiated. 2. To do so, we must override the pure virtual function clone() in the base class. • The class declaration is given below. class JPG : public File { public: JPG(const std::string& n, int n, int w, const double rgb()) : File(...) { // ... } *JPG()...

  • *** C++ *** Create a class called Student that contains a first name ( string) and...

    *** C++ *** Create a class called Student that contains a first name ( string) and an student id number (type long).     1. Include a member function called get_data( ) to get data from the user for insertion into the object,     2. Also include a function called display_data( ) that displays the student data. Then write a complete program that uses the class to do some computation. Your main function, main( ), should create a Dynamic Array of...

  • 12. Consider C++ class. Which one of the following choices is NOT correct? A. Class instances...

    12. Consider C++ class. Which one of the following choices is NOT correct? A. Class instances can be static, stack dynamic, or heap dynamic. B. If static or stack dynamic, they are referenced directly with value variables. C. If stack dynamic, they are referenced through pointers. D. Stack dynamic instances of classes are always created by the elaboration of an object declaration. E. The lifetime of such a class instance ends when the end of the scope of its declaration...

  • Create an Item class, which is the abstract super class of all Items.           Item class...

    Create an Item class, which is the abstract super class of all Items.           Item class includes an attribute, description of type String for every item. [for eg. Book]                                                             A constructor to initialize its data member of Item class.               Override toString() method to return details about the Item class. Create the ExtraCharge interface with the following details.                       Declare a constant RATE with value 0.25   Declare a method called calculateExtraCharge(), which returns a double value. Create the...

  • JAVA HELP (ARRAYS) Assignment Create a class named Module4 containing the following data members and methods...

    JAVA HELP (ARRAYS) Assignment Create a class named Module4 containing the following data members and methods (note that all data members and methods are for objects unless specified as being for the entire class) 1) Data members: none 2) Methods a. A method named displayContents that accepts an array of type int and prints their values to the b. A method named cemoveNegatives that accepts an array of type int, copies all its non-negative the new array should be the...

  • You will write the following files: mystack.h - contains the class definition for the mystack class....

    You will write the following files: mystack.h - contains the class definition for the mystack class. mystack.cpp - contains the definitions for member functions of the mystack class. inpost.cpp - contains your convert() function. inpost.h - contains the function prototype for convert() so that the main() can call it. Each of the files (with the exception of inpost.h) is described in more detail below. All header files should contain header guards to prevent them from being included multiple times in...

  • Write a full class definition for a class named Player , and containing the following members: A data member name of t...

    Write a full class definition for a class named Player , and containing the following members: A data member name of type string . A data member score of type int . A member function called setName that accepts a parameter and assigns it to name . The function returns no value. A member function called setScore that accepts a parameter and assigns it to score . The function returns no value. A member function called getName that accepts no...

  • Language is C++ Basic principles and theory of structured programming in C++ by implementing the class:...

    Language is C++ Basic principles and theory of structured programming in C++ by implementing the class: Matrix Use these principles and theory to help build and manipulate instances of the class (objects), call member functions Matrix class implementation from the main function file and, in addition, the Matrix class must have its interface(Matrix.h) in a separate file from its implementation (Matrix.cpp). The code in the following files: matrix.h matrix.cpp matrixDriver.h Please use these file names exactly. Summary Create three files...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT