Does price have fractional parts? If so go with a double. Otherwise use an int or long, depending on how large price is going to get.
What is Decbit algorithm for congestion avoidance?
In congestion avoidance, each router monitor the load it is explicitly notify the end node ,when the congestion is about to occur.This notification is implementing by setting a binary congestion bit in the packets that flow through the router, known as DECbit .The destination host then copies this congestion bit into the ACK it sends back to the source. Finally, source adjust its sending rate so as to avoid the congestion.
Is windows XP a procedural language or object oriented?
Windows XP is an operating system, not a programming language.
What are Weakness of using pointer in c plus plus?
The main weakness is that the onus is primarily upon the programmer to ensure pointers are not misused, that any memory allocated to a pointer is released as soon as that memory is no longer required, and that pointers are nullified when not in use. There is no automatic garbage collection other than when a thread terminates, at which point all consumed memory is returned back to the system, however its never a good idea to rely on this. Programs with a long life-cycle must be specifically written to clean up resources behind themselves as they go, but the same should apply to any program, regardless of how trivial. It costs nothing and failure to do so is not only lazy, the consequences could easily be dire. If the program were part of an autopilot system, for instance, the consequences wouldn't bear thinking about. For this reason alone, C++ programmers are actively encouraged to use references wherever possible (because they are much easier to use and they clean up after themselves automatically), and to only use pointers when it is absolutely necessary.
Its easy or hard computer science?
Computer Science courses involve studying and understanding the scientific and/or practical applications of computing. CS generally involves learning how to program so one can either write programs to accomplish specific goals or understand how computers operate so as to know how programs other people write operate.
Computer science is difficult. The amount of difficulty depends upon how much experience a person has had with computing and how much work one is willing to spend on the tricky task of troubleshooting: finding problems and their solutions.
Considering how prevalent and ubiquitous computers are becoming in society, computer sciences are becoming more complex. At the same time, every industry needs computer sciences, or the results of computer sciences. So long as you have the drive and perhaps love for computing, computer science is a worthy study.
1. false
2. true
3. false
4. true, but that statement can be a compound statement, ie a statement-block between {}
5. false
What is the assembly language program for 32 bit addition?
Example for System/360 CPU:
L R0,A
A R0,B
ST R0,SUM
...
A DS F
B DS F
SUM DS F
What is a C plus plus program to change 5x5 array to 1x25 array?
An array is simply a contiguous block of memory. The length of that memory is the product of all its dimensions multiplied by the size of its type. Thus a 5x5 array is exactly the same as a 1x25 array. The only difference is in how you refer to each element.
The following code demonstrates how we can remap a 5x5 array to a 1x25 array, simply by pointing at the first element. Note that we haven't actually changed the array, nor have we copied it to new memory. We're simply interpreting the exact same memory in two different ways.
#include<iostream>
#include<iomanip>
int main()
{
int x[5][5] = {
1, 2, 3, 4, 5,
6, 7, 8, 9, 10,
11, 12, 13, 14, 15,
16, 17, 18, 19, 20,
21, 22, 23, 24, 25
};
// treat as 5x5 array:
for (int a=0; a<5; ++a)
{
for (int b=0; b<5; ++b)
{
std::cout<<std::setw (3)<<x[a][b];
}
std::cout<<'\n';
}
std::cout<<std::endl;
// treat as one-dimensional array (remap)
int* y = x[0];
for (int c=0; c<25; ++c)
std::cout<<std::setw (3)<<y[c];
std::cout<<'\n'<<std::endl;
}
Output:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Can you write a program that implements cramers rule for 2x2 and 3x3 matrix?
Yes I can. I did it in QBasic about 15 years ago.
Explain the function of each part of the double housing planner?
PLANER MACHINE
Introduction: The planer is a machine tool designed to produce plane and flat surface on a workpiece which is too large or too heavy. The workpiece is securely fixed on a table called platen, and it reciprocates horizontally against a single edged cutting tool. The surface machined may be horizontal, vertical or at an angle.
Operations of planer machine: The planer is used for:
1. Planing flat horizontal, vertical and curved surfaces.
2. Planing at an angle and machining dovetails.
3. Planing slots and grooves.
The planer are available in different types for doing different types and sizes of job; the most common being the standard and double housing planer.
Construction: The main parts of the double Housing Planer machine is Bed and table, Housings, Cross rail, , Tool heads, Driving and feed mechanism.
Bed and table: The bed is a long heavy base and table made of cast iron. Its top surface is flat and machined accurately. The flat top surface has slots in which the workpiece can be securely clamped. The workpiece needs rigid fixing so that it does not shift out of its position. The standard clamping devices used on planer machine are: Heavy duty vice, T-holders and clamps, angle plate, planer jack, step blocks and stop. The table movement may be actuated by a variable speed drive through a rack and pinion arrangement, or a hydraulic system.
Housings: The housings are the rigid and upright column like castings. These are located near the centre on each side of the base.
Cross rail: The cross rail is a horizontal member supported on the machined ways of the upright columns. Guide ways are provided on vertical face of each column and that enables up and vertical movement of the cross rail. The vertical movement of the cross rail allows to accommodate workpiece of different heights. Since the cross rail is supported at both the ends, this type of planer machine is rigid in construction.
Tool heads: Generally two tool heads are mounted in the horizontal cross rail and one on each of the vertical housing. Tool heads may be swiveled so that angular cuts can be made.
Driving and feed mechanism: The tool heads may be fed either by hand or by power in crosswise or vertical direction. The motor drive is usually at one side of the planer near the centre and drive mechanism is located under the table.
The size of the planer is specified by the maximum length of the stroke, and also by the size of the largest rectangular solid that can be machined on it.
Algorithm to implement Multiple queue in single dimensional array?
algorithm on multiple queues in a single dimensional array
Algorithm of the addition of the two matrix?
I really don't understand you.....
How c recognize keywords or predefined functions?
Built-in types (int, char, double etc) are not defined in headers, because they are built-in types.
Header files contain data-definitions and function-prototypes (those may include compiler-specific informations, like __attribute__), but not function implementations. If you are interested in the source code of library functions like printf, you have to do some google search.
Can you get any software to convert .exe format to machine level language?
EXE is not a format it is a file extension. The formal format of an EXE file in Windows is the Program Executable (PE) format and, these days, will either be in the PE32 or PE32+ format, the latter denoting a 64-bit executable.
However, EXE files are already encoded in native machine code. No conversion is required. If you want to render the code in a human readable form, use a disassembler. If you want to look at the raw code, use a hex editor.
What is the definition of parent function?
When a function is nested inside another function, the outer one is the parent, the inner is the child.
Maximum value of an unsigned integer is how many bytes?
Type size of an unsigned integer is compiler specific. Most compilers will provide 4 bytes, but the size can range from 2 to 8, or (again) whatever the implementation provides.
Note:
1. Maximum value: UINT_MAX (in limits.h)
2. Size in bytes: sizeof (unsigned)
What is the value of d power in watts of a step function?
The unit step function is also known as the Dirac delta function.
It can be thought of as a function of the real line (x-axis) which is zero everywhere except at the origin (x=0) where the function is infinite in such a way that it's total integral is 1 - hence the use of the word 'unit'.
The function is not a strict function by definition in that any function with the properties as stated (0 everywhere except the origin which by definition has a limit tending to 0), must therefore also have an integral of 0.
The answer is therefore zero everywhere except at the origin where it is infinite.
Recursive program for a power b in c language?
int pow (int a, int b)
{
if (b==0) return 1;
else return a*pow(a,b-1);
}
Swap two numbers using call by value and call by reference?
You cannot swap two numbers using call by value, because the called function does not have access to the original copy of the numbers.
Swap with call by reference... This routine uses exclusive or swap without temporary variable.
void swap (int *a, int *b) {
*a ^= *b;
*b ^= *a;
*a ^= *b;
return;
}
What is the difference between a compiler and an interpreter.explain with examples?
The primary difference between them goes like this:
Perhaps the best real-world way to relate the difference is to picture yourself holding two different sets of instructions. One set is instructions on how to do a task. In this case, you're interpreting the instructions and doing the job yourself. The other set is instructions on how to build (compile) a machine to do the same task. Now you're compiling the instructions into a separate final object (the machine) that can now do the same job on its own. The pros and cons are evident here as well. As an interpreter, it's easy enough for you to alter the instructions so as to do something else. But once the machine is compiled, its function can't be changed. You'll need to alter the instructions and build a new machine.