Is qbasic a high level language?
The QBASIC program actually comes in 2 different flavors...
A> QBASIC interpreter program: QBASIC Version 1.1
B> QBASIC compiler program: QBASIC 4.5/or, QB64/or, -etc.
...so, the answer is that this programming language comes in both forms: 'interpreter/compiler' versions; and, you have to select which of these you would prefer to download and use.
*NOTE*: The compiler version of the language tends to be much larger; whereas, the interpreter version of the language tends to be small/very compact, indeed; thus, the interpreter tends to take up far less disk space.
Many people start off their programming career by using QBASIC version 1.1 'interpreter' program; in order to learn 'how to' program. The interpreter version of the program can only create plain text (.bas) files; the which code CANNOT be shared with others; (not unless the persons who you are sharing this type of code with do already have a copy of the QBASIC interpreter program installed on their own computer).
Then, later on, down the line...when they have become fully capable programmers themselves; they go and download a QBASIC 'compiler' program version, instead; which will allow them to go and create stand alone (.exe) program files that they can share with anybody. This is because (.exe) program files can RUN/execute entirely independently of the QBASIC program itself.
Code for first fit algorithm in C?
#include <stdio.h>
#include <conio.h> //function to print the bins:
void printBins(float bins [500] [500],int items )
{
for (int j=1;j<=items;j++)
{
for (int i=1;i<=items;i++)
{
printf(" %1.3f",bins[i][j]);
}
printf("\n");
}
} int main()
{
int items, x=1,c=1, i=0, j=1, countOfBins=1;
float z,sum=0 ,inputitems[500], bin[500][500]; printf("Enter the number of items:");
scanf("%d", &items); //scanning how many elements the user wants to enter
if (items<=0)
{
printf("Can't bin-pack on zero elements");
getch();
}
else
{
do{
printf("\nEnter item number %d: ",x);
scanf ("%f",&z); //scanning the elements the user inputs if ((z<0)(z>1)) //assuming my bins range from 0 to 1 only
{
printf ("\nitem number %d is not in range of 0 to 1",x);
goto stop;
}
else //if all the inputs were in the correct range
{
inputitems[x]=z; //save my elements in an array called inputitems
x++;
}
}while (x<=items); //end of do-while statement
//technique number 1:
printf ("\nIn Next Fit online technique:");
loop:
while (c<=items)
{
if (sum+inputitems[c]<=1) //to check if you have any more room to fit in the bin
{
i++; //assuming that each row represents a bin
bin[i][j]=inputitems[c]; //place element from inputitems array into a 2D array called bin
sum += inputitems[c];
c++;
goto loop; //go back to the while statement to check condition
}
else
{
j++;
countOfBins++; //to count the number of bins we used
i=1;
sum=0;
bin[i][j]=inputitems[c];
sum += inputitems[c];
c++;
goto loop;
} } //end of while loop printf("\nNumber of bins used: %d \n", countOfBins);
printf("\nstructure of bin\n(FYI any empty rows shown, are equal to the number of items that you have entered)\n");
printBins(bin,items);//to print the bins used with their elements //end of first technique, can;t stop: getch();
}//end of very first else }//end of main //I could not figure out any of the other 4 techniques of Bin Packing... any help please?
What are Properties and Methods in object oriented programming?
Properties in JavaScript van be thought of as a variable inside of an Object.
While:
var foo = 'bar';
is a variable.
Here:
var foo = {bar:'baz'};
bar is a property of the foo object.
You van also assign properties to an object in an array/hash-map like way, using square braces like follows:
foo['qux'] = 'spam';
The main difference here is the use of quotes to delimit the property name. Note also that in the current JavaScript version (ES 3) you cannot use reserved words (i.e. for, in function, brake or etc.) as property names without delimiting the names with quotes (' or ").
Properties can also hold functions, and when the do they are called methods (of the object).
Mainly properties are used either as normal variables, just within the namespace of the enclosing object. Or they are used as indexes when using objects like associative arrays/hash-maps/dictionaries/word-list/array-lists. It is btw. discouraged to use javascript arrays non-numeric indexes, since such arrays wil be treated much like objects, normal objects should be used.
What is a partial class in Csharp programming?
As far as web programming is concerned, client side programming is code that runs in the web browser, rather than the web server. JavaScript is an example of client side scripting because the code is sent to the browser, at which point it is executed. PHP is an example of server side scripting because the code is executed on the server, and the resulting code is sent to the browser and displayed.
What is snarled program logic called?
Snarled program logic is unstructured logic, also known as "spaghetti" logic. Compiled machine code is the ultimate example of snarled program logic. Although spaghetti code is more compact and efficient than structured code, it is extremely difficult to both comprehend and maintain. Hence we use structured programming languages to provide a high level of abstraction between the logic of the programmer and the snarled logic of the machine-dependant code.
What are the applications of merge sort?
Applications of heap sort
Why won't my computer play audio?
Check your speakers. Are they plugged it to the power outlet? Are they hooked up to the CPU. Are they turned on?
Next thing you need to do is check the sound level on the CPU itself this can be done by double clicking the little speaker next to the time down at the bottom right hand corner. if that's not the issue it could be your video card is shot.
Is C a pure Object Oriented Programming Language?
High. Only machine code and Assembly are low level languages.
The distinction most usually used to determine if a language is 'high' or 'low' is the use of a compiler. If a language requires some form of compilation or translation process to convert each written instruction into multiple machine executable instructions then it is a high-level language. If each written instruction can be directly converted to a single machine executable instruction (and usually back again) then it is low-level.
Comment statement of BASIC programming language?
In original Standard BASIC comments were indicated by a "REM" (short for "REMARK") statement.
So, if "REM" was the first characters on a line, the rest of the line was treated as a comment and ignored by the interpreter or compiler.
Later dialects of "Structured" Basic use exclamation points (!) or single quotes (') to indicate the start of a comment
Some dialects require the exclamation point or single quote to be the first character on the line, others allow them to appear later in the line after executable code.
Most dialects still support the REM notation as well.
A double ended queue, or deque, is a queue in which you can access or modify both the head and the tail. The front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)
What are the characteristics of low level languages?
Instructions are either in machine code
- or they are one to one with machine code
- Using mnemonic codes for operations
- Using labels for addresses of data
- Used for controlling the computer/close to hardware
- Allows direct manipulation of memory addresses
- Contains a code for the operation to be carried out...
- and a binary representation of the value to be manipulated/address of the value to be
manipulated.
- Different forms of addressing mentioned.
- Different forms of instruction: Arithmetic/Jump/Control
What is difference between modal and modeless dialogbox?
A modal dialog box doesn't allow the user to access the parent window while the dialog is open - it must be dealt with and closed before continuing.
A modeless dialog can be open in the background.
What are the applications of circular queue?
Priority queues can be found in operating systems for load-balancing and interrupt handling, network servers for bandwidth management, compression algorithms (such as Huffman encoding), Dijkstra's algorithm, Prim's algorithm and artificial intelligence systems.
Not everybody can do well in computer programming, that is strong in mathematics. It depends on how your mind operates. For example a person that is Very highly dyslexic may be great at remembering things from years ago, but still be extremely bad at using those memories in order to make wise decisions in everyday choices.
This clearly shows that a person with only base skills in one area, doesn't always exceed at being good at other things branching off of that particular area. (i hope this makes since... hopefully somebody can improve this answer.)
What is a handle in Windows Programming?
A handle is a reference for the operating system. It does not have the semantics of a programming reference but what it does do is allow the system resources to know what you are referring to when it is passed in an API call. Usually, the HANDLE is wrapped in an instance of a class. CWnd is a good example, it contains an HWND which is a handle to a window. You can do this. CWnd *pWnd = CWnd::FromHandle(hWnd) Note: that CWnd::FromHandle(hWnd) is static and does not require an instance. It will pass you back the wrapper that the hWnd is wrapped by. Well not quite! If the handle is not actually wrapped by an object it will create one AND IT WILL ONLY BE TEMPORARY.So use it the once then throw it away. It can create the instance because the hWnd has enough information in its struct for windows to instantiate a CWnd object. It does not add it to the handle v object table, so it is only temporary. The HWND is in fact a kernel object and theres more ? HWND (CWnd and CWnd-derived classes) HDC (CDC and CDC-derived classes) HMENU (CMenu) HPEN (CGdiObject) HBRUSH (CGdiObject) HFONT (CGdiObject) HBITMAP (CGdiObject) HPALETTE (CGdiObject) HRGN (CGdiObject) HIMAGELIST (CImageList) SOCKET (CSocket) (Should have been HSOCKET?) + others. I am not sure if all of these would pass back a temporary object if required. ::GetDC(hWnd) will get you a hDC from an hWnd but it will be temporary, probably better to use the CDC claa. It may be a fundamental requirement for windows programming? For a proper explanation look up google with this "Inside MFC: Handle Maps and Temporary Objects"
What is the best way to merge partitions on your hard drive?
One of the safest ways is to purchase a software program, e.g. Partition Magic, which can do this without destroying any of the data that may be on the partitions.
Better way
The safest way is to backup all your data. format HD and repartition with fdisk. Then install your programs and restore the data.
Although there are many programs to partition HD without lose data, nobody will recommend use them without backup your data. And if you backup all your data why not format your HD and reinstall programs - that way all your programs will run faster. If you don't have the time to reinstall or the original programs discs, You still must backup all your critical data, and this exist in many places on your HD, not just in "My Documents" folder, like Outlook data. So be care and lot of luck.
---- In Linux: After MUCH frustration, digging, trial-and-error, I have answered my own question.
My problem, as you may recall, was that I could not delete or resize two "unallocated partitions on my hard drive. All the options (unmount, resize, delete, etc.) were grayed out. I could not unmount them because they were in use.
The answer was to download the GParted LIVE CD from: http://gparted.sourceforge.net.
I simply inserted the GParted LIVE CD, rebooted, and -- voila! -- I could move, resize, and delete all my partitions at will! IMHO, the GParted utility is much easier to use then Partition Magic, and best of all, it is FREE!
I hope this post can help others with a similar problem.
lwcary
----
What is the function of data-compression utility?
The function of a data compression utility is to reduce the file size and thus maximise storage capacity. The compression has to be done in such a way that the original data can be restored by a corresponding decompression utility.
The simplest way to compress data is to use a variable-length encoding rather than a fixed-length encoding. Normally, data is stored using a sequence of symbols with fixed-width codes (typically 8-bit bytes). However, some symbols appear more frequently than others, so by using fewer bits to represent the most frequent symbols and more bits for the less frequent ones, data can be stored much more efficiently.
To achieve this, no two symbols can have the same prefix. This is, if the space character (which is the most common symbol in text data) is represented by the 1-bit code 0, then no other symbol can be prefixed with a 0 -- they must all be prefixed with a 1. The letter 'e' is also quite common, thus we might give it the 2-bit prefix 10, which means all other symbols must have a 11 prefix. The problem with this encoding scheme is that with each new symbol we have to add another bit. If our data contains 127 unique symbols (the entire ANSI character set), then the least-frequent symbol would consume 127 bits! Although we may still be able to reduce the overall size of the data, this is not the most efficient method of doing so. We could achieve very similar savings just by using a 7-bit byte instead (which is sufficient to encode the entire ANSI character set).
Prior to 1951 there was no algorithm capable of producing the most efficient prefix encoding. We knew that binary trees offered the solution, where leaf nodes represented the symbols we wished to encode and the path from the root node of the tree determined the prefix (appending a 0 bit when we branched left and a 1 when we branched right). Thus every symbol had a unique path and therefore a unique prefix. However, building such a tree was a complex process and there was no guarantee the end result would produce the most efficient encoding without a good deal of trial and error.
David A. Huffman came up with the solution in 1951. Instead of building the tree from the root, he built the tree from the bottom up. First, he created a frequency table of all the unique symbols in the data, sorted in descending order of frequency. He then extracted the bottom entry (the least frequent symbol) and attached it to the left node of a parent node. He then took the next least frequent symbol and attached it to the right. The parent's frequency became the sum of its two nodes and it was re-inserted into the table in sorted order. In other words, he removed two entries and inserted one, thus reducing the table by one entry overall. He then repeated this process continually until there was only one entry left. That one entry became the root of the binary tree. As simple as it sounds, this algorithm produces the most efficient prefix encoding, all we have to do is branch left (append a 0) or branch right (append a 1) and when we reach a symbol (which is always a leaf) we have the prefix for that symbol. We can then rescan the original data and output a contiguous sequence of prefixes to create the payload.
In order to decompress Huffman coded data, we must also be able to recreate the original tree that was used to compress it. Since there are only two types of node (parent or leaf) and every parent has two nodes and every leaf holds a symbol, we simply need to traverse the tree in depth-first order from the root. This is a recursive operation where we examine the left node followed by the right node. If we examine the left node and find it is a leaf, we output a 1 bit followed by its 8-bit symbol. But if the left node is a parent, we output a 0, traverse to it, and repeat the process with that node. Eventually we get back to the root where we can examine its right node. Again, if it is a leaf we output a 1 followed by its symbol, otherwise we output a 0 and traverse to it. Eventually we arrive back at the root and the entire tree has been encoded.
The only other piece of information we need is the number of symbols in the payload (equal to the size of the original data in bytes). Once we have all three we can build the compressed data, outputting the size, followed by the encoded tree, followed by the payload. If the final size is not a multiple of 8 bits, we simply pad the remaining bits with zeroes.
To decompress, we read back the size and store it. We then create a parent node for the root of the tree and begin reading the encoded tree one bit at a time. If the bit is a 1, we create a leaf node on the left and read the next 8 bits to determine its symbol, otherwise we create a parent on the left, traverse to it. Eventually we arrive back at the root and can process its right node in the same way. Once that's done we'll have rebuilt the tree.
Then we can process the payload, starting at the root. If we read a 0, we traverse left, otherwise we traverse right. If the node we traverse to is a leaf, we output the symbol, otherwise we read the next bit and traverse left or right until we do reach a symbol. Once we output a symbol, we increment a counter and start again from the root. When the counter is equal to the size we read at the start, we can stop processing; any remaining bits are just padding.
The algorithm is elegant and, even with the added weight of the encoded tree, can produce significant savings in space for any moderate sized file. For example, the Project Gutenberg Etext version of Moby Dick comes in at 1,256,165 bytes, but is only 720,043 bytes when compressed with Huffman encoding (57% of the original). Huffman coding can be found in more complex algorithms which can compress data even further. For instance, RAR (Roshal Archive, by Eugene Roshal) can compress the same file down to just 443,371 bytes (35%)!
Can you use doubly linked list as a circular linked?
Write a program that inputs a series of integers and passes them one at a time to a function even which uses the remainder operator to determine if an integer is even. The function should take an integer argument and return 1 if the integer is even and 0 otherwise.
Do you need to be an excellent computer programmer to be an engineer?
No. There are many engineering jobs, even among those closely associated with computer programming, that require little programming skills. However, every modern engineer will need to handle complex technical computer programs, which often include a programming-like aspect.
For example, a civil engineer designing bridges does not normally need computer programming skills per se, but will use modelling software and mathematical software packages to design and test the design through simulation.
Many of the more senior software-related engineers may not, or no longer, be excellent programmers in terms of knowing every aspect of the programming environment inside out. The task of such a person is to understand complexities on a larger scheme, work out solutions and specify those while others, often more junior programmers, will need excellent programming skills to implement these solutions correctly and efficiently.
Few, if any, present day engineering jobs will come without requirements for programming and mathematics, but the required proficiency varies.
What is an example of a syntax?
The way an author chooses to join words into phrases, clauses, and sentences. Syntax is similar to diction, but you can differentiate them by thinking of syntax as the groups of words, while diction refers to the individual words.
What are the disadvantage of array implementation of stack?
Some immediate disadvantages:
What is the binary code used for?
binary code
(computer science) A code in which each allowable position has one of two possible states, commonly 0 and 1; the binary number system is one of many binary codes.
Source: http://www.answers.com/binary+code?cat=technology
A = 0x41 = 65
B = 0x42 = 66
C = 0x43 = 67
...
Y = 0x59 = 89
Z = 0x5A = 90
However, note that depending on a particular numeric or bit value for a character is not always portable. It depends on the implementation.
Who invented object oriented programming?
Credit for this is usually given to Alan Kay, though he was one of a number of team members (Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace) at the Xerox Palo Alto Research Center. It was these people who put down the original specifications of object-oriented programming and developed the Smalltalk programming language as an implementation of these specifications.