/* */

PDA

View Full Version : Any folk here who know computing stuff?



cinnamonrolls1
03-07-2018, 09:44 PM
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
Reply

Login/Register to hide ads. Scroll down for more posts
cinnamonrolls1
03-07-2018, 10:03 PM
format_quote Originally Posted by cinnamonrolls1
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?
Reply

Zzz_
03-08-2018, 12:34 AM
wa'alaikum as'salaam

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.

For example:

// declares integer variable
Dim num1 As Integer


// initializes integer variable that's already been declared
num1 = 6;

// declares and initializes integer variable at the same time
Dim num1 As Integer = 5;


Stack over flow is a great resource for programing questions.

https://stackoverflow.com/



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.

here's a video on arrays: https://www.youtube.com/watch?v=gKiNGZMuqI0
Reply

00001001
03-08-2018, 01:19 AM
Like the brother said, stackoverflow is the best website if you need help with debugging.

Here is an example of an array of a program I was working on, just today:

float[] weekYAxisCoordinates = {0.85f, 0.6875f, 0.525f, 0.3625f, 0.20f};
This is in Java btw, anyway. The reason why you would want to use an Array, is because it is easy to manipulate. Example (simplified):

for(int i = 0; i < weekYAxisCoordinates.length; i++) {
Log.d(weekYAxisCoordinates[i])
}
So, what this does is simply print/log the values you see in the array. This would be impossible if you had put them all in seperate variables.


Edit:
It is also important to know what your goal is. There are different languages for different platforms.

Website: HTML, CSS, JavaScript, PHP, MySQL
Android: Java (though Java can be used almost on any device)
etc. etc.
Reply

Welcome, Guest!
Hey there! Looks like you're enjoying the discussion, but you're not signed up for an account.

When you create an account, you can participate in the discussions and share your thoughts. You also get notifications, here and via email, whenever new posts are made. And you can like posts and make new friends.
Sign Up
cinnamonrolls1
03-12-2018, 09:21 AM
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!
Reply

SHO
03-12-2018, 12:23 PM
AsSalamu 'Alaykum
format_quote Originally Posted by cinnamonrolls1
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++
format_quote Originally Posted by cinnamonrolls1
id prefer Javascript or python
JavaScript: Video Lessons , Practice
Python: Video Lessons , Practice

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

Hope it helps.
Reply

cinnamonrolls1
03-12-2018, 01:12 PM
format_quote Originally Posted by SHO
AsSalamu 'Alaykum

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++

JavaScript: Video Lessons , Practice
Python: Video Lessons , Practice

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

Hope it helps.
Thank you! Jazakhallah khairan
Reply

Hey there! Looks like you're enjoying the discussion, but you're not signed up for an account.

When you create an account, you can participate in the discussions and share your thoughts. You also get notifications, here and via email, whenever new posts are made. And you can like posts and make new friends.
Sign Up

Similar Threads

  1. Replies: 10
    Last Post: 08-05-2009, 03:13 PM
  2. Replies: 16
    Last Post: 04-26-2009, 09:23 PM
  3. Replies: 27
    Last Post: 05-13-2007, 11:18 PM
British Wholesales - Certified Wholesale Linen & Towels | Holiday in the Maldives

IslamicBoard

Experience a richer experience on our mobile app!