What is the minimum number of bits would you need to represent 9 different values?
4.
How do you toggle case of string in c code. Example is TogGle will turn into tOGgLE?
#include<stdio.h> int main() { char str[100]; int i; printf("Please enter a string: "); // gets(str); // fgets is a better option over gets to read multiword string . fgets(str, 100, stdin); // Following can be added for extra precaution for '\n' character // if(str[length(str)-1] == '\n') str[strlen(str)-1]=NULL; for(i=0;str[i]!=NULL;i++) { if(str[i]>='A'&&str[i]<='Z') str[i]+=32; else if(str[i]>='a'&&str[i]<='z') str[i]-=32; } printf("String in toggle case is: %s",str); return 0; }
What is the name of the method used to schedule a thread for execution?
"start"
You've created a Thread object and it knows its target. Now it's time to get the whole thread thing running. It's pretty straight forward:
t.start();
Prior to calling start() on a Thread instance, the thread (when we use lowercase t, we're referring to the thread of execution rather than the Thread class) is said to be in the new state as we said. The new state means you have a Thread object but you don't yet have a true thread. So what happens after you call start()?
• A new thread of execution starts (with a new call stack).
• The thread moves from the new state to the runnable state.
• When the thread gets a chance to execute, its target run() method will run.
What does resolution oriented mean?
Resolution oriented means that the common goal is to resolve issues. It can also mean that rules are in the process of being made to rectify a certain situation.
Is FALSE about event-driven programs?
Event-driven programs are designed to respond to user or system events, such as mouse clicks or keyboard inputs. A common misconception is that they execute sequentially; in reality, event-driven programs can handle multiple events concurrently through event loops and callbacks. They also rely heavily on asynchronous processing, allowing them to remain responsive while waiting for events to occur. Therefore, it's false to say that event-driven programs execute in a strictly linear or blocking manner.
Programming committees are usually groups which come together to decide things about an application. This can include anything from release scheduling to budgets to requirements and specifications. These groups will usually contain one or more programmers, managers, customers, and marketing professionals.
How do you access a base class method from a derived class in Cpp?
Use the scope resolution operator (::) to explicitly call the base class method. Note that the base class method must be protected or public in order for a derived class to access it. Private members are only accessible to the class itself and to friends of the class, regardless of whether the derivative uses public, protected or private inheritance.
It is quite normal for a base class to provide a "default" implementation for a virtual method for which a derived class may override. Although the derived class will generally provide its own implementation of the method, it may also call the base class method either before, during or after performing its own implementation.
The following shows minimal class declarations demonstrating a call to a protected base class method from a derived class override.
class base
{
protected:
// accessible to all instances of this class, its friends and its derivatives.
virtual void method(){
/* do something */
}
};
class derived : public base
{
public:
// full-accessible outside of class.
virtual void method(){
/* do something (or do nothing) */
base::method(); // call base class method.
/* do something else (or do nothing) */
}
};
What are structured grammars and languages generated by a grammar?
Structured or formal grammars are a method of describing a computer language in another meta-language, that if the grammar. For example, you could use EBNF to describe the grammar for the language Pascal. The meta-language, the language in which the grammar is expressed, varies with the tools in use.
Structured grammars are typically used to implement programming languages, but are also commonly used to create parsers for meta-languages such as HTML or XML, for command oriented streams, or for complex protocols (such as HTTP).
This formal grammar definition acts as input to a parser generator. Parser generators are also compiler generators or compiler compilers, but these tools never generate a compiler. Instead, they generate lexical analyzers and parser tools, typically resulting in an abstract syntax tree (semantic node tree) in some form.
A lexical analyzer is the tool that digests the input in the final language (e.g. Pascal), and decides on each fragment (token) what it is: a keyword, a number, etc. The parser generator folds the stream of tokens into semantic nodes (an expression, a variable definition, etc).
At that point, the input (the Pascal program in this example) is known to be syntactically correct. The next stages include semantic analysis (does it make sense and what does it mean?), code generation and code optimization.
The most famous (and infamous) representative is the pair of lex and yacc. Lex generates a lexical analyzer, yacc (short for Yet Another Compiler Compiler) generates a parser. Lex and Yacc's more modern successors are Flex and Bison, other popular tools include ANTLR. Other tools are available.
What does acpi use to control the power management?
With ACPI the operating system controls power management.
What is declaration syntax of an array?
In what language?
c and c++
a 5 x 5 array of Int
int nMultiIntArray[5][5];
Answer:
in java
int array[][]=new int[5][5];
in vb
dim array(5,5) as Integer