What is the logical abstrect base class for a class called CricketPlayer?
A logical abstract base class for a class called CricketPlayer could be Batsman class or Bowlerclass.
It coverts your source code into machine code so the computer can execute it.
Determine the number of clock cycle that it take to process 200 task in a 6 segment pipeline?
Assuming that the pipeline is empty before these 200 instructions and that no branches or other events that necessitate a pipeline flush happen during these 200 instructions, 6 clock cycles to fill the pipeline then 200 clock cycles (total 206 clock cycles). For any branches or other events that necessitate a pipeline flush add another 6 clock cycles to refill the pipeline (if only part of the pipeline flushed this will take fewer clock cycles).
How do you add comments in batch files?
Anytime you wish to create any type of remark in a batch file rem must be added in front of the line. Remarks are often used to skip a line in the batch file or make comments.
What are the advantages and disadvantages of searching in C programming?
If the data is sorted and every element is directly accessible, then you can perform binary search (see built-in function bsearch), otherwise you have to do linear search (which is slower).
What is a macro enabled document?
http://office.microsoft.com/en-us/help/HA100310711033.aspx Macros automate frequently-used tasks; many are created with VBA (Visual Basic for Applications (VBA): A macro-language version of Microsoft Visual Basic that is used to program Microsoft Windows-based applications and is included with several Microsoft programs.) and are written by software developers. However, some macros pose a potential security risk. A person with malicious intent can introduce a destructive macro, in a document or file, which can spread a virus (virus: A computer program or macro that "infects" computer files by inserting copies of itself into those files. When the infected file is loaded into memory, the virus can infect other files. Viruses often have harmful side effects.) on your computer.
How do you declare a stack in c?
# #include
# #include
#
# const int TPILA=5; // TPILA es el valor maximo de elementos
# // que puede tener nuestra pila
#
# class PILA{
# public:
# int mipila[TPILA]; // Crea mi PILA de tamano TPILA
# int apilados; // Numero de objetos en LA PILA
# void reset(); // Vacia LA PILA
# void push(int v); // Agrega Valores en el tope de la PILA
# int pop(); // Retorna y elimina el tope de la PILA
# };
#
# void PILA::reset() // Vacia la PILA
# {
# apilados=0;
# }
#
# //Se Agrega(PUSH) un valor en el tope de la pila
# void PILA::push(int v)
# {
# // Comprueba que haya espacio dentro de la pila
# // para poder agregar el nuevo valor
# if(apilados
# {
# mipila[apilados++]=v;
# }
# }
#
# // Se Elimina (POP) el ultimo valor de la pila
# // y retorna el nuevo tope
# int PILA::pop()
# {
# if(apilados>0)
# {
# cout<<"El valor del tope eliminado era: ";
# // Retorna el valor del tope que fue eliminado
# return(mipila[--apilados]);
# }
# else
# cout<<"No existen datos para eliminar. ERROR ";
# return (0);
# }
#
# main()
# {
# PILA stack;
# stack.reset();
# int opc, i, dato;
# char out;
# do
# {
# do
# {
# clrscr();
# cout<<"El siguiente programa simula el funcionamiento de"<
# cout<<"una pila y es capaz de apilar un max. de 5 Valores"< # cout<<"numericos enteros, para fines practicos\n\n"; # cout<<"Que operacion desea Realizar\n\n"; # cout<<"1.- Insertar un dato\n"; # cout<<"2.- Borrar un dato\n"; # cout<<"3.- Mostrar pila\n"; # cout<<"4.- Resetear Pila\n"; # cout<<"5.- Salir"; # cout<<"\n\n\nOpcion(1-5): "; # cin>>opc; # } # while(opc>5); # # switch(opc) # { # case(1): # if(stack.apilados # { # cout<<"dato?: "; # cin>>dato; # stack.push(dato); # } # else # cout<<"ERROR! PILA LLENA!"; # cout<<"\n\nSalir?? (S/N): "; cin>>out; # break; # case(2): # cout< # cout<<"\n\nSalir?? (S/N): "; cin>>out; # break; # case(3): # if(stack.apilados!=0) # { # cout<<"Los datos en la pila actualmente son: "< # for(i=0;i # { cout< # } # else # cout<<"No existen datos en la pila"< # cout<<"\n\nSalir?? (S/N): "; cin>>out; # break; # case(4): # stack.reset(); # cout<<"\n\nSalir?? (S/N): "; cin>>out; # break; # case(5): # out='s'; break; # default: # out='s'; break; # } # } # while(out=='n' out=='N'); # }
Who is the creator of number zero?
Actually the concept of zero and several other mathematical "discoveries" are already in the Vedas which are scriptures that date back to thousands and thousands of years ago.
What are the disadvantages of function in C?
In comparison to Strawberry Cheesecake, the main disadvantage of a function in C is that you can't eat it.
In comparison to a mature Brandy, the main disadvantage of a function in C is that you can neither smell nor drink it.
In comparison to functions in some, but not many, other programming languages, one limitation of functions in C is that they may not be nested: In C, a function definition cannot contain another function definition.
In comparison to some modern interpreted language, e.g. Python, one limitation of functions in C is that a function cannot generate another function.
What are the disadvantages of an ordinary queue?
A situation will arise when few elements are inserted & then deleting first few items.
Now, if we try to insert an item we get the message "Queue overflow".
i.e., even if memory is available, we can not access these memory locations
How do you use pow function in c?
Either you can use the pre defined function "pow" in the <math.h> header file OR you can make a user defined function to do the same operation.
1.Using the pre defined function in <math.h> :
The function is a of datatype double and accepts only values in double. So, prototype declaration is:
double pow(double x,double y);
Pass the values to the function and it'll return the value of xy. In the calling function it can be declared as:
double power=pow(x,y);
2.USER DEFINED FUNCTION:
double power(double x,int y);
int main()
{
double x,result;
int y;
cout<<"\nEnter the base: "<<;
cin>>x;
cout<<"\nEnter the exponential power: ";
cin>>y;
result=power(x,y);
cout<<"The result of x to the power y is: "<<result;
return 0;
}
double power(double x,int y)
{
for(int i=0;i<=y;i++)
{
x*=x;
}
return x;
}
Why do we overload a constructor?
We overload constructors to give options on how to initialize an object.
Public Person()
{
name=""
age=""
gender=""
}
...if you override
Public Person(String name, int age, String gender)
{
this.name=name
this.age=age
this.gender=gender
}
Now upon coding time, if you need to initialize it with parameters you have two choices:
Now if you ask me what's the use?
well, since you are creating a class, you are encapsulating. you want as much to limit the use of your internal properties.
e.g.
private name
private birthyear
public Person(String name, Int age)
{
this.name=name
this.birthyear= yearNow-age
}
public Person(String name, Int birthdate)
{
this.name=name
this.birthdate=birthdate
}
You make sure that everytime a Person() is initialized, birthday property has a value either from age or birthdate.
I know the example is absurd but there are lots of complex example for this, I do overloading of constructors most of the time. from creating connection objects, to creating business process objects, since they differ in their needs.
Problem that often occur is code duplication. It's up to you to make a way to minimize/avoid duplication of code. usually I do this
public Person(String name, Int age)
{
Person(name, yearNow-age)
}
public Person(String name, Int birthyear)
{
this.name=name
this.birthyear=birthyear
Person();
}
Hope this gives an idea.
What is the Advantages of bresenham's circle drawing algorithm?
Let (xc,yc) be the centre of the circle
Let r be the radius of the circle
Let d be 3-2*r (d for decision)
Let x be 0
Let y be r
Repeat while x is less than y:
Increment x
If d is less than zero
Let d be d + ( 4 * x ) + 6
Else
Decrement y
Let d be d + (( x - y ) * 4 ) + 10
End if
Plot 8 points:
( xc+x, yc+y )
( xc-x, yc+y )
( xc+x, yc-y )
( xc-x, yc-y )
( xc+y, yc+x )
( xc-y, yc+x )
( xc+y, yc-x )
( xc-y, yc-x )
End repeat
Which programming language should you use?
Depends on what you are trying to program! Games, web applications, mobile phone apps may use different languages. I'm not sure which ones use which as of 11-2009 but you need to determine that first!
Can pointer be assigned a value?
A pointer is a variable just like any other, so of course it can be assigned a value. However, being a pointer, the value must be a memory address. If you want to assign a value to that memory address rather than the pointer, you must dereference the pointer.
A Boolean is a variable that can hold the value true or false. In most implementations, true is the all-ones bit pattern while false is the all-zeroes bit pattern. As a signed integer in twos-complement notation these patters represent -1 and 0 respectively. However, numeric values can and often do implicitly convert to a Boolean such that non-zero values are always true while zero is always false. For typical container objects (including strings), an empty container implicitly converts to false while a non-empty container implicitly converts to true.
What are the political functions of a language?
When a Language is well developed then If any political party arises between that language people then the political group will be a linguistic group. The political group will support the customs followed the language speakers. thus they become supporters of the particular group people thus the gain popularity. Language influences the activities of the political group.. I mean the Literature plays a key role as the people follow the practices mentioned in their literature. If you arent satisfyied I'm sorry. Have a good day!!
Because in order for high-level programming to work the manufacturer has to make documentation and the resources available for different types of peripherals. And seeing that device drivers as far as what I've been told in Windows has been traditionally been written in assembly, it makes interfaces for high-level languages close to impossible unless if you can obtain support for it via the operating system (Windows spooling service or CUPS in *nix and OS X)
Write a program in 8086 assembly language that copies a string to another location in the memory?
; program for moving a string from one block of memory
;to another block of memory
data segment
str1 db 'suriya',0
str2 db 20 dup(0)
data ends
code segment
assume cs:code,ds:data,es:data
start: mov ax,data
mov ds,ax
mov es,ax
mov cx,6
lea si,str1
lea di,str2
cld
rep movsb
int 3h
code ends
end start
What is the difference of non void and void function?
If a method call is void, that means it will not return a data value to a program that calls it. Otherwise, the method is expected to return a data value of some sort.
For example, if I have a method called print() that is void, and the body of the method has a command to print a word to the screen, the method will run that command and end.
However, if I have a method called add(int x, int y) that takes two numbers and adds them together, the program calling this method wants an answer back. So this method is not void.
RAM stands for Random Access Memory, and is the thinking space for a computer. Note that it doesn't acctually do anything by itself, it is merely a short term memory for the CPU.
(Do you know how to use Google?)