What is Assignment: Definition and 357 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. Kami_Munchkins

    Signal Generator assignment, Multisim results confuse me

    TL;DR Summary: Hi, i'm trying to talk about the results, this is a research assignment so i have no support Hello, so here is the circuit. Its a basic signal generator, My issue is in the practical version, the potentiometer effected frequency, but in the simulation this is not the case... I...
  2. Ashish Somwanshi

    Matrix representation in QM Assignment -- Need some help please

    This screenshot contains the original assignment statement and I need help to solve it. I have also attached my attempt below. I need to know if my matrices were correct and my method and algebra to solve the problem was correct...
  3. shivajikobardan

    MHB Solving UnboundLocalError for Python Iterative Deepening Depth First Search

    This code is for iterative deepening depth first search in python. # Python dictionary to act as an adjacency list graph = { '7' : ['19','21', '14'], '19': ['1', '12', '31'], '21': [], '14': ['23', '6'], '1' : [], '12': [], '31': [], '23': [], '6' : [] } visited=[] goal='31'...
  4. Andreas S-H

    What are some recommendations for a math and physics topic in high school?

    Hello everyone, I am preparing to write an assignment in math and physics. This assignment will be a sort of exam, where I have to defend it at a later date, I can choose whatever topic I like, as long as it contains math and physics. I need to find something to be my thesis statement (i think...
  5. Andy Resnick

    Media Literacy assignment: suggestions?

    I am toying with the idea of introducing a 'media literacy' assignment in my intro physics course this fall; my hope is to find a 'reputable' and a 'biased' report on a science topic that I can redact bylines/organizations from and have students compare/contrast. Thoughts? And I'm probably...
  6. T

    How do I reference a photo taken from the assignment question?

    How do I reference a photo taken from the assignment question in Harvard style?
  7. S

    Assignment on the tight binding model

    Summary:: Due tight-binding model I derived the energy spectrum of the particle, showing that it comprises three energy bands E+(k), E−(k) and E0(k)=0. Now, I have to find the dispersion laws. Why do I have a flat energy band? What is its physical significance?. Also, what happens to the...
  8. J

    Finding Values Using Fe-C Diagram for Materials Engineering Assignment

    Summary:: Need help with finding values using Fe c diagram Hi, I'm doing a materials engineering assignment. In the assignment they require us to make 3 swords being given martenistic steel bars with dimensions 40x100x1000mm with a composition of Fe-0.76wt.%C (eutectoid composition). Sword A...
  9. L

    Engineering Can somebody check assignment before I submit (maths)

    Hi Can somebody check my assignment I did it just need check before submitting
  10. S

    Solving a Problem in My Assignment: X1, X2, and X3

    This is just a small part of a question I have in my assignment and I'm not sure how to solve it, nothing in my eBook or our presentation slides hints at a similar problem, what I tried was I noticed that X1 and X2 have the difference of (3,3,3) and I assume either X3 = (3,3,3) or X3 = (7,8,9)...
  11. ahbin98

    Engineering Mechanical Vibration Assignment Help

    I just need any simple calculation that can be made, anyone who willing to help me out please contact me
  12. R

    I Who copied the assignment?

    If someone is lying, who copied the assignment? Alex: Cate copied the assignment. Cate: David copied the assignment. David: Cate is lying. Keil: I didn't copy.I think Cate is lying. If Alex is true and there is only one person who is lying, Cate and David can't be true at the same time. If...
  13. J

    Work, Power and Energy assignment marked wrong somehow? :(

    All of my working out is attached with the photos, I'm struggling to do anymore as the tutor hasn't explained anything like this yet. Any help would be much appreciated
  14. H

    MHB Advanced Mathematics Assignment

    Hi guys, I am in desperate need for help with my assignment in advanced maths. In my assignment, I am required to use geogebra to support in answering the given questions. If someone can help me, that will be greatly appreciated.
  15. C

    Help with Thermodynamics assignment

    Hi, I am doing a level 3 engineering diploma, myself and the rest of my class are struggling to answer most of the questions on the attached assignment paper particularly questions 2, 4, and 6 and 7. I have worked out q1 to be 7.3 icebergs per year needed and 7.3 x 10^3 volume needed. Most of...
  16. M

    I Larger assignment on Vector Fields

    Dear everyone. I'm doing an assignment on vectorfields and for most of the assignment I have to deal with tensors and tensornotation. The first assignment asks me to express the following vector and matrixproducts in tensornotation. $$\overline c = \overline a + \overline b \\ d=(\overline a +...
  17. MathematicalPhysicist

    Problem 16.1 of Ashcroft and Mermin, assignment (b)

    Homework Statement I am stuck in solving problem 16.1b in the attachment there's a pic with the question itself. Homework Equations $$(16.9) \bigg( \frac{dg(k)}{dt}\bigg)_{coll}= - \frac{[g(k)-g^0(k)]}{\tau(k)}$$ $$(13.21)g(k,t)=g^0(k)+\int_{-\infty}^t dt'...
  18. devilish_wit

    Uniform Circular Motion question

    Homework Statement While learning to drive, you are in a 1 320-kg car moving at 34.0 m/s across a large, vacant, level parking lot. Suddenly you realize you are heading straight toward a brick sidewall of a large supermarket and are in danger of running into it. The pavement can exert a...
  19. davidfur

    Fortran Assign 2D Array with Reals in Fortran - Help Needed

    Hi guys, On with my Fortran adventures...I'm trying to accomplish a simple task: assign a 2D array with some reals. Here's an excerpt from the code: subroutine get_energy_and_grad(natoms_,coords,ereal,gradmat) include 'cbka.blk' include 'opt.blk' integer, intent(in) :: natoms_...
  20. J

    Bungee jumping dynamics assignment

    Homework Statement A formula has been determined: d=l+h+ (l(SRT(m(m+150))+m)/75), where d is the depth jumped to, l is the length of the rope, h is the height of the jumper and m is the mass of the person. The question is: At present, the model does not include air resistance. Show and discuss...
  21. DvdP

    I need some help for the verification of an assignment about pendulums

    Hello, my name is Django and I live in the Netherlands. I've got an assignment for physics about pendulums and part of this assignment is that I need to verify my result with someone else in a country with a different gravitational force (the gravitational force were I live is 9.813 N/m2). I...
  22. K

    C/C++ Copy Assignment Operator for CarCounter Class

    Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *this. Sample output for the given program: Cars counted: 12 #include <iostream> using namespace std; class CarCounter { public: CarCounter(); CarCounter&...
  23. S

    Water Supply Reliability Modeling assignment + datasheet

    I am taking a my first water management course and I need your help getting through my first Water Supply Reliability Modeling assignment. It involves a data set that I must manipulate and a problem set. I am not a civil engineer, so I do not know where to start with this. The only hint I have...
  24. E

    Write a function that will find a temperature....

    Hi everybody, I seem to be having trouble coding a function that returns the integer value at which degrees celsius is equivalent to degrees fahrenheit. Here is the question: Write a function that will find a temperature that is the same in both Fahrenheit and Celsius. First define two...
  25. B

    Water Bottle Design Using Polynomials

    Homework Statement [/B] I am to design a 600mL water bottle by drawing one side (bottle lying horizontally). Three types of functions must be included (different orders). The cross-sectional view would be centred about the x-axis, and the y-axis would represent the radius of that particular...
  26. Vitani11

    Comp Sci Help with coin game C++ assignment?

    Homework Statement Here is the prompt: Write a program that does the following: Welcome the user to the game and ask them if they want to play. They should type y or n for yes or no. Store this value in a char variable. If they type y, continue on with the game. If they type n, print the...
  27. Worthatry

    Freewheeling bicycle and friction

    Background question: A bicycle and rider have a combined mass of 75 kg. They freewheel down a slope whose maximum height is 6 meters above sea level. The slope is 20 meters long. At the end of the slope, the bicycle and rider are traveling with a velocity of 10 m/s. Calculate the work done...
  28. Unteroffizier

    Find Absolute Magnitude, distance and "T" of binary star system

    This is the problem given at my basic astronomy course. If I turn it in within a month correctly, I get 10 extra points in the finals. Problem: We have binary star system consisting of Star A and Star B. Astronomers have observed it for 11 years, during which it has moved from point A to point...
  29. ChrisVer

    What is the best way to avoid copying objects in an assignment operation?

    I have written the following class: class Rectangle{ private: double length; double height; const char* name; public: Rectangle (){}; Rectangle (double l, double h, const char* n) : length(l), height(h), name(n) {}...
  30. W

    IP Address Assignment: How are IP Addresses Assigned?

    Hi All, I am just curious. I am in a coffee shop using the internet. My (external) IP address in this coffee shop ( given by whatismyip.com) is the same as the IP address assigned to me at home by my ISP. I thought IP addresses are assigned dynamically when one logs into a network and the...
  31. M

    Assignment Operator Overloading Question

    Hey everyone. First I am new to programming (so my vocabulary and skills are not very proficient with C++), and I'm learning operator overloading. I have questions about line 1 and lines 5-8 of this code. Mod note: changed quote tags to code tags to preserve indentation. NumberArray&...
  32. Al_Pa_Cone

    Mechanical Principals Assignment Question

    I have a long question in my assignment with many part answers and I would just like to know if I have answered them correctly as I have spend a lot of time on it. can anyone help? My Question is: The component shown in Fig 1 is made from a material with the following properties and is...
  33. J

    Fortran Integer overflow on assignment

    Hey guys, I have an assignment on fortran, which basically is supposed to read grades of a class and print them in alphabetical order and wether if the student failed or passed the class. We're supposed to do everything using our basic knowledge of fortran. When I run it it says 'integer...
  34. Al_Pa_Cone

    Mechanical Principles -- Assignment question

    Can anyone help me? I have a question with 3 part answers on my Mechanical Principles assignment. I believe I have answered question part 'a' and 'b' but I have been stuck on question part 'c' for days! So the question is: Q5. The simply supported beam shown in FIG 4 is 5meters long with a...
  35. SuperSusanoo

    Need help with compilers assignment

    Homework Statement I am totally lost with this assignment. I don't even know what to study in order to do it. I posted a file with the main feature of the assignment, so I am just wondering if you can orient me little bit. Any advise would be useful First of all, what is a scanner and how does...
  36. kostoglotov

    Is there a mistake in the assignment?

    Homework Statement I'm actually a tutor, and a student of mine at uni has the following differential equation with initial conditions to solve imgur link: http://i.imgur.com/ptuymQv.gif From y(t) = c_1sin(3t) + c_2cos(3t), it is not possible to solve for the constants using the given...
  37. S

    Engineering Students Academic Discussion

    Hi guys, I am doing a quick survey here. I am not sure this is appropriate in this section but here it is. If your are an engineering students, could you guys please comment on: 1) Who do you ask when you stuck on study-related questions (eg. lecture note, tutorial, assignment questions...
  38. P

    Calculus Assignment Help: Temperature & Daylight Equations Explained

    Homework Statement [/B] 1. When a certain object is placed in an oven at 540°C, its temperature T(t) rises according to the equation T(t) = 540(1 – e^–0.1t), where t is the elapsed time (in minutes). What is the temperature after 10 minutes and how quickly is it rising at this time? I have...
  39. V

    Gross Wage Assignment Homework: Solve for Bangladesh, China, DR & Haiti

    Homework Statement Have to write a program that outputs the users gross wage. If the hours are over 40 then the hourly rate gets multiplied by 1.5. We also have to output the salary people would get from different countries: Bangladesh 0.15 cents China 0.48 cents Dominican Republic 1.60...
  40. G

    B What are some modern issues in the world of Nuclear physics?

    Hello! I was just wondering what this community is aware of in the world of modern nuclear physics. To be specific, for my assignment I am asked to research a topic or issue that is related to nuclear physics (and has relations to our daily lives). Some examples provided are: The use of...
  41. W

    MHB Debugging I/O Assignment: Structure Logic & Solve Problems

    Working on an I/O assignment and I'm running into some logic errors. I was wondering if I could get a quick break down (not necessarily code, but the pseudo code behind some of these points I'm supposed to be working on. That way I don't get spoiled with the answers, but have enough to go on...
  42. Physics Dad

    Electric Field Strength - Assignment Question

    Homework Statement The Nucleus of a helium ion contains two protons approximately 5x10-15m apart. They can be considered to be surrounded by one orbiting electron approximately 5x10-11m away. Calculate the following: a) The electrostatic force between the two protons b) The electrostatic...
  43. N

    What Could Have Saved the Titanic from Sinking: A Scientific Analysis

    Homework Statement I'm starting on 2 assignments which is Science and Physics and I have to come up with a theme/practical investigation to talk about on my chosen topics. Homework Equations What is an interesting topic to talk about which I can gather a lot of information on? I have chosen...
  44. I

    I need some hints for my assignment please

    I just need some guidelines, you don't have to write code for me, I'm not looking for someone to write code for me. briefly, for my assignment I have three ponds, which are connected with each other (like a triangle), and there's chemical spill of x liters that could start in pond 1, the rate...
  45. GZM

    Complicated Kinematic problem dealing with falling

    Homework Statement Problem states : A student walks off the top of the CN Tower in Toronto, which has height h and falls freely. His initial velocity is zero. The Rocketeer arrives at the scene a time of t later and dives off the top of the tower to save the student. The Rocketeer leaves the...
  46. GZM

    What is the ideal value of T for the rocket to reach 990 m altitude?

    Homework Statement Problem : During your summer internship for an aerospace company, you are asked to design a small research rocket. The rocket is to be launched from rest from the earth’'s surface and is to reach a maximum height of 990 m above the earth'’s surface. The rocket’'s engines give...
  47. A

    Prototype Project: Linkages using Popsicle Sticks

    Hi, this is my first post. I need some ideas for my prototype project using linkages. We are required to use recycled materials like popsicle stick as a link. Our instructor ask for an equipment or device that has an input motion and output useful work. Thank you.
  48. A

    C Programming - First assignment not sure how to approach

    Homework Statement Hi, I am currently in a C programming course and i have no background knowledge of programming whatsoever. The professor in my course isn't very good at explaining so I'm a bit lost here. (Please keep in mind, I am NOT asking anyone to do this for me. I would like to know a...
Back
Top