answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

How do you draw cone in c program?

A cone is a 3-dimensional shape, while drawing on a computer is generally limited to two dimensions, and projection of three dimensions onto a flat (two-dimensional) canvas.

You can draw a cone very easily onto a 2-dimensional canvas if you are free to chose the viewing angle, and if that viewing angle does not need to change.

You could draw a triangle and state that it shows a side view of the cone, you could draw a circle and state that it shows the bottom view of the cone, or you could draw a circle with the center point marked, and state that it shows the top view of the cone.

You could draw all three, top, bottom and side view, and state it shows the cone in all three dimensions, in the way most 3-dimensional objects are shown in a technical drawing.

For creating a projection of a 3-dimensional cone from an arbitrary viewing angle, you should consult dedicated (but non-trivial!) literature on 3-D rendering. Many languages also support 3D graphics toolkits such as OpenGL.

Who invented octal number system?

Nobody knows for sure who first came up with the octal system, but the same can be said of all base systems. You might as well ask who invented counting. In order to count, there has to be some basis to the count which requires some formal understanding of base numbers, whether it be 2, 8, 10 or 60.

The decimal system we use today began development in India around 1AD and spread to Europe via the Western Arabs, hence it is known as the Hindu-Arabic numeral system. But prior to that, decimal systems were largely dismissed because of their lack of factoring; the number 10 has only two factors: 2 and 5. By contrast, 60 has five consecutive factors: 2, 3, 4, 5 and 6. Thus base-60 (sexagesimal) was favoured by the ancient Sumerian civilisation 5,000 years ago and is still used to this day: circles still have 360 degrees and the 24-hour clock still has two periods of 12 hours with 60 minutes per hour. Ultimately, any civilisation that can perform highly complex calculations in base-60 would have to have been more than familiar with all other bases, even if only to know why they were unsuitable in the first place.

Base-8 is clearly no better than base-10 in terms of factoring (2 and 4), but its close relationship to base-2 (binary) is hard to miss, even by ancient Sumerian standards. Indeed, the same can be said of all bases that are a power of 2 and if you can notate sexagesimal then you can certainly notate all bases below 60.

We do know that the Native American Yuki and Mexican Pamean cultures used an octal system because they counted using the spaces between the fingers rather than the fingers themselves. But this does not equate to an understanding of octal in the same way an ancient Sumerian understood sexagesimal. If anything, it merely demonstrates a complete ignorance of all other bases and almost certainly wasn't used to perform complex calculations.

But as to who actually invented octal first, nobody can possibly say for sure. I fancy the clever money would be on the Sumerian.

What are some types of input validation errors?

Depending on the programming language you choose to work with, there will be different varieties of input validation errors (meaning, some input will fail to validate for a diverse amount of reasons). Some common ones are presented here. Note that they are generically named; there is no standard for the following types of errors.

Data Type errors occur when the data is not the correct type of data. For example, an integer may be required when a string is given, thus causing an error.

Length errors occur when the data is too shorter or longer than required.

Invalid Range errors occur when numeric data does not fall within a permitted range. For example, if the range was 0 to 3, 2 would pass validation while -1 or 4 would not.

Invalid Character errors occur when the data is a string (or similar) which contains a character that is not permitted. For example, if all "a" characters are forbidden, "alex" would not validate while "timmy" would.

Other Types of Errors may occur depending on your programming language. When programming for input validation, ask yourself what could possibly go wrong. What could the user enter which would ruin your program (or be an annoyance)? Make sure the user cannot enter that data.

What are advantages and disadvantages of Integer programming?

The advantages of integer arithmetic over floating point arithmetic is the absence of rounding errors. Rounding errors are an intrinsic aspect of floating point arithmetic, with the result that two or more floating point values cannot be compared for equality or inequality (or with other relational operators), as the exact same original value may be presented slightly differently by two or more floating point variables. Integer arithmetic does not show this symptom, and allows for simple and reliable comparison of numbers.

However, the disadvantage of integer arithmetic is the limited value range. While scaled arithmetic (also known as fixed point arithmetic) allows for integer-based computation with a finite number of decimals, the total value range of a floating point variable is much larger.

For example, a signed 32-bit integer variable can take values in the range -231..+231-1 (-2147483648..+2147483647), an IEEE 754 single precision floating point variable covers a value range of +/- 3.4028234 * 1038 in the same 32 bits.

How do you get your UMD dumper to work it says data corrupt?

1). Format the file. Description of format: Deleting all the file content.

2). Run a fragmentation and a device trouble shooting.

3). Send the file into a proper computer expert company.

What are importance of algorithm?

Algorithms are the foundation of computer Science, it is telling the computer to do the task in the most efficient matter. An algorithm is particularly important in optimizing a computer program, the efficiency of the algorithm usually determines the efficiency of the program as a whole.

What is incremental compiler and it's working?

A computer-aided software development system includes programs to implement edit, compile, link and run sequences, all from memory, at very high speed. The compiler operates on an incremental basis, line-by-line, so if only one line is changed in an edit session, then only that line need be recompiled if no other code is affected. Scanning is done incrementally, and the resulting token list saved in memory to be used again where no changes are made. All of the linking tables are saved in memory so there is no need to generate link tables for increments of code where no changes in links are needed. The parser is able to skip lines or blocks of lines of source code which haven't been changed; for this purpose, each line of source text in the editor has a change-tag to indicate whether this line has been changed, and from this change-tag information a clean-lines table is built having a clean-lines indication for each line of source code, indicating how many clean lines follow the present line. All of the source code text modules, the token lists, symbol tables, code tables and related data saved from one compile to another are maintained in virtual memory rather than in files so that speed of operation is enhanced. Also, the object code created is maintained in memory rather than in a file, and executed from this memory image, to reduce delays. A virtual memory management arrangement for the system assures that all of the needed data modules and code is present in real memory by page swapping, but with a minimum of page faults, again to enhance operating speed.

Give two reasons why caches are useful?

It minimizes the miss match between the main memory and the processor

Actually, there is one reason for a cache to exist: speed. A cache exists to speed up the time that the processor takes to obtain a bit of data. Typically, main memory is many times slower than the processor - in modern computers, it can be 1000 times slower. So, caches are made up of memory more expensive and faster than main memory, to store parts of main memory in, in the hopes that the data the processor wants will be available in the cache.

What is the most common username?

On WikiAnswers all user names are unique (otherwise we'd all get VERY confused!)

so, within our own realm of activity, we can say with total confidence that no user name is more common than any other!

What is the ASCII value of the Chevron character?

There is no ASCII character that represents a chevron. However, there are several characters in the Unicode character set that have chevrons:

* 0xAB and 0xBB are right and left double chevrons (these are in Latin-1). * U+27E8, U+27E9, U+27EA, U+27EB are various single and double chevrons.

Why excess-3 is require?

Excess-3 or XS-3 code is rqeuired for code encryption in LDST (Logic Design and Switching Theory).. A computer programming code for alpha-numerics.

Full form of ddr-RAM?

Full form of DDR is Double Data Rate. DDR-SDRAM : Double Data Rate Synchronous Dynamic Random Access Memory.

Role of Computer network in Information Technology?

The Role of the Computer Network in Information Technology:

Information Technology talks about computers, devices, and also networking, the roles may lead as (Supportive, Active, Professional, Fixer, Fast Learn, and Hardware)

Networking ASCC:

(Internet, Browsing, Supportive, Facial Studies, and Inside Computer)

Those are important role of a computer network, school in public and nation shall proud!

Difference between Bresenham and midpoint circle drawing algorithm?

what is difference between mid-point and bresenhams circle algorithm what is difference between mid-point and bresenhams circle algorithm bresenhams circle algorithm results in a much more smoother circle,comparred to midpoint circle algorithm..In mid point,decision parameter depends on previous decision parameter and corresponding pixels whereas in bresenham decision parameter only depends on previous decision parameter...

What is the difference between rem and echo in batch?

rem is a comment that is only seen if you edit the batch

echo actually is printed when the batch is running

Is an infinite loop an example of a syntax error?

No. A syntax error is a statement that fails to compile. Infinite loops are simply loops for which the number of iterations is unknown. However, all loops, whether counted loops or infinite loops, must have a reachable exit condition. If a loop does not have a reachable exit condition then it is a logic error, not a syntax error.

What is recursive behavior command in UNIX?

There a lot of command that could be used with recursive option in UNIX type operating systems and even Windows. For example we want to list of files and folders inside current folder but we want to list and all subfolder and even subsubfolders and etc. For this we will have to use recursive option.

Example:

Command: ls -laR

Return:

-rw-r--r--@ 1 david staff 373 Bal 26 18:13 add.sh

-rw-r--r-- 1 david staff 31 Bal 26 18:12 even.txt

drwxr-xr-x 3 david staff 102 Kov 20 18:46 ruby

drwxr-xr-x 2 david staff 68 Bal 15 07:24 C

./folder:

total 0

drwxr-xr-x 2 david staff 68 Bal 26 16:55 .

drwxr-xr-x 16 david staff 544 Bal 26 18:11 ..

./ruby:

total 8

drwxr-xr-x 3 david staff 102 Kov 20 18:46 .

drwxr-xr-x 16 david staff 544 Bal 26 18:11 ..

-rwxr-xr-x@ 1 david staff 181 Kov 20 18:59 test.rb

As you can see it not only listed files from active directory, but also listed and files from other two directories that are located in active directory.

There are many programs that allows this kind of recursion (usually it will be -R option) and some even will allow to limit the depth you want. In order to find out which commands support recursive option you need to read each command manual pages, which could be in internet or in system by writing in console: man

Write the full program for the quadratic equation in COBOL?

Identification division.

Program-id. Quadratic.

Environment division.

Data division.

Working-storage section.

01 a pic 9(3) value 0.

01 b pic 9(3) value 0.

01 c pic 9(3) value 0.

01 d pic 9(3) value 0.

01 e pic 9(3) value 0.

01 f pic 9(3) value 0.

01 g pic 9(3) value 0.

01 h pic 9(3) value 0.

01 x1 pic 9(3) value 0.

01 x pic z(3).z(2) value 0.

01 x2 pic 9(3) value 0.

01 y pic z(3).z(2) value 0.

Procedure division.

Display "Written by Martin O. Egua, but not complete".

Display "Quadratic equation solver for three values a, b & c"

Display "Enter a number: " Accept a.

Display "Enter the second number: " Accept b.

Display "Enter the last number: " Accept c.

compute d = (b * b)

compute e = 4 * a * c

compute f = 2 * a

compute g = d - e

compute h = function sqrt (g).

compute x1 = (-b) + h

compute x = x1 / f

Display "X = " x

compute x2 = (-b) - h

compute y = x2 / f

Display "Y = " y

Display "Send the accurate program".

Stop run.

How do you sue your Union for misrepresentation?

Suing your union is a difficult row to hoe. In my State of Oregon in cases that have gone before the labor relations board alleging union misconduct a very small number of ( around 1 percent or less) the cases have ever been won. This is true even when the union conduct appears egregious. I was one of the people who thought they had a good case and lost. Due to my negative results I now believe that to prevail against a union you must avoid the State system and move directly into the federal courts. A good starting place in at the local federal courthouse. You can do a search of cases where a union has been sued and if you find something close to your situation you are entitled to make a copy of the legal briefs and outcome. This may point you in the right direction.