Salams all, im revising for a coursework thing in computing that counts for 30% of my final grade and i have to do by myself in class under test conditions with basically no help. I was wondering if someone could basically explain to me what it means to declare a variable in programming? I dont really get what the point of the declaration is apart from it basically identifying that a variable is gonna come next. Also does anyone here have any knowledge of visual basic( version 6.0)?
Sorry for the long questions!
Thank you, jazakallah khairan
Salams all, im revising for a coursework thing in computing that counts for 30% of my final grade and i have to do by myself in class under test conditions with basically no help. I was wondering if someone could basically explain to me what it means to declare a variable in programming? I dont really get what the point of the declaration is apart from it basically identifying that a variable is gonna come next. Also does anyone here have any knowledge of visual basic( version 6.0)?
Sorry for the long questions!
Thank you, jazakallah khairan
Also( sorry!) what is an array like how does it work?
VB is so old school, who teaches that anymore? even in HS these days, students are taught programming with java or some open source language.
Declaring a variable reserves a name and some space in memory for a variable of the specified type, but doesn't give it a value. Initializing gives the variable a value. Depending on how you're going to use the variable, you can declare it without initializing it and then initialize it later, or declare and initialize at the same time.
An array is a list of items, a bit like a shopping list. It allows you to store more than one item in only one variable.Think of it like this. When writing your shopping list, you could use a separate piece of paper for each item you need to buy (a variable). However this is silly and unneeded—could you imagine how hard it would be to carry all that paper around with you? So, you use one piece of paper for all of your items. This one piece of paper is your array.
Youtube is a good resource also for tutorials on this stuff.
Sorry for the late reply, i just saw yall had replied now but thank you all so much!! Yeah im not a VB fan but my school uses it( idk why tbh, id prefer Javascript or python) thank you all again!
I was wondering if someone could basically explain to me what it means to declare a variable in programming? I dont really get what the point of the declaration is apart from it basically identifying that a variable is gonna come next.
Declaring a variable is like dedicating a space in memory where you can store a value.You might be able to recognize variables,but computers don't.So you must declare them.
More: The Memory game-Intro to variables in Java (vid)
format_quote Originally Posted by cinnamonrolls1
Also( sorry!) what is an array like how does it work?
Collection/group of similar type of data elements.Often used instead of declaring multiple variables often useful while using loops.
More: Arrays in C++
Udacity and Codecademy are very good sites to learn programming(Basics).
Also, StackOverflow is a forum(QA Site) for programmers.(But I warn you that their rules are annoying).
Declaring a variable is like dedicating a space in memory where you can store a value.You might be able to recognize variables,but computers don't.So you must declare them.
More: The Memory game-Intro to variables in Java (vid)
Collection/group of similar type of data elements.Often used instead of declaring multiple variables often useful while using loops.
More: Arrays in C++
Udacity and Codecademy are very good sites to learn programming(Basics).
Also, StackOverflow is a forum(QA Site) for programmers.(But I warn you that their rules are annoying).
Hey there! Looks like you're enjoying the discussion, but you're not signed up for an account.
When you create an account, we remember exactly what you've read, so you always come right back where you left off. You also get notifications, here and via email, whenever new posts are made. And you can like posts and share your thoughts.
Sign Up
Bookmarks