answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Why computer understand only 0 or 1?

It is understood that programming languages are used to create programs and a program is a sequence of instructions written to perform a specified task with a computer.The important thing to be noted is - there are different tasks and different types of tasks that are to be performed with a computer and thus the facilities offered by a single programming language is not enough to accomplish all those tasks.

In other words the features or purpose of one programming language differs from others (for example HTML is used to create websites and C or Shell programming can be used for system programming). Different programming languages are also used in different platforms to perform the same task (for example Visual C# or Visual C++ can be used for creating an application in Windows but Objective C is used to create the same application in Mac OS X).So different programming language are used to create program to perform different types of tasks due to limitations in the facilities offered by a single programming language.

Regardless of what programming language has been used, the particular compiler for that programming language compiles the program and creates its equivalent executable code(.exe file) in machine language(0 and 1), which the computer understands.

Program to drow graphical circle in c?

Standard C does not include any graphical functions thus there is no standard method for drawing circles. For that you will need a graphics library suited to your specific hardware and operating system. Specific methods will vary according to which library you use, however there are also generic library's available depending on your hardware's capabilities. Consult your library's documentation; there will typically be simple examples to demonstrate the library's core features, including drawing circles.

What are the striking features of OOP?

the list is as follows with the description :-

; Class : Defines the abstract characteristics of a thing (object), including the thing's characteristics (its attributes, fields or properties) and the thing's behaviors (the things it can do, or methods, operations or features). One might say that a class is a blueprint or factory that describes the nature of something. For example, the class Dog would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark and sit (behaviors). Classes provide modularity and structure in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context. Also, the code for a class should be relatively self-contained (generally using encapsulation). Collectively, the properties and methods defined by a class are called members. ; Object : A pattern (exemplar) of a class. The class of Dog defines all possible dogs by listing the characteristics and behaviors they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown-and-white fur. ; Instance : One can have an instance of a class or a particular object. The instance is the actual object created at runtime. In programmer jargon, the Lassie object is an instance of the Dog class. The set of values of the attributes of a particular object is called its state. The object consists of state and the behaviour that's defined in the object's class. ; Method : An object's abilities. In language, methods (sometimes referred to as "functions") are verbs. Lassie, being a Dog, has the ability to bark. So bark() is one of Lassie's methods. She may have other methods as well, for example sit() or eat() or walk() or save_timmy(). Within the program, using a method usually affects only one particular object; all Dogs can bark, but you need only one particular dog to do the barking. ; Message passing : "The process by which an object sends data to another object or asks the other object to invoke a method." [2] Also known to some programming languages as interfacing. For example, the object called Breeder may tell the Lassie object to sit by passing a "sit" message which invokes Lassie's "sit" method. The syntax varies between languages, for example: [Lassie sit] in Objective-C. In Java, code-level message passing corresponds to "method calling". Some dynamic languages use double-dispatch or multi-dispatch to find and pass messages. ; Inheritance : "Subclasses" are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. : For example, the class Dog might have sub-classes called Collie, Chihuahua, and GoldenRetriever. In this case, Lassie would be an instance of the Collie subclass. Suppose the Dog class defines a method called bark() and a property called furColor. Each of its sub-classes (Collie, Chihuahua, and GoldenRetriever) will inherit these members, meaning that the programmer only needs to write the code for them once. : Each subclass can alter its inherited traits. For example, the Collie class might specify that the default furColor for a collie is brown-and-white. The Chihuahua subclass might specify that the bark() method produces a high pitch by default. Subclasses can also add new members. The Chihuahua subclass could add a method called tremble(). So an individual chihuahua instance would use a high-pitched bark() from the Chihuahua subclass, which in turn inherited the usual bark() from Dog. The chihuahua object would also have the tremble() method, but Lassie would not, because she is a Collie, not a Chihuahua. In fact, inheritance is an "a... is a" relationship between classes, while instantiation is an "is a" relationship between an object and a class: a Collie is a Dog ("a... is a"), but Lassie is a Collie ("is a"). Thus, the object named Lassie has the methods from both classes Collie and Dog. : Multiple inheritance is inheritance from more than one ancestor class, neither of these ancestors being an ancestor of the other. For example, independent classes could define Dogs and Cats, and a Chimera object could be created from these two which inherits all the (multiple) behavior of cats and dogs. This is not always supported, as it can be hard both to implement and to use well. ; Abstraction : Abstraction is simplifying complex reality by modelling classes appropriate to the problem, and working at the most appropriate level of inheritance for a given aspect of the problem. : For example, Lassie the Dog may be treated as a Dog much of the time, a Collie when necessary to access Collie-specific attributes or behaviors, and as an Animal (perhaps the parent class of Dog) when counting Timmy's pets.

Abstraction is also achieved through Composition. For example, a class Car would be made up of an Engine, Gearbox, Steering objects, and many more components. To build the Car class, one does not need to know how the different components work internally, but only how to interface with them, i.e., send messages to them, receive messages from them, and perhaps make the different objects composing the class interact with each other. ; Encapsulation : Encapsulation conceals the functional details of a class from objects that send messages to it. : For example, the Dog class has a bark() method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume). Timmy, Lassie's friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface - those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class Dog by code in that class. Members are often specified as public, protected or private, determining whether they are available to all classes, sub-classes or only the defining class. Some languages go further: Java uses the default access modifier to restrict access also to classes in the same package, C# and VB.NET reserve some members to classes in the same assembly using keywords internal (C#) or Friend (VB.NET), and Eiffel and C++ allow one to specify which classes may access any member. ; Polymorphism : Polymorphism allows the programmer to treat derived class members just like their parent class' members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to method calls of methods of the same name, each one according to an appropriate type-specific behavior. One method, or an operator such as +, -, or *, can be abstractly applied in many different situations. If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). They both inherit speak() from Animal, but their derived class methods override the methods of the parent class; this is Overriding Polymorphism. Overloading Polymorphism is the use of one method signature, or one operator such as "+", to perform several different functions depending on the implementation. The "+" operator, for example, may be used to perform integer addition, float addition, list concatenation, or string concatenation. Any two subclasses of Number, such as Integer and Double, are expected to add together properly in an OOP language. The language must therefore overload the addition operator, "+", to work this way. This helps improve code readability. How this is implemented varies from language to language, but most OOP languages support at least some level of overloading polymorphism. Many OOP languages also support Parametric Polymorphism, where code is written without mention of any specific type and thus can be used transparently with any number of new types. Pointers are an example of a simple polymorphic routine that can be used with many different types of objects.[3] ; Decoupling : Decoupling allows for the separation of object interactions from classes and inheritance into distinct layers of abstraction. A common use of decoupling is to polymorphically decouple the encapsulation, which is the practice of using reusable code to prevent discrete code modules from interacting with each other. However, in practice decoupling often involves trade-offs with regard to which patterns of change to favor. The science of measuring these trade-offs in respect to actual change in an objective way is still in its infancy. Not all of the above concepts are to be found in all object-oriented programming languages, and so object-oriented programming that uses classes is called sometimes class-based programming. In particular, prototype-based programming does not typically use classes. As a result, a significantly different yet analogous terminology is used to define the concepts of object and instance.

contact me.............. oopsanuj@yahoo.com

What is Ergonomics of a computer?

Ergonomics is the science of designing safe and comfortable machines for humans. In computers, it plays an important role in the design of monitors and keyboards to avoid cumulative trauma disorders or repetitive stress injuries.

What does kl mean in text language?

Kl is an abbreviation for the word Cool. An example could be this.

Bob: Hey Dave, i completed the task!

Dave: Kl.

Write a shell program to generate fibnacci series using while loop?

//WAP to print fibonacci series using do-while loop.?

using System;

class Fibonacci

{

public static void Main()

{

int a=1,b=1;

int sum=0;

Console.Write("Enter Limit:");

int n=Int32.Parse(Console.ReadLine());

Console.Write(a);

Console.Write(b);

do

{

sum=a+b;

a=b;

b=sum;

Console.Write(sum);

}

while(sum<n);

}

}

By-Vivek Kumar Keshari

Examples of procedural programming language?

  1. ABC
  2. Ada
  3. Algol 60
  4. Algol 68
  5. APL
  6. Arc
  7. Assembly
  8. Awk
  9. BASIC
  10. Batch
  11. BCPL
  12. Befunge
  13. BETA
  14. C
  15. C++
  16. C--
  17. C# (pronounced C-sharp)
  18. CHILL
  19. Clipper
  20. Cobol
  21. CobolScript
  22. Component Pascal
  23. Cyclone
  24. D
  25. DATABUS
  26. Euphoria
  27. Forth
  28. Fortran
  29. Free Pascal
  30. GNU Pascal
  31. Icon
  32. IDL
  33. Jal
  34. JavaScript
  35. Jovial
  36. Lagoona
  37. Leda
  38. Limbo
  39. Lua
  40. m4
  41. Maple
  42. Mathematica
  43. MATLAB
  44. Modula-2
  45. Modula-3
  46. Mumps
  47. Oberon
  48. Objective Caml (OCaml)
  49. Occam
  50. Oz-Mozart
  51. Pascal
  52. Perl
  53. PHP
  54. PL
  55. PL/1
  56. Pliant
  57. PL/SQL
  58. PostScript
  59. PowerBuilder
  60. Proteus
  61. REBOL
  62. Rexx
  63. S-Lang
  64. Small C
  65. Snobol
  66. Tcl-Tk
  67. T3X
  68. VBA
  69. Visual Basic
  70. Visual DialogScript
  71. Yorick

Note: Some of these languages, such as PHP, Perl, Caml/OCaml, and IDL also support object oriented programming. Others on the list (C++, JavaScript, C# ) are primarily object-oriented languages which can also (though less commonly) be used to program procedurally.

Some are macro or scripting languages (Rexx, Awk, m4) which, while they do support some procedural concepts, aren't really procedural languages, but rather interpreted streams.

Also note that Assembly is NOT a high-level language, and generally is not considered a procedural language, as it doesn't have enough abstraction.

Finally, traditional COBOL is NOT a procedural language (in fact, one of the long-standing criticism of it is that it lacks any structured programming characteristics). Current-day COBOL has some ability to use procedural programming concepts, but, overall, should not be considered a real procedural language. SNOBOL is similar, in that the original version were certainly not procedural in nature, but modern versions are much more structured programming friendly (and can be considered a procedural language).

Is NET in support of object oriented language?

Yes, every language supported by Microsoft and on the .NET framework is an object oriented language. (OOP)

What do you do if you have a corrupt game save data?

You must look for the game save file. Eg. new super Mario bros.SAV look for the one with the .sav extension. That is the corrupt save file. All you need to do is delete this . When you play the game it will create another save to replace the corrupt one . You will lose your save games

Characteristics of an algorithm?

An algorithm is written in simple English and is not a formal document. An algorithm must:

- be lucid, precise and unambiguous

- give the correct solution in all cases

- eventually end

Also note it is important to use indentation when writing solution algorithm because it helps to differentiate between the different control structures.

1) Finiteness: - an algorithm terminates after a finite numbers of steps. 2) Definiteness: - each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion. 3) Input:- an algorithm accepts zero or more inputs 4) Output:- it produces at least one output. 5) Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.

Write an 8086 assembly language program to compare if two strings are of the same length?

org 100h

.data

str1 db "Computer"

str2 db "computer"

mes1 db "string are same $"

mes2 db "string are different $"

.code

assume cs:code,ds:data

start: mov ax,@data

mov ds,ax

mov es,ax

mov si,offset str1

mov di,offset str2

cld

mov cx,8

repe cmpsb

mov ah,9

jz skip

lea dx,mes2

jmp over

skip: lea dx,mes1

over: int 21h

mov ax,4c00h

int 21h

end start

ret

Write a program to make a triangle?

To draw a random triangle.... Declare six variables.... H1 and V1 H2 and V2 H3 and V3 Then using the random function apply the random to the height of your form - this will be H1 Do the same with the width of the form - this will be V1 -- do this twice more, for H2 and V2 - and then for H3 and V3.. Then draw a line from (H1, V1) to (H2, V2) Draw another line from (H1, V1) to (H3, V3) Draw the last line from (H2, V2) to (H3, V3) -- I can't guarantee it will look great, but it _will_ be a triangle. ==== To draw a specific triangle you need much more coding, involving sine rule an other trigonometry.

How do programmers tackle a programming project?

Inch by inch, it's a cinch. Schuller, Robert H.

I'm the coder, designer, decision-maker...everything...for my own android projects...

"You will face those situations only which you can face...so if got a difficult situation..feel proud..."

My fav drink is thumbs up...lolzzz....

What are the advantages of Geographic information system?

More and more states in the United States are requiring a 4 year degree to be a licensed surveyor. Geomatics is a broad field which encompasses land surveying, remote sensing, Geographic information Systems, Global Positioning Systems and related forms of mapping. All of this is part and parcel of the job of a land surveyor. Land surveying is no longer the Red Headed Step Child of Civil Engineering. It is now a unique discipline that encompasses measuring, mapping, and legal opinions. A geomatics degree will better prepare the professional for the career that is in store for him or her. You learn the why's not just the how to's of the job through the geomatics degree. That is the difference between a professional and a technician.

What do programming tools do?

Programming tools assist in the development of software. The most basic programming tool is the integrated development environment (IDE) which will include one or more code editors and resource editors, as well as file-management and debugging tools. Programmers can choose to use the built-in tools provided by the IDE or they choose to use external utilities and programming tools, such as help file authoring suites and more advanced resource editors and debugging utilities, many of which can be integrated into the IDE itself.

Applets are written in what programming language?

There are many types of applets, and they can be written in many different languages, but you're probably referring to the most widely known Java applets.

So, they're written in a programming language called Java.

What are the classification of programming languages differentiate each?

Imperative languages, also called algorithmic languages, are probably

the most prevalent among the programming language paradigms today.

Their programs are constructed as algorithms or as sequences of

executable instructions.

These languages are greatly concerned with variables and include

commands for sequentially allocating memory space or CPU locations to

these variables and for correspondingly changing their values through

assignment statements or procedure execution.

The three main categories of imperative languages are as follows:

· Block-Structured or Procedural Languages - These languages are

process or "how" oriented. Their basic unit of modularization is the

function or the procedure. A modular unit is comprised of a set of

data declarations and statements. Examples: ALGOL, Pascal,

Modula-2, Ada, and C.

· Object-Oriented Languages - These languages are data or "what"

centered and implement the principle of program decomposition,

data abstraction, and information hiding. They are based on the

fundamental concept of objects. Examples: Smalltalk, C++, Java,

and Visual Basic.

· Distributed Programming Languages - These languages support

more than one processor working either simultaneously or

alternately with other processors in order to complete a task or to

solve a problem.

Declarative languages are those based on relations or functions. Theyinclude facilities for writing declarations or truths. Compared to

imperative languages, they are considered to have higher level than the

former since they work around concepts and not with a machine's

storage locations.

The three main categories of declarative languages are as follows:

· Functional or Applicative Languages - These languages consider

the function as their major organizing principle. Examples: LISP,

APL, and ML.

· Logic Programming - These languages describe computing

problems in the form of predicate logic statements. PROLOG is the

first thing that comes to mind when talking about logic programming.

· Languages for Databases - Languages that support databases

include facilities for accessing/selecting data from database entities,

and describing relationships between data entities. Example: SQL.

What is strong-typing versus weak-typing?

Strong-typing vs Weak-typing

Weak typing is where a language allows you to treat blocks of memory defined as one type as another (casting). Languages like C and C++, although statically typed, are weakly typed.

Languages like Perl and PHP are weakly typed because you can do things like adding numbers to strings and the language will do an implicit coercion for you.

Languages like Java, C# and Python are strongly typed - there is no way you can add a number to a string without doing an explicit conversion.

In addition, there are many large systems that have been created with dynamic type systems. Catching type errors (typos) at compile time only catches a very small proportion of errors and a strong testing strategy produces much more reliable systems irrespective of the type system in use.

Strong type is checking the types of variables at compile time. weak typing is checking the types of the system at run-time. For scripts & quick stuff we'll use weak typing, In big programs, strong typing can reduce errors at compile time

The above answer is not 100% correct. C++ doesn't allow for an integer (int) to be added to a string, unless you mean appending. In which case, C# and Java behave in similar fashion by doing an implicit conversion. For a better answer see the answer to "Strongly typed programming language" in this site.

Juan R

--------------------------------------------------------------------------------------------------------------

Strong typing provides greater type safety. You might have specially heard it about DataSets being strongly typed, where instead of referring columns as datacolumns(index).value, you create an XML schema from which you make a dataset derived class. Strong typing is preferred as there remains no type ambiguity. Another example is, turning on Option strict in VB, where you have to do explicit type casts.Instead of running into situation where you get a type that you did not expect and try performing an operation on it, you go for strong typing so that such errors are caught during compile time itself.

--------------------------------------------------------------------------------------------------------------

strong typelanguage specication requires its typing rules strongly (i.e. more or less allowing only those automatic type conversions which do not lose information),

one can refer to the process as strongly typed, if not, as weakly typed.

example in c language

int a;

float b, c;

b=2.2;

c=3.3;

a=b+c;// here we are losing data result is 5 instead of 5.5 because a is an integer

cout<

here ouptput 5.

if language do not allow to automatic type conversion then it should be strongly type otherwise it is weakly typed.

dynamic type:- if compiler know information about the type of variable or data at run time then it is called dynamic type.

static type:- if complier get information about type of variable or data at compile time then it is called static type.

What the term Variable means?

In math, a variable means something in an equation whose numerical value is not defined. In science, it refers to the things in an experiment that are manipulated by the experimenter. In computer science, a variable is a name that points to a storage location.

What are steps of algorithm?

the number of steps of an algorithm will be countable and finite.

Is there any program used to create c plus plus program?

There are several: an editor, a compiler and linker being the three main programs. Typically you will install an integrated development environment (IDE) that includes all three plus project management and debugging utilities, help compilers, installation helpers, and a raft of plug-ins to suit the platform you are developing for.

How do you design a program that asks the user to enter 10 golf score in python that should be stored in an integer array and sorted in ascending order?

/////////START OF PROGRAM/////////// //the main module Module Main() //declare constant variable Constant Integer SIZE=10 Constant String DAY=10 Set DAY[1] = first Set DAY[2] = second Set DAY[3] = third Set DAY[4] = forth Set DAY[5] = fifth Set DAY[6] = sixth Set DAY[7] = seventh Set DAY[8] = eighth Set DAY[9] = ninth Set DAY[10] = tenth //global variables Declare Integer scores[SIZE] Declare String scores[DAY] Declare Integer index //body of the module //sets the constants in the scores array to 1 Set scores[DAY=1] Set scores Do Display "Please enter the ", scores[DAY]," golf score :" Set scores[DAY+1] Input scores[SIZE+1] until scores[SIZE==10] End Do //calls the insertionSort module Call insertionSort(scores, SIZE) //display the scores sorted ascendedly Display "You golf scores sorted ascendedly are: " For index = 0 to SIZE - 1 Display scores[index] End For End Module