Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (aravindg):

doubts on computer science

OpenStudy (aravindg):

@Opcode here :)

OpenStudy (opcode):

Ready :-).

OpenStudy (aravindg):

Consider the following program : #include<iostream.h> class data {int a; public: data( ) { a=0; { data(int x) { a=x; } void disp() { cout<<"value is"<<a<<endl; } }; vpod main( ) { data m,n(7); m.disp( ); n.disp( ); } a) what OOP feature do you observe in above program?? b)write the output for above program

OpenStudy (aravindg):

I would also like to know how the code works here

OpenStudy (aravindg):

2. class base { public:base( ) { cout<<"Base Class constructor\n"; } ~base( ) { cout<<"Base Class Destructor\n"; } }; class der:public base { Base b,b1; public: der( ) { cout<<"Derived Class Constructor\n"; } ~der( ) { cout<<"Derived class destructor\n"; } }; predict output and explain logic of code

OpenStudy (aravindg):

3. If the get pointer position at the beginning of file ,tellg( ) returns _______ is it 0 ?

OpenStudy (aravindg):

4. Tom recieved a carbon copy of printout .Name the printer

OpenStudy (aravindg):

5. Arrange in ascending order of storage capacity floppy disk,hard disk ,CD ,DVD,Pen drive i know HD>DVD>FLOPPY where to place pen drive ?

OpenStudy (aravindg):

6. explain L3 cache

OpenStudy (aravindg):

7.choose odd one out scanner ,light pen, track ball , mouse

OpenStudy (aravindg):

scanner?

OpenStudy (aravindg):

8. distinguish between the foll: a) distance t1=distance(10,20); b)distance t1(10,20)

OpenStudy (aravindg):

9) class test { int a,b; public: test( ) { a=10; b=5; } }; define and implement copy constructor for above class

OpenStudy (aravindg):

10) find @Opcode and operand in foll instructions a) MVI A,06 b) ADD A,B c)LDA 2000H d)SUB B I think a) opcode =MVI operands A and 06 b)opcode=ADD operands A and B C)i have doubt d) opcode =sub operand=B

OpenStudy (opcode):

If the get pointer position at the beginning of file ,tellg( ) returns _______ Returns your current pointer position. Tom recieved a carbon copy of printout .Name the printer Impact Printers/ Dot matrix printers. Arrange in ascending order of storage capacity Floppy disk, hard disk, CD, DVD, Pen drive. Hard disks = Most storage capacity. Pen drive = up to 256 gigabytes DVD = 17.08 GB (double-sided, double-layer) CD = 700Mb Floppy disks = I don't know the size but I know it's the smalles. Explain L3 cache: http://www.wisegeek.com/what-is-l3-cache.htm Choose odd one out: scanner ,light pen, track ball , mouse Scanner, because the rest are pointer devices.

OpenStudy (aravindg):

so pen drive >DVD ?

OpenStudy (opcode):

Yes.

OpenStudy (aravindg):

10. what will be order of constructor invocation for foll code? explain class A { ..... }; class B { ...... } class C { int val; A obj1; B obj2; ....... }; void main( ) { A a1; B b1; C c1; }

OpenStudy (aravindg):

why current position isnt it beginning position ?

OpenStudy (aravindg):

11.constructors can be inherited .say true or false with reason .

OpenStudy (aravindg):

12. Is it required to read data from a file and update it simultaneously ? which stream can serve this purpose ? answer to second part is input strean i suppose

OpenStudy (aravindg):

*input stream

OpenStudy (opcode):

Constructors can be inherited. True or false explain your reasoning. False 100% sure. Constructors are not inherited. If they were, that would cause many problems anyway. They're instead called implicitly or explicitly by the child constructor. A) Is it required to read data from a file and update it simultaneously ? B) Which stream can serve this purpose ? Answer to question A is yes. I think the answer to "B" is "fstream" Boop ^.^ http://www.cplusplus.com/reference/fstream/fstream/

OpenStudy (aravindg):

lol thanks i am looking forward to the answers based on the code :P

OpenStudy (aravindg):

Constructors are not inherited. If they were, that would cause many problems anyway. i need to reason so i cant just say many ways

OpenStudy (opcode):

Number nine [9]: ``` //Regular code: class test { int a,b; public: test( ) { a=10; b=5; } }; //Copy constructor code: class test { int a,b; public: test() {a = 10}; //default constructor abc(abc &5) {this.a=5.a) //copy constructor } }; ``` Number ten [10]: What will be order of constructor invocation for the following code? Explain. ``` class A { ..... }; class B { ...... } class C { int val; A obj1; B obj2; ....... }; void main( ) { A a1; B b1; C c1; } ``` Order: Class A's Constructor Class B's Constructor Class C's Constructor Class C's Constructor Class B's Constructor Class A's Constructor I really think is messed that up >.<

OpenStudy (opcode):

Number ten [10] Find Opcode and operand in following instructions. ``` A) MVI A,06 B) ADD A,B C) LDA 2000H D) SUB B ``` I think A) Opcode = MVI operands A and 06 (Agree) B) Opcode = ADD operands A and B (Agree) C) Get the contents of memory location 2000H into accumulator. Maybe: (Opcode = LDA Operands 2000 and H.) Not so sure :/ D) Opcode = 'sub' operand = B (Agreed)

OpenStudy (koikkara):

programms.....ohh my god....ruuun...

OpenStudy (aravindg):

@Opcode for first code i think output is 07

OpenStudy (aravindg):

nah its : value is0 value is7

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!