Post: How To Program
03-01-2013, 07:57 PM #1
Pichu
RIP PICHU.
(adsbygoogle = window.adsbygoogle || []).push({}); Understanding this has been changed via the link, this is not my site: You must login or register to view this content.

It appears it's been added by a Mod to whom they feel it is relevant enough. I have nothing to do with that site, but I will leave it there.

You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.

Some extra sources, I'll add more to the list. Some of these will be paid courses, some will be free sources, some will be reference sites. If the list grows longer, I'll categorize them.
Last edited by Pichu ; 10-10-2015 at 08:17 AM.

The following 25 users say thank you to Pichu for this useful post:

Anastasia-, Belgyrath, Besos, BzrkArts, Conveyy, danilo_BR, HE11_PIGLET, im rich whore, iRnZ, joni_djESP, MrRa1n, Norway-_-1999, Pianist Prodigy, QuantumDev, SC0x, Specter, witchery, xkoeckiiej, xKrazy SicknesS, xMrJR, xSoulEdge, xXGRIM_REAPERXx
03-10-2013, 10:19 PM #11
|C++|
< ^ > < ^ >
Originally posted by Pichu View Post
These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
You must login or register to view this content.

All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

To Save Room, I will be posting the video versions here. The text versions will be on my site.

[multipage=Chapter 1]
1. A brief history of C#
2. What is a program?
3. How does a computer work?
4. What is the Software Development Methodologies
5. Errors in program
a. Compiler Errors
b. Run-Time Errors
c. Logic Errors

[multipage=A Brief History of C-Sharp]



[multipage=What is a program]



[multipage=How does a computer work]

You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

1. One or more processors
2. Memory
3. Secondary memory, (Hard Drives)
4. Input devices, (Keyboards, Mouse)
5. Output devices, (Monitors, Speakers)

A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

[multipage=Software Development Methodology]

A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

A common method in programming is the following:
1. Define a problem
2. Design an algorithm in order to solve that problem
3. Develop the program code from the algorithm
4. Test and ensure the code’s correctness
5. Maintain the code

Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

[multipage=Errors in Programs]

When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

[multipage=Compiler Errors]

A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

Say in C#, we were to try and compile to line:

Console.WriteLine(“Hello)

You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
After correcting the line, we would end up with:

Console.WriteLine(“Hello");


You will now notice that if you were to compile the source, that error that previously appeared is gone.
The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

[multipage=Run-Time Errors]

A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

[multipage=Logic Errors]

Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

[multipage=Chapter 2]
1. Primitive Data Types
2. Declaring and Initializing Primitive Variables
3. Identifiers
4. Literals
5. Strings
6. Comments
7. Constants
8. Assignment Statements
9. Conversion and Casting
10. Using Constructors and Methods
11. Operators
12. Classes
13. Objects

[multipage=Primitive Data Types]
Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

4. Boolean Type values, bool, are either true or false.

[multipage=Declaring and Initializing]
Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

int number;


In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

number = 5;


Variables can also be declared and initialized on the same line.

int number = 5;


A variable can also be declared as a floating-point variable of type float. We will
declare and initialize the variable name num2 and initialize it with the value 10.3:

float num2 = 10.3f;


A variable with the type float requires an ‘f’ at the end of a number, a double does not.

double num3 = 55.2;


A long requires a suffix of the letter ‘L’ after the number.

long num4 = 90000000L;


Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

char mouse = 'c';


Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

char mouse = 'cm';


bool, (Boolean) can either be true or false.

bool flag = true;

[multipage=Identifiers]
An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

1. Identifiers cannot contain spaces
2. Identifiers should start with a letter
a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
b. 4ever is not allowed, $4ever is as is Fourever
3. To replace the spaces, use the underscore
a. Hello_This_Is_A_String
4. Identifiers are case sensitive
a. Hello is not the same as hello
5. You cannot use keywords, (reserved words) as an identifier.
a. The use of string, int, long, etc will result in an error

When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
1. TutorialsMadeSimple is more legible than tutorialsmadesimple



[multipage=Literals]
A literal is a fixed value used within a program such as a number or character.
Examples of literals can be the following:

Int TutorialsMadeSimple = 455;
Float MakeMeLaugh = 3.4f;
Bool AmISmart = false;
Char modulus = ‘%’

The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

[multipage=Strings]
You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

In order to create a string variable, you must declare it:


String a;
string b;

*Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


string a = “”;

String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

[multipage=Comments]
What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

To comment, you will need to enter in two forward slash characters:

//

This tells the compiler to ignore everything after these two lines.

If you are wanting to comment out code or need multiple lines, you can use comment blocks.

/*
Everything between here is commented out
This doesn’t apply to the program
*/


a more appropriate title would be something along the lines of C# tuturial.
03-10-2013, 11:00 PM #12
Originally posted by Pichu View Post
These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
You must login or register to view this content.

All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

To Save Room, I will be posting the video versions here. The text versions will be on my site.

[multipage=Chapter 1]
1. A brief history of C#
2. What is a program?
3. How does a computer work?
4. What is the Software Development Methodologies
5. Errors in program
a. Compiler Errors
b. Run-Time Errors
c. Logic Errors

[multipage=A Brief History of C-Sharp]



[multipage=What is a program]



[multipage=How does a computer work]

You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

1. One or more processors
2. Memory
3. Secondary memory, (Hard Drives)
4. Input devices, (Keyboards, Mouse)
5. Output devices, (Monitors, Speakers)

A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

[multipage=Software Development Methodology]

A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

A common method in programming is the following:
1. Define a problem
2. Design an algorithm in order to solve that problem
3. Develop the program code from the algorithm
4. Test and ensure the code’s correctness
5. Maintain the code

Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

[multipage=Errors in Programs]

When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

[multipage=Compiler Errors]

A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

Say in C#, we were to try and compile to line:

Console.WriteLine(“Hello)

You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
After correcting the line, we would end up with:

Console.WriteLine(“Hello");


You will now notice that if you were to compile the source, that error that previously appeared is gone.
The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

[multipage=Run-Time Errors]

A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

[multipage=Logic Errors]

Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

[multipage=Chapter 2]
1. Primitive Data Types
2. Declaring and Initializing Primitive Variables
3. Identifiers
4. Literals
5. Strings
6. Comments
7. Constants
8. Assignment Statements
9. Conversion and Casting
10. Using Constructors and Methods
11. Operators
12. Classes
13. Objects

[multipage=Primitive Data Types]
Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

4. Boolean Type values, bool, are either true or false.

[multipage=Declaring and Initializing]
Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

int number;


In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

number = 5;


Variables can also be declared and initialized on the same line.

int number = 5;


A variable can also be declared as a floating-point variable of type float. We will
declare and initialize the variable name num2 and initialize it with the value 10.3:

float num2 = 10.3f;


A variable with the type float requires an ‘f’ at the end of a number, a double does not.

double num3 = 55.2;


A long requires a suffix of the letter ‘L’ after the number.

long num4 = 90000000L;


Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

char mouse = 'c';


Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

char mouse = 'cm';


bool, (Boolean) can either be true or false.

bool flag = true;

[multipage=Identifiers]
An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

1. Identifiers cannot contain spaces
2. Identifiers should start with a letter
a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
b. 4ever is not allowed, $4ever is as is Fourever
3. To replace the spaces, use the underscore
a. Hello_This_Is_A_String
4. Identifiers are case sensitive
a. Hello is not the same as hello
5. You cannot use keywords, (reserved words) as an identifier.
a. The use of string, int, long, etc will result in an error

When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
1. TutorialsMadeSimple is more legible than tutorialsmadesimple



[multipage=Literals]
A literal is a fixed value used within a program such as a number or character.
Examples of literals can be the following:

Int TutorialsMadeSimple = 455;
Float MakeMeLaugh = 3.4f;
Bool AmISmart = false;
Char modulus = ‘%’

The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

[multipage=Strings]
You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

In order to create a string variable, you must declare it:


String a;
string b;

*Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


string a = “”;

String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

[multipage=Comments]
What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

To comment, you will need to enter in two forward slash characters:

//

This tells the compiler to ignore everything after these two lines.

If you are wanting to comment out code or need multiple lines, you can use comment blocks.

/*
Everything between here is commented out
This doesn’t apply to the program
*/


that was cool
03-10-2013, 11:00 PM #13
Originally posted by Pichu View Post
These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
You must login or register to view this content.

All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

To Save Room, I will be posting the video versions here. The text versions will be on my site.

[multipage=Chapter 1]
1. A brief history of C#
2. What is a program?
3. How does a computer work?
4. What is the Software Development Methodologies
5. Errors in program
a. Compiler Errors
b. Run-Time Errors
c. Logic Errors

[multipage=A Brief History of C-Sharp]



[multipage=What is a program]



[multipage=How does a computer work]

You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

1. One or more processors
2. Memory
3. Secondary memory, (Hard Drives)
4. Input devices, (Keyboards, Mouse)
5. Output devices, (Monitors, Speakers)

A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

[multipage=Software Development Methodology]

A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

A common method in programming is the following:
1. Define a problem
2. Design an algorithm in order to solve that problem
3. Develop the program code from the algorithm
4. Test and ensure the code’s correctness
5. Maintain the code

Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

[multipage=Errors in Programs]

When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

[multipage=Compiler Errors]

A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

Say in C#, we were to try and compile to line:

Console.WriteLine(“Hello)

You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
After correcting the line, we would end up with:

Console.WriteLine(“Hello");


You will now notice that if you were to compile the source, that error that previously appeared is gone.
The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

[multipage=Run-Time Errors]

A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

[multipage=Logic Errors]

Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

[multipage=Chapter 2]
1. Primitive Data Types
2. Declaring and Initializing Primitive Variables
3. Identifiers
4. Literals
5. Strings
6. Comments
7. Constants
8. Assignment Statements
9. Conversion and Casting
10. Using Constructors and Methods
11. Operators
12. Classes
13. Objects

[multipage=Primitive Data Types]
Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

4. Boolean Type values, bool, are either true or false.

[multipage=Declaring and Initializing]
Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

int number;


In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

number = 5;


Variables can also be declared and initialized on the same line.

int number = 5;


A variable can also be declared as a floating-point variable of type float. We will
declare and initialize the variable name num2 and initialize it with the value 10.3:

float num2 = 10.3f;


A variable with the type float requires an ‘f’ at the end of a number, a double does not.

double num3 = 55.2;


A long requires a suffix of the letter ‘L’ after the number.

long num4 = 90000000L;


Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

char mouse = 'c';


Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

char mouse = 'cm';


bool, (Boolean) can either be true or false.

bool flag = true;

[multipage=Identifiers]
An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

1. Identifiers cannot contain spaces
2. Identifiers should start with a letter
a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
b. 4ever is not allowed, $4ever is as is Fourever
3. To replace the spaces, use the underscore
a. Hello_This_Is_A_String
4. Identifiers are case sensitive
a. Hello is not the same as hello
5. You cannot use keywords, (reserved words) as an identifier.
a. The use of string, int, long, etc will result in an error

When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
1. TutorialsMadeSimple is more legible than tutorialsmadesimple



[multipage=Literals]
A literal is a fixed value used within a program such as a number or character.
Examples of literals can be the following:

Int TutorialsMadeSimple = 455;
Float MakeMeLaugh = 3.4f;
Bool AmISmart = false;
Char modulus = ‘%’

The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

[multipage=Strings]
You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

In order to create a string variable, you must declare it:


String a;
string b;

*Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


string a = “”;

String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

[multipage=Comments]
What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

To comment, you will need to enter in two forward slash characters:

//

This tells the compiler to ignore everything after these two lines.

If you are wanting to comment out code or need multiple lines, you can use comment blocks.

/*
Everything between here is commented out
This doesn’t apply to the program
*/


that was cool nice job
03-12-2013, 04:40 PM #14
Originally posted by Pichu View Post
These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
You must login or register to view this content.

All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

To Save Room, I will be posting the video versions here. The text versions will be on my site.

[multipage=Chapter 1]
1. A brief history of C#
2. What is a program?
3. How does a computer work?
4. What is the Software Development Methodologies
5. Errors in program
a. Compiler Errors
b. Run-Time Errors
c. Logic Errors

[multipage=A Brief History of C-Sharp]



[multipage=What is a program]



[multipage=How does a computer work]

You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

1. One or more processors
2. Memory
3. Secondary memory, (Hard Drives)
4. Input devices, (Keyboards, Mouse)
5. Output devices, (Monitors, Speakers)

A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

[multipage=Software Development Methodology]

A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

A common method in programming is the following:
1. Define a problem
2. Design an algorithm in order to solve that problem
3. Develop the program code from the algorithm
4. Test and ensure the code’s correctness
5. Maintain the code

Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

[multipage=Errors in Programs]

When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

[multipage=Compiler Errors]

A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

Say in C#, we were to try and compile to line:

Console.WriteLine(“Hello)

You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
After correcting the line, we would end up with:

Console.WriteLine(“Hello");


You will now notice that if you were to compile the source, that error that previously appeared is gone.
The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

[multipage=Run-Time Errors]

A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

[multipage=Logic Errors]

Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

[multipage=Chapter 2]
1. Primitive Data Types
2. Declaring and Initializing Primitive Variables
3. Identifiers
4. Literals
5. Strings
6. Comments
7. Constants
8. Assignment Statements
9. Conversion and Casting
10. Using Constructors and Methods
11. Operators
12. Classes
13. Objects

[multipage=Primitive Data Types]
Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

4. Boolean Type values, bool, are either true or false.

[multipage=Declaring and Initializing]
Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

int number;


In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

number = 5;


Variables can also be declared and initialized on the same line.

int number = 5;


A variable can also be declared as a floating-point variable of type float. We will
declare and initialize the variable name num2 and initialize it with the value 10.3:

float num2 = 10.3f;


A variable with the type float requires an ‘f’ at the end of a number, a double does not.

double num3 = 55.2;


A long requires a suffix of the letter ‘L’ after the number.

long num4 = 90000000L;


Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

char mouse = 'c';


Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

char mouse = 'cm';


bool, (Boolean) can either be true or false.

bool flag = true;

[multipage=Identifiers]
An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

1. Identifiers cannot contain spaces
2. Identifiers should start with a letter
a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
b. 4ever is not allowed, $4ever is as is Fourever
3. To replace the spaces, use the underscore
a. Hello_This_Is_A_String
4. Identifiers are case sensitive
a. Hello is not the same as hello
5. You cannot use keywords, (reserved words) as an identifier.
a. The use of string, int, long, etc will result in an error

When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
1. TutorialsMadeSimple is more legible than tutorialsmadesimple



[multipage=Literals]
A literal is a fixed value used within a program such as a number or character.
Examples of literals can be the following:

Int TutorialsMadeSimple = 455;
Float MakeMeLaugh = 3.4f;
Bool AmISmart = false;
Char modulus = ‘%’

The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

[multipage=Strings]
You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

In order to create a string variable, you must declare it:


String a;
string b;

*Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


string a = “”;

String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

[multipage=Comments]
What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

To comment, you will need to enter in two forward slash characters:

//

This tells the compiler to ignore everything after these two lines.

If you are wanting to comment out code or need multiple lines, you can use comment blocks.

/*
Everything between here is commented out
This doesn’t apply to the program
*/


What am I doing wrong with this code?

PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
Info = "The Process" + ProcessID.ToString() + " Has Been Attached !";

[ATTACH=CONFIG]22694[/ATTACH]
03-12-2013, 11:47 PM #15
Pichu
RIP PICHU.
Originally posted by johnmcmil View Post
What am I doing wrong with this code?

PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
Info = "The Process" + ProcessID.ToString() + " Has Been Attached !";

[ATTACH=CONFIG]22694[/ATTACH]


I can't view the image as the viewer is messed up for me on this site.

Send me your build and I will take it a look at it; next time though, please send me a PM instead as this isn't really for asking for programming help.

(When I say build, I mean all the files in the project folder that only relate to this build. Just compress them with winrar).
03-14-2013, 12:41 AM #16
Originally posted by Pichu View Post
Thank you, well at this point it's just implementing the main idea behind C# programming. In a few more tutorials I will start the actual code tutorials.

The reason why I won't do pictures is that people can just type without realizing what it is that they are typing and, well just type.

Pictures will also cause me problems down the road because I'd have to position each and every one and just using a little CSS like I am now, it makes it look more professional and better.

In the end, it's not me that can ultimately teach you; it's you who can teach yourself. Anyone can be handed a book and read it, only those who go through it step by step and learn the process are the ones will will succeed.

I'm thinking Java will be the next area where I make tutorials.


i can agree with what u say it also applies to life's rules in general
03-14-2013, 03:05 AM #17
Pichu
RIP PICHU.
Originally posted by REAPERXx View Post
i can agree with what u say it also applies to life's rules in general

Thank you. I also updated it. I have 2 more basic programming tutorials to finish writing and I will do that when I have the free time. Then I will start the actual programming tutorials.

I am however going to require that you guys go to my site to get those tutorials for the reason that it will be a separate chapter and it's more of a demo of my site on this site while still providing great information.
03-16-2013, 07:50 AM #18
Pichu
RIP PICHU.
Thread Update: Chapter 1 and Chapter 2 is complete.

I may or may not update this thread after this post when I work on Chapter 3. Chapter 3 may be exclusive to only my website but it will introduce Visual Studio and will get out of the reasoning and concept behind programming in C#.
04-04-2013, 01:36 AM #19
Pichu
RIP PICHU.
More tutorials to be released this month! Expect Chapter 3 by the end of this month and some of Chapter 4.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo