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. S

    A few questions on a HUGE derivatives assignment

    Hi physics forums, this post may seem like it has lots of questions, but don't think that you are doing ''my homework for me,'' it's actually a huge assignment, in which I am only going to ask a few questions about. this question is actualy easy (or seems to be), but i keep getting 64/3...
  2. M

    Calculating O2 Weight Needed for 100g NH3 Reaction | Step-by-Step Guide

    Homework Statement What weight of O2 in grams will be required to react with exactly 100 grams of NH3 ascending to the eq. NH3+O2--->NO+H2O Homework Equations I think none. The Attempt at a Solution I don't have any attempt on this problem because my brother only ask for my...
  3. N

    Fortran Fortran77 statement - character assignment

    fortran77 statement -- character assignment Hi, I am porting an application written in fortran 77 to linux. The following code compiles well with IBM xlf compiler on AIX. However, when I use g77, it fails with the following error:foo.f:6: + var /ZFF/...
  4. L

    Special relativity assignment - pole moving in two dimensions

    Hi! I'm a bit stuck with this special relativity assignment, here's is the problem: So the problem here is that not only does the hole shrink in S', as stated in the problem description, the pole should also be wider by a factor of 3 in this frame. So we have an 18 ft wide pole that has to...
  5. A

    Very Basic Maths Assignment (sorry i'm a newbie) based on profit and graphs

    Homework Statement Firstly I'm sorry to bother all of you that will find this question really basic but I haven't studied Maths since GCSE 7 years ago and I am now doing a degree in Engineering without A Level Maths so any help would be great...I need to work out the algebra and the main...
  6. F

    Multi-threading/Structs in C assignment

    Hi all, Although my homework assignment centers around practicing multi-threading type stuff (by implementing a ring buffer), my question is more centered on trying to figure something out that has nothing to do with multi-threading but nevertheless has me stumped on the assignment itself...
  7. B

    Centripetal Motion Velocity vs. Position Angle Assignment

    1. Show that the angle between two position vectors is equal to the angle between two instantaneous velocity vectors eg. v1 and v2 when v1 and v2 are conncected tail to tail in a uniform circle. No angles are given, it is just general. 2. Has to be proven without calculus. No information...
  8. H

    MATLAB [MATLAB] Subscripted assignment dimension mismatch.

    Halo everyone, I am trying to consider a dice game using MATLAB. I used 'r=randi(6,a,b)' to get random number from MATLAB.Also run it for 200times.(a=a:1:x,b=b:1:y) Then used '[a,b]=mode(r)' to get the highest frequency value and add them together then put them in the table. For x=1 with y=1,2...
  9. T

    Tricky stats question from assignment

    Homework Statement 265 students hire a tutor to help them improve their scores on the SAT test. The results are summarized in Math and Verbal score changes. Math: Mean change in score = 19, Standard Deviation of score changes = 65 Verbal: Mean change in score = 7, Standard Deviation of...
  10. S

    Kinetics Assignment - Reaction Orders

    Homework Statement The concentration of the reactant A has been studied as a function of time. By a suitable plot of the data below, show that the reaction is first order, and determine the rate constant, k, and the half-life, t1/2. Use the integrated rate equation to determine [A] when t =...
  11. T

    Materials Balance question for assignment. Help needed.

    Hi guys, I'm currently doing an assignment which seems to be beyond my knowledge and would like to ask for some helps. There are 2 questions I am currently stuck on: 1] A natural gas analyzes CH4, 80.0 percent and N2, 20.0 percent. It is burned under a boiler and most of the CO2 is scrubbed...
  12. L

    How Can We Minimize Prediction Errors in Binary Variable Analysis?

    Homework Statement Let Y be binary variable P(Y = 1) = P(Y = 0) = 0.5 and X a random variable uniform on [0,5] when Y = 0 and uniform [4, 9] when Y = 1. Draw mean of X and P(Y = 1|X = x) as functions of x. What is the minimum probability of rejection to predict Y from X without mistake...
  13. W

    Summer Assignment Problem Help

    Homework Statement Density + Uncertainty of block? The mass of a rectangular block is measured to be 2.2 kg with an uncertainty of 0.2 kg. The sides are measured to be 60 +/- 3mm, 50 +/- 1 mm, and 40 +/- 2mm. Find the density of the block in kilograms per cubic meter, giving the uncertainty...
  14. 1

    Math 360 Assignment, math grammatically

    Homework Statement Decide if each of the following is a sentence or not. If the item is a sentence, is it true or false? Give a reason for your answer. If it is not a sentence, identify the part of speech. x^2 - x - 12 x^2 - x - 12 = 0 x^2 - x - 12 = (x-3)(x+4) Homework...
  15. G

    Stuck on Physics Assignment: Find Force & Distance

    Hello everyone, This is my first time in Physics forums so forgive me if I stray from the convention for asking questions. Me and a friend are completely stumped on our first assignment for the year and we are not sure where else to turn! Homework Statement A particle of mass m can...
  16. H

    Electromagnet investigation lab assignment

    Homework Statement An alpha particle enters a uniform verical magnetic field of 1.0 T with a velocity of 2.0m/s East. a) Find the force exerted on the particle by the field. b) Find the acceleration of the particle. c) Find the radius of curvature of the path of the particle. Homework...
  17. S

    Hi,I'm in high school and have been given an assignment regarding

    Hi, I'm in high school and have been given an assignment regarding heat, which is a term I don't fully understand mainly because any definition I have come across makes use of the term Energy. This leads me to my question: What is energy? I know of the existence of the thread 'What is...
  18. N

    Matlab/C++ assignment help much needed

    Hi, I'v got the following assignment through to complete my course. I'm a bit rusty so I am really having a hard time understanding what I'm supposed to be doing here. If someone can give me the brief, basic outline of how to complete this and if C++ or Matlab would be better/easier to do it...
  19. K

    Accuracy of Resonance Lab Experiment

    Homework Statement Hi! We did a resonance lab using a closed air cloumn and 3 different tuning forks, each with different column lengths and i collected the data as follows: frequency(hz) column length(m) # of wavelengths wavelength(m) speed of sound air temp 384...
  20. A

    Assignment question, two charges electric field

    Homework Statement Two charges q1 and q2 are 11cm apart and have an electric force between them of 6e-6N. If the charge on q2 is increased by 12 times and the distance between q1 and q2 changed to .44cm, what is the new electric force between these charges? q1 ? q2 ? distance (1) 11cm...
  21. G

    Physics Car Assignment : rubber band car

    1. i have a physics project where we have to make a car that accelerates the fastest during 3.0 m. it also must be accelerating for the whole 3.0m. I am using a simple rubber band car where the rubber bands are attached to both axels and are wound up. i have to make a bunch of calculations but...
  22. N

    Physics's projectile motion assignment

    Homework Statement a beginning darts player aims a dart directly at the bullseye. the dart reaches the dartboard 0.25 s after throwing the dart. how far below the bullseye ill it land? Homework Equations The Attempt at a Solution
  23. N

    Physic's projectile motion assignment

    Homework Statement a projectile is launched from a point A and travels a horizontal distance of 28m. it spends a total time of 1.4 seconds in the air. (a) calculate the horizontal velocity of the projectile. (b)what is the magnitude and direction of the projectile's velocity at point B. Give...
  24. M

    Maximizing Angle Theta on a Line AB: Calculus Assignment Help

    Homework Statement http://i1183.photobucket.com/albums/x476/Laura_Petrea/4-7-69.gif "Where should the point P be chosenon the line AB so as to maximize the angle theta" how would i do this question?
  25. I

    Help Needed: Solving Homework Assignment on Beat Frequency

    So I had a homework assignment which I couldn't complete in time. One of the questions was what the title is about. I also asked for help earlier in the homework section. See my post: https://www.physicsforums.com/showthread.php?t=487676. Right now I just want to learn how this works for the...
  26. O

    Assignment makes pointer from integer without cast

    "assignment makes pointer from integer without cast" elephant* get_elephants() { elephant *current, *first; int response; /* create first node */ first = (elephant*)calloc(1,sizeof(elephant)); /* THIS LINE */ current = first...
  27. C

    Will Ambient Temperature Affect Solar Cell Energy Absorption?

    Homework Statement A solar cell being placed into different ambient temperature environments, with the same amount of energy from a single light source being shined onto the solar cell and viewing and recording the result. I need help writing a hypothesis on why I think it is not going to...
  28. mccoy1

    Vector Spaces: Determining Subspaces in R^3 and R^2

    Homework Statement Which of the following are a vector spaces? (a)R = {(a,b,c) 〖 ∈R〗^3 │ a+b=0 and 2a-b-c=0} (b)S = {(a,b)∈ R^2│ a^2=b^2 }..., can I say a =b which will make things simpler? (c)T = {(f∈P_2 (R)│ f(1)=f(0)+1} Homework Equations The Attempt at a Solution...
  29. K

    Why is Python Telling Me My Variable is Not Defined?

    Homework Statement Hi. So I'm stuck on a few things right now, but the main one is that Python is telling me that one of my variables is not defined. I have stressed over this for about an hour now trying everything to change it, and I cannot seem to find issue. Homework Equations...
  30. T

    Converting Waste Heat to Electricity: An Assignment Exploration

    As an assignment i need to figure out the most efficient way to convert heat to electricity and so i searched through the internet and came across Prof. Hagelstein's work which is called semiconductor technology. In short, the technology is based on the principle of thermionics by replacing a...
  31. L

    Physics In Space Assignment - Year 12

    Can someone please break this task down as I'm so confused :'( It's due tomorrow and I would of done it sooner but I had in real life issues :\ Research into the shapes of orbits that exist in our solar system, including the motion of planets, comets, moons and satellites. I found some...
  32. L

    Physics In Space Assignment - Year 12

    Can someone please break this task down as I'm so confused :'( It's due tomorrow and I would of done it sooner but I had in real life issues :\ Research into the shapes of orbits that exist in our solar system, including the motion of planets, comets, moons and satellites. I found some...
  33. S

    Help Assignment due tonight Sound And Waves Question

    Homework Statement The sound intensity level 15.0 m from a point source is 64.0 dB. At what distance will it be 53.0 dB? Homework Equations Beta = 10log(I/Io) I2=(r1/r2)^2 I1 The Attempt at a Solution Found the intensity of 64dB @ 15m I1= 2.51*10^-6 Found the intensity of...
  34. R

    Last question in my assignment

    Firstly I have no idea how to tackle this one, I am not sure if we've been taught it yet or if its sort of a lead on to the next set of topics.. Homework Statement The shear stress t in a shaft of diameter D under torque T is given by t = KT / \PiD3. Determine the approximate error in...
  35. N

    How to Solve Dynamics of Rigid Bodies Problems Involving Friction?

    Please Help! Mechanix problem assignment Homework Statement Please help me do my assignment in dynamics of rigid bodies. It's more on kinetics of particles and I have difficulty in figuring out how to draw the free body diagram of the blocks.. Question 1: The 20 lb block A and the 30 lb...
  36. S

    Assignment about Extreme Sports

    Homework Statement I'm writing an assignment about Extreme Sports, including Skydiving and Bungee Jump, and since I'm not that good at physics, I was hoping that maybe some of you guys could help me! I am to analyze a skydiver, and chop the fall into phases, and use both math and physics...
  37. L

    Assignment problem on Operational Amplifier

    The question is as given in the image attached entitled 'amplifier question' I would just like someone to check my working and verify whether it's correct or not. Thanks. And also want to ask on the second part which is 'what mathematical operation does this circuit perform?' Any help would be...
  38. W

    How Do I Calculate the Net Force on Corner A in an Equilateral Triangle?

    Homework Statement There's an equilateral triangle with three objects on every corner. Corners named A, B, and C. The mass of each: A - 5.5 kg B - 7.5 kg C- 10.0 kg The sides of the triangles are also 5.0 cm each. There are no other forces acting on the corners. How do I calculate the net...
  39. P

    Understanding the Hall Effect in Semiconductors

    Homework Statement There are 4 questions in the assignment. None of them need calculation. The questions is as attached below. Homework Equations None. The Attempt at a Solution 1. I think the "photoconductivity" is a typo, should be replaced with "photoconductor". From Wiki, I...
  40. G

    What Factors Determine the Stability of a Ladder Against a Frictionless Wall?

    Homework Statement we just learned the concepts of statics TODAY and were given an assignment immediately, so any help would be appreciated. A window washer attempts to lean a ladder against a frictionless wall. He finds that the ladder slips on the ground when it is placed at an angle of...
  41. A

    Comp Sci Why Is My C++ Program Not Running as Expected?

    Hi. I need help with in running my program, when I tried it in the computer lab, my program didn't run..And I'm sure it couldn't run because of my workings..which I assume are incorrect. I appreciate it if you could tell me where did I go wrong with my calculations and if it matched the...
  42. M

    Differential Equations Assignment (small step needs clarification)

    When given y'' + ay' + by + c = 0 The characteristic equation is: λ^2 + aλ + b = 0 Now I'm making a substitution of e^(λx) to get [(λ^2 + aλ + b)][e^(λx)] = 0 double root : [(λ - alpha)^2] [e^(λx)] = 0 My question now is that if I were to do the same thing with the...
  43. M

    Tough assignment question - help would be appreciated

    As a moon follows its orbit around a planet, the maximum gravitational force exerted on the moon by the planet exceeds the minimum gravitational force by 11%. Find the ratio (r)max/(r)min where (r)max is the moon's maximum distance from the center of the planet and (r)min is the minimum Ok...
  44. M

    Dynamics & Kinematics Assignment Question. Am I on the right track?

    1. At a time when mining asteroids has become feasible, astronauts have connected a line between their 3500-kg space tug and a 6200-kg asteroid. Using their tug's engine, they pull on the asteroid with a force of 490 N. Initially the tug and the asteroid are at rest, 450 m apart. How much time...
  45. J

    Which CAD Software is Best for 3D Design Assignments?

    So I have a design assignment, I need to construct some 3D CAD drawings. I have basic exp with Pro/E but I've heard Solid works is the best software to use. So out of AutoCAD Inventor / Solidworks / Pro Engineer. Which is the most straight forward on to use?
  46. P

    Assignment of Variables Help | Speed Addition Eqn Explained

    Assignment of Variables please Help! Ok well I am very confused on what variables you assign for the velocity addition equation. What is U' , U , and V? like let's say 2 rockets heading toward each other and I want to find the speed i see if I'm on one of those rockets. Also as a bonus I...
  47. R

    What formulas do I need to solve the above problems?

    I was going to put this up in the homework forum, but I feel the folks down here are more capable of helping me out. I have to do an assignment, but I cannot go in for office hours to get help from my professor. Regretfully, I lost the sheet and forgot to grab another until just a few days...
  48. B

    Observation Deck Assignment - Tension in Cables

    Homework Statement For my engineering assignment we are working in a group to research, build, test, and write a report on an observation deck. The little fork in the road we've hit is determining the tension in the cables. There needs to be a moment produced once there is between 20 and...
  49. R

    A different loop-de-loop assignment

    My physics teacher gave us this follow-up to the classic loop-de-loop assignment where you have to calculate the height from where you have to drop a ball in order for it to just make it round the loop. The problem with this assignment is that our teacher refuses to help us, and there are no...
  50. F

    Stumped on LC-3 Assembly Assignment (Extended Unsigned Multiplication)

    Homework Statement I've already figured out the code for part 1 of the assignment. I'm stuck on part 2. Specifically, I'm not sure how one would obtain the values for the multiplier and multiplicand from R6, as the notes from the professor in the code claim, nor how to format the result in...
Back
Top