answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

How does binary work?

inary code is the language that computers use. It is a series of 1s and 0s. 1 means that the switch is on and 0 means off.

Extrapolated answerBinary code is based on an exponential model of multiplication.

The code can be used to define an infinitely large exact number to an infinite amount of decimal places. It can do this because the code itself can go on for as long as it needs to.It is arranged as follows:

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4098, 8196, 16392, 32784.... etc etc

Multiply any given number by two and you have the next number in the series.

So where do the 0s & 1s fit in? First it should be noted that in the answer above, a "switch" does not mean a physical switch. It is a CONDITION. Once the condition is met the "switch" is on. In the code above, each number is its own "switch" (condition). The state of the switch is determined by a 0 or 1.

So lets say you want to define the number 43710 in binary code. The code would be as follows:

0101010101010101.

Why? Because in the number 43710 there is: one 32784, one 8196, one 2048, one 512, one 128, one 32, one 8 and one 2 (add these numbers to each other and you have 43710). The length of a line of binary code is determined by the number that it produces (longer numbers mean longer lines of code).

The number that is produced, then becomes a "switch" (condition) itself and is set true or false by other lines of binary code.

Further lines of code generate similar numbers which are crunched through a series of mathematical equations in order to produce a language that we can understand. That language could be a visual pattern of colours, shapes or lines, it could be an audible noise or sound, or music even, or it could just be text on a sceen or piece of paper, or it could be all of these combined.

Binary code is not written by humans, it is written by machines. It has no usefull function to us as humans other than to simplify the definition of inordinatly large numbers.

The reference in the original answer to binary being a "computer" language, while true, lacks the specific definition of what exactly a computer is. A computer is more than something you buy from PC world, then take home and play games on. The term can be used to describe any machine that has the ability to transform languages (including the language of mathematics) into code (abbreviated) form. Early computers were nothing more than big rooms full of gears, cams and con-rods, and all they did was crunch numbers. They were big calculators, and in essence, that is all a modern computer is, albeit a fancy calculator!

Five types of method support that can be provided by CASE tools?

Software engineering methods only became widely used when CASE

technology became available to support them. Suggest 5 types of method

support which can be provided by CASE tools.

What are the Characteristics of useful information?

There are many characteristics that can be seen of useful information. Useful information is something that is helpful or relevant.

Why is the hard drive labeled C?

C:/ c is the hard drive a brilliant question, as a computer tech, i always just accepted it as fact upon contemplation i would answer that it is a randomly chosen identifer for the local drive you would probably have had to be there when the engineer was configuring, for all intents and purposes, one of the first artificial intelligence prototypes and, well, "i'll name it C" you could probably get the correct answer from a archived computer book, documentary, etc you will never see "his" notes c (lower case) is the constant for the speed of light Note: This is a correct answer but somebody changed the question on you...It has been reverted back to the original. Answer 2: The earliest computers operating under the various DOS versions were not equipped with a hard drive. They operated, in some cases by running the operating system out of one floppy drive and using the second floppy for applications. The floppies were addressed as A and B. After hard drives began to be installed, it was still common for computers to have two floppies. After the old 5-1/4 floppy format gave way to the new 3-1/2, it was common to find both drives on computers because the user was assumed to have all their important stuff still on the old 5-1/4's. That created a bit of a problem because the A and B were so firmly entrenched in their use for addressing the floppy drives that it was impractical to use A or B for anything else. Also, software was written to default to the C-drive when programs were installed. C:\ does not always refer to a hard drive, it is used to address the first un-hidden DOS sector on an IDE or SATA device. As such, a hard drive may be partitioned to have many partitions and those partitions can be assigned letters of your choosing by using drive management programs. Networked computers can also map different letters to various network locations. Optical drives are generally going to take a higher letter if the system has a hard drive. The C-drive does not always have to refer to a hard drive. When a virtual drive is created in memory, as when you use Windows' recovery, it can be addressed as C. Linux, Unix and MacOS do not use any drive letters.

What is an Egyptian triangle?

Each year the Nile river would flow, depositing silt and removing farm markings on the land of Egypt. Engineers would be brought in to establish the "square" boundaries of the land. These engineers were known to have a necklace that contained 12 equally spaced knots. When this necklace is stretched out it forms a triangle that has a 3:4:5 ratio of its sections and forms a right angle between its 3 side(leg) and the 4 side(leg). Therefore the 3:4:5 triangle is called the Egyptian triangle. A triangle that has integers for the sides and the sum of squares of the legs equals the square of the long side(hypotenuse) is called a Pythagorean triple which includes the Egyptian triangle. There are other right triangles that do not have integers for sides but also must have leg squared plus leg square equal to the hypotenuse squared.

How many types of full forms in computers?

there is over a million types in the whole world there is more from the beginning and that adds up over 6 million computer

How do you write a C program to insert a sub-string into given main string from a given position?

#include

#include

void main( )

{

char st[20],sub[10],temp[10];

int pos, i, j;

clrscr( );

printf("Enter the main string:");

gets(st);

printf("\nEnter the substring to insert:");

gets(sub);

printf("Enter the index position:");

scanf("%d",&pos);

if(pos<=strlen(st)) {

for(i=0;i<=strlen(st);i++) {

if(i==pos)

{

for(j=0;st[i]!='\0';j++) // to store the 'st' to 'temp' from given position.

{

temp[j]=st[i];

i++;

}

temp[j]='\0';

i=pos;

for(j=0;sub[j]!='\0';j++) // to insert a sub-str to main string.

{

st[i]=sub[j];

i++;

}

for(j=0;temp[j]!='\0';j++) // Lastly to insert the 'temp' to 'st' after sub-str.

{

st[i]=temp[j];

i++;

}

st[i]='\0';

}}

printf("\nAfter adding the sub-string: %s",st);

}

else

printf("\nSorry, it is not possible to insert a substring in that position.");

getch();

}

What do you do if the speaker on your computer work but no sound come out of the computer?

No sound on a ComputerWhat should You do? The first thing i would do is making sure it is pluged into the right output Jack in the computer. if it is go to step 2.

if its is not pluged into the Right ouptup jack go to step 1.

Step 1 Plug it into the right jack, play a song make sure the speakers is turned on and also turned up.

Step 2 Now, if it is in the right output jack, triple check to see if it is not muted. then try a song

If it still dosent work shut down PC and/or contact a computer expert.

What is the difference between object-oriented database and object-oriented programming?

Object oriented programming is a method of writing code that follows a certain set of rules. There are many rules but one main one is that the data that you define for an object in encapsulated with the functions that can be performed on that data. This is opposed to a procedural style of programming where there is no limitation of what data can be modified where and by what functions. The OO (Object Oriented) programming style lends itself to large projects where you might have many developers working and you want to keep parts of the code simple enough so that each developer doesn't have to be aware of every single thing that the other developers are doing.

An object oriented databases, are databases where the storage is designed around the virtual objects created in the code itself. This kind of database is inherently different than a relational database in that you are not concerned with normalization of the data. With this kind of database you have the advantage of being able to retrieve the information very fast due to the fact that you are not joining many tables (assuming you are using SQL) but you have the disadvatage of your data possibly getting corrupted/denormalized.

What is the program that prints all prime numbers from 0 to 300 in C plus plus?

#include

bool is_prime(unsigned num)

{

// 2 is the first prime and the only even prime.

if (num < 2) return false;

if (num == 2) return true;

if (num % 2 == 0) return false;

// Divide num by every odd number from 3 up

// to and including the square root of num.

// If any division results in no remainder

// then num is not prime.

unsigned max = sqrt ((double) num) + 1;

unsigned div = 3;

do {

if (num % div == 0)

return false;

} while ((div += 2) < max);

// If we get this far, num is prime.

return true;

}

int main()

{

std::cout << "Prime numbers in the range 0 to 300:\n" << std::endl;

unsigned num = 0;

do {

if (is_prime (num))

std::cout << '\t' << num << std::endl;

} while( num++ < 300);

std::cout << std::endl;

}

Example Output

Prime numbers in the range 0 to 300:

2

5

7

11

13

17

19

23

29

31

37

41

43

47

53

59

61

67

71

73

79

83

89

97

101

103

107

109

113

127

131

137

139

149

151

157

163

167

173

179

181

191

193

197

199

211

223

227

229

233

239

241

251

257

263

269

271

277

281

283

293

Do hospitals use spreadsheets?

yes hospitals use spreadsheets so they know what patients they have in the hospital and so they no what medicine or tablets they can and cant have

3 d max tree model?

tolong jelasin gimana cara bikin animasi tree d

Which is the best processor for software development like .netjava?

Some say: "What processor you use is pretty irrelevant to software development these days."

Actually, it always matter. Yes, it is. Look, you do not state the kind of software you are about. For example, I could say that it depends on how one goes with the development. To write web applications and deploy them locally for development purposes, one needs to spawn application container, in some cases on virtual box supplying OS different than the development environment one. Virtualisation is processor dependent. So is multiprocessing.

Also, you do not mention your energy consumption requirements. Laptops differ from heavy boxes.

At the mo: prefer quad over i5 (it's 2 or 4 cores, loosely coupled). If you can, go i7 (there's a mobile version) - that's preferable.

Also, all the processes need some repetitive I/O, SSD preferable then. If low budget, consider hybrid drives: like Momentus http://www.youtube.com/watch?v=fKUYVVPWN8I. Would like to get one! :)

What is a .psa program?

It is a CRM tool Called Connectwise - It uses a .psa extension.

Can you reinstall a program if you already have it on your computer and if so will it do anything?

Yes you can re-install programs that are already on your computer. What happens depends on the installer. A good installer will automatically switch to maintenance mode if the version you are installing is the same as the one that is already installed -- allowing you to modify the installation (add or remove components). If there is no maintenance mode it should simply repair the installation if anything is missing, or let you know the software is already installed. If the versions are different, the installer should offer to remove the existing installation if it is older, or alert you if it is newer (typically you have to manually uninstall newer versions before installing older versions). A bad installer will simply install over the existing installation regardless, however the complexity of the software will determine if this is a good thing or not.