What is Assignment: Definition and 358 Discussions

In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement (or expression) is a fundamental construct.
Today, the most commonly used notation for this basic operation has come to be x = expr (originally Superplan 1949–51, popularized by Fortran 1957 and C) followed by x := expr (originally ALGOL 1958, popularised by Pascal), although there are many other notations in use. In some languages the symbol used is regarded as an operator (meaning that the assignment statement as a whole returns a value) while others define the assignment as a statement (meaning that it cannot be used in an expression).
Assignments typically allow a variable to hold different values at different times during its life-span and scope. However, some languages (primarily strictly functional) do not allow that kind of "destructive" reassignment, as it might imply changes of non-local state. The purpose is to enforce referential transparency, i.e. functions that do not depend on the state of some variable(s), but produce the same results for a given set of parametric inputs at any point in time. Modern programs in other languages also often use similar strategies, although less strict, and only in certain parts, in order to reduce complexity, normally in conjunction with complementing methodologies such as data structuring, structured programming and object orientation.

View More On Wikipedia.org
  1. G

    Help With Physics Assignment: Determining Maximum Velocity & Spring Constant

    Hi, I am taking a physics class with one instructor and the physics lab with another instructor--it wasn't supposed to be that way, and my lab teacher is always giving me a hard time because of it ( I think he hates me.). Anyway, I need some help with a take-home lab assignment that my lab...
  2. P

    Help with Assignment Problems: Finding Derivatives

    Hi, these are just a few problems from my assignment I am having a hard time with. Any help is appreciated. 1) consider function f(x) = 1/3X^3 - 1/2^2 - 6x + 4 a) find the points on the graph at which the tangent lines are horizontal. b) find the slope of the line tangent to the curve at...
  3. M

    Choose the Right Physics Toy for Your Assignment: Tips from Miyu

    Hello people!~ I have a latest Physics assignment in which I'm stuck! Can anyone advise me on how to go about doing it? The instructions are as follows: 1) Select any Physics Toy. 2) Explain the Physics Principle(s) that is/are illustrated by the toy. 3) Suggest one or more...
  4. Astrophysics

    Research Assignment Ideas for Astrophysics Student

    At school we have been given a very important research assignment, but my team-mates (we work in groups) and I don't have a subject to research on. Does anyone have any ideas? My team-mates and I would really appreciate it. We were thinking about researching something on rocketfuel (or just...
  5. T

    Help with Homework Assignment: Two Puzzling Questions

    I am having a problem with two questions for my homework assignment. 1st question: A force of 1 N acts on a mass of 1kg for a time of 1 s. (A)What is the acceleration of the mass? (B)What speed does the mass reach? (C)How far does the mass move? Here is my answer but I think it is...
  6. N

    What Are the Fundamental Principles of Physics?

    hi.. my summer assignment for AP Physics is to write a three page paper describing the 'Principles of Physics', and to make a video that properly displays them to go along with it... i am having the hardest time finding the principles.. everytime i search i get links to college courses or...
  7. J

    Calculating Body Heat Loss and Caloric Needs: A Homework Guide

    The average human body has a surface tempreture of 30 degrees Celsius, a skin surface of 1.20m and an emissivity of 1.0. A. If the surrrounding tempreture is 20 degress Celsuis, the body's net rate of heat loss due to radiation is ________ Watts. B. How many food calories must be...
  8. B

    Why Did the Magnetic Slug Fall Slower in the Copper Tube Experiment?

    [SOLVED] Nasty Physics Assignment I was given this question by my physics teacher "You were shown a demonstration whereby two cylindrical slugs of metal were allowed to free-fall down a hollow vertical tube made of copper. One of the slugs, a magnet, took significantly longer to fall...
Back
Top