473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Variables

To All:

Folks, I need your help. I have a friend who claims that if I write:

foo = 5

then foo is NOT a variable, necessarily. If you guys can define for me
what a variable is and what qualifications you have to back you, I can
pass this along to, hopefully, convince him that foo is indeed a variable.

Thanks all!

Richard B.
Jul 19 '05 #1
1 1189
Richard Blackwood wrote:
To All:

Folks, I need your help. I have a friend who claims that if I write:

foo = 5

then foo is NOT a variable, necessarily. If you guys can define for me
what a variable is and what qualifications you have to back you, I can
pass this along to, hopefully, convince him that foo is indeed a variable.

Thanks all!

Richard B.


For example in physics formula for falling object distance:
d = (1/2)*g*t^2

In physics (math) d and t are variables and g is a constant. When you
start to calculate the distance you assign some values to the variables,
you cant touch the constant - thats the meaning of something being
constant. Or is g constant or variable?

Math:
For example if we want to visualize the speed of the object from 0 to 10
seconds we need to calculate some values to d/t graph. You do this:
t = 0, calculate d
t = 1, calculate d
....
t = 10, ...

In math you maybe call that t and d are constants, but those are
constants only for one calculation.

Programming:
In python we'd do:
---
g = 9.81
for t in range(0, 11):
d = 0.5 * 9.81 * t
print 't=%s d=%s' %(t, d)
---
it prints out:
0: 0.0
1: 4.905
2: 9.81
3: 14.715
4: 19.62
5: 24.525
6: 29.43
7: 34.335
8: 39.24
9: 44.145
10: 49.05

Constant is "variable which value is same through the program
execution", variable value can change. Knowing value of variable doesn't
make it constant.

Vocabulary and notation varies. Electric engineers might talk about
generator, in candyshop there are surely lots of wrappers, and both
soldiers and surgeons plan and execute operations.

HTH
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hal Vaughan | last post by:
First, I am aware of both SwingUtilities.invokeLater(), and of using Thread to create a new thread.  These are part of the problem. I want to have something running in the background, while the...
4
by: Torsten Bronger | last post by:
Hallöchen! I have a file that looks a little bit like a C header file with a long list of variables (actually constants) definitions, e.g. VI_ATTR_TIMO = 0x54378 .... Actually I need this...
1
by: mark4asp | last post by:
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include that file on every page. This is the best way of...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
4
by: icarus | last post by:
global_vars.py has the global variables set_var.py changes one of the values on the global variables (don't close it or terminate) get_var.py retrieves the recently value changed (triggered right...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.