Navigation
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» Perkhidmatan Kereta Sewa Shah Alam
Wed Sep 09, 2015 2:48 am by sksportcar

» Homestay Di Kota Bharu
Sun Jan 25, 2015 10:52 pm by sksportcar

» Kereta Sewa Shah Alam
Tue Aug 05, 2014 8:54 am by sksportcar

» Bahasa Jepun: Ayat Seharian,Hari,Haribulan & Nombor
Mon Sep 23, 2013 8:43 pm by foxfoxer

» Tips nak hapuskan virus secara manual [On updates]
Tue Mar 19, 2013 8:38 am by Optitech

» Teknik defense dari virus and spyware [Auto]
Thu Jul 21, 2011 2:53 am by Optitech

» Virus shortcut kat pendrive
Thu Jul 21, 2011 12:27 am by Optitech

» Admin Kembali dengan Menyengat
Wed Jul 20, 2011 1:59 pm by Optitech

» Xcode Magazine - Penulisan daripada hacker
Wed Jul 20, 2011 12:45 pm by Optitech


Example For the Test

View previous topic View next topic Go down

Example For the Test

Post  Optitech on Fri Jan 15, 2010 6:36 pm

1. Describe general form of class?


class name
{
private:
variable declaration;
...;
public:
function declaration;
...;
};



2. What purpose do classes serve?


1.data encapsulation
2.providing a convenient way of modeling real-world objects
3.simplifying code reuse



3. Describe how a to do a class declaration?


class name
{
variable declaration;
};


4. Describe protection level in C language?


1.C is a abstract language-based protection over more traditional protection mechanisms, such as standard virtual memory
protection hardware, software fault isolation, and capability systems.
2.State-of-the-art language-based protection is more flexible and as safe as these other mechanisms.
3. it's related on "access specifier" (protected, public & private)


5. Describe what is a inheritance?


Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class.




6. Describe what is a dynamic memory management?

The objective of the memory manager is generally to allow dynamic memory allocation. For example, in the C programming language, without use of a memory allocation library, memory can only be allocated statically and on the stack, while the use of a memory manager allows for dynamic allocation on the heap. A memory manager can also make allocation and reallocation more efficient, group allocated blocks according to particular conditions, and even collect statistics, and trace memory access violations.

7. Describe what is a polymorphism?

Polymorphism is the ability to redefine methods for derived classes. For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles.

8. Describe what is a function redefining?

Operator overloading allows existing C operators to be redefined so that they work on objects of user-defined classes. When we create function outside the class, redefined function will involve.


9. What happen when a constructor that specifies no arguments ?

The program still can run, but the constructor are doesnt have any function at all

Refer command bellow:
void Excel (trgl a),

* Argument can means "void". this command means Excel function can mean any value. Same like we are defined variable using variable "int", "char" & so on. Fail to declare this, can brings program failure. Which mean the compiler doesn't understand what type of data memory that the system handling with

.

* Argument also can means "trgl a". Which "a" is a marking technique in a programming. When we added command bellow:

sum = trgl trgl a;

The system will understood that, the value of "trgl" & "trgl a" is differ. Can mean that, value of "trgl" & "trgl a" is from 2 different object.



10. Why would you want to use inline functions?


To increase the speed of the resulting program and to save the code size, and also saving the coder time to coding


11. What a keyword that has to define in a class, if we want overload operator "=" in the program?

Iam still not understand the actual the question wantzz..i think there are no special keyword are use for the code,how about this?,
ClassName Object=Object1;


En Ismail: This question means command statement list for overloaded operator "=".
ThreeD operator = (ThreeD op2);
The keyword "operator =" means that, we want to overloaded operator "=".
(ThreeD op2);

"ThreeD" means it's referring to constructor "ThreeD" & op2 is an object.

12. What is a function of operator ":" to enable derived class to inherit base class?


A class is derived from a base class by inheritance. The derived class contains all the features of the base class, but may have new features added or redefine existing features. The "synonym" subclass is possibly confusing since the derived class can have a superset of the base class's features.

Credit to: [You must be registered and logged in to see this link.]

_________________
|----------------------------------------------------|




EXCUSE IS THE DUMBEST WAY TO ESCAPE

MAKLUMAN: Worksheet/Assignment Download Section hanya untuk pengguna berdaftar. Sila daftar untuk melakukan 'download'. Lepas dah click link, tekan kat perkataan "Skip Ad" bahagian atas belah kanan sekali. Pastu baru leh download.
Harap Maklum.

Optitech

Posts : 518
Join date : 2010-01-01
Age : 24
Location : ProxyFireZ

http://sembangseposen.blogspot.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum