How do you implement calculator in lex and yacc?
Create lex.l
create yacc.y
Compile using following:
cc lex.yy.c yy.tab.c -ll -lm
How can you tell if a file on your computer is corrupt or a virus?
There is no way to eyeball a file and tell if it is a virus. Use a good antivirus program and let it do the work for you.
What programming language is JUnit tested for?
Junit programming language is used for JAVA text tests. It was developed in 2012 in Canada by Kent Beck, Erich Gamma, David Staff, and Michael Clark.
What group of programs that coordinate and control the resources of a computer system?
The operating system.
What are the similarities between writing code or programs and writing essays or research papers?
Planning - An essay, like any good program, must have good forethought. Without planning it might collapse down the road.
Implementation - A program is crafted out of the same thing as an essay - language. The only difference is that one is meant to be read by humans and the other by computers.
Execution - Reading an essay is much like how a computer program is executed. It goes from the very start of the program at the first expression and proceeds until it finishes.
Problem Solving - The entire reason for writing an essay usually is too deal with a particular problem, but not always. The author in writing the essay must take their time making sure they are writing a solution to the problem as does a coder when they are writing a program.
There are problem a late more similarities. These are the ones that are obvious and, to me, kind of interesting.
What is the standard file header for an executable file?
There is no such standard since different architectures support different executable formats while some support multiple formats. For instance, Windows 32-bit supports MZ (DOS) and PE format, while 64-bit also supports PE32+, all of which have an EXE file extension. Windows also supports the older COM (DOS) format. But, as with most file extensions, the extension is simply a method of organising files by type and for associating file types to specific applications, but they tell you nothing about the file itself. Only by physically loading the file and examining its header (if it has one) can the operating system determine its actual type. In other words, renaming a COM file to an EXE file doesn't actually change the file type; it has to be completely recompiled from source.
The Apple Mac doesn't use extensions in the same way Windows does (many Mac files have no extension at all), but machine code executables are in the Preferred Executable Format (PEF), also known as Code Fragment Manager (CFM) files.
Linux (and Unix) typically use the Executable and Link Format (ELF).
Although each format obviously has its own standard header, there is no standard header that applies to all executables across all architectures.
In computing, AppData is an abbreviation of Application Data.
How do I write a program that lets me convert text to Morse code on Turbo Pascal 7.0?
There may be a more efficient method (I know very little about Morse code) but since there are only 26 letters you could use a giant if-else if statement.
Calculus is used primarily to hack into signals, your basic FFT analyzers which incorporate power series, etc .... if you use math to construct signals than the reverse can be applied. Thus integration and Differentiation.
Is the B programming language a high or low level programming language?
The B programming language is a high-levelprogramming language.
What are the different issues if a string is implemented as a primitive or as a character array?
Even in languages where string is a type, it is still an array of characters. A computer can not represent a string as a primitive type.
That said, the difference between using the programming language string object or an array or list if characters will differ based on language. Though in most languages which offer a string type, it would mean that you'd have to implement all the functions provided for you by the type on your own. A string object class simply provides a series of utility functions to manipulate a character array within.
What type of rom it is sim card?
A SIM card (subscriber identity module) is similar to an EPROM (erasable-programmable ROM), with anywhere between 8 KB to 256 KB of storage capacity.
Write a program in c language that inputs 2 number and solve using euclidean algorithm?
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,max,min,r;
printf("Enter the values of a,b");
scanf("%d%d",&a,&b);
if(a>b)
{
max=a;
min=b;
}
else
{
max=b;
min=a;
}
while((max%min)!=0)
{
r=max%min;
if(r==0)
{
break;
}
max=min;
min=r;
}
printf("GCD=%d",min);
getch();
}
What are four Boolean operators?
Depends on the computer language, the Boolean operators may have different looks, but all the basic ones should be in place:
There are 3 main types:
- Straight Through
- Cross-over
- Rollover (less common)
and i guess maybe Fiber, because your question was so vague.
In process switching the CPU is required to be personally involve with every forwarding decision. Process switching is similar to doing long math versus doing it the quick way.
What is the difference between destructors and delete?
Delete is a built-in operator used forcibly release a dynamically allocated resource. Delete can only be used on pointer types, including pointer arrays.
A destructor is a class method used to clean up any resources acquired by objects of the class. Destructors are invoked automatically from the most-derived class to the least-derived class, as soon as an object falls from scope.
When you delete a pointer to an object, the object's destructor sequence is invoked. Note that you must not delete named objects otherwise you end up with a null reference. References must never be null.
What are some examples of palindrome programs using letters and numbers?
When working with letters we must work with strings (character arrays). To determine if a string is a palindrome we use two pointers, one for each end of the string. So long as the characters pointed to are the same, we advance the pointers one character inwards. If the characters pointed at differ, the string is not a palindrome and we can stop checking. When the pointers meet or pass each other, the string must be a palindrome so we can stop checking.
Note that the string must be composed entirely of letters of the same case (typically lower-case). All punctuation and word-spacing must also be removed since we're only interested in the letters. We achieve this by copying the string and manipulating the copy, leaving the original string intact.
When working with integers, we simply reverse the digits and test to see if it is equal to the original integer. We achieve this by repeatedly dividing the integer by 10 and taking the remainder to extract each digit:
Algorithm: reverse_integer
Input: a positive integer, n
Output: the integer reversed
r = 0
repeat while n > 0
m = n % 10 // % = modulo (remainder after division by 10)
r = r * 10 + m
n = n / 10
end repeat
return r
A less efficient method is to convert the number to a string and then test the string.
A real number is a palindrome when there are as many digits before the decimal point as there are after it, and the integer component is the reverse of the fractional component. We can test this by taking the integer component and reversing it using the algorithm above. We then convert back to a real number and divide by 10 until the number is less than 1. We than add on the original integer component and compare with the original real number. If they are equal, the real number is a palindrome.
What is the data type of a file?
Files don't have a data type. Functions, classes, enumerations and variables are all examples of data types. We may use a stream to represent a file, but a stream is no more a file than a file is a stream. A stream is merely an abstraction that can be used to represent any device that requires buffered input and/or output of character sequences.
How is the field of computer programming always changing?
Because there are always new (and old!) problems to be solved and the current programming languages cannot possibly solve them all. They must adapt and evolve to meet the demands of new technologies, concepts and methodologies.