Computer engineering - C# php asp .Net SAP SQL: February 2008

Friday, February 29, 2008

Introduction to Programming in Java

I will explain programming in Java on an example. In this example we will calculate the roots of an equation whose solution is not a complex root.Our program will give an output if the root of the equation is complex as COMPLEX ROOT!!! User will enter the coefficients of the equation.

Let us start to examine the code of the program:

import javax.swing.JOptionPane; --> This code is to activate JOptionPane function of Java.

public class hmwrk2_1{ ---> Firstly we create our class which our object will be included

public static void main (String[] args) { --->We are starting to write the main function of our code

int a, b, c; ---> Now we declare our variables which i have explained in Programming Languages article

a=Integer.parseInt(JOptionPane.showInputDialog(null,"ax^2 + bx + c \n please enter the coefficient a:")); ---> We are assigning variable a to the value which user enters




b=Integer.parseInt(JOptionPane.showInputDialog(null,"ax^2 + bx + c \n please enter the coefficient b:")); --->we are assigning the value which user enters to the variable b again

c=Integer.parseInt(JOptionPane.showInputDialog(null,"ax^2 + bx + c \n please enter the constant c:")); --->same process as above.

double x1,x2; ---> We are declaring 2 double values for roots of the equation

double delta=(b*b)-(4*a*c); --->We are declaring double delta and setting it to a equation in formula

if(delta<0){> If delta value that we calculated by the values user have entered is smaller than zero we we get the warning complex root!!!

JOptionPane.showMessageDialog(null,"COMPLEX ROOT!!!"); }


else if (delta==0){ --->If delta value equals to zero
x1 = x2 = -b/(2*a); ---> We calculate the roots as in formula.

JOptionPane.showMessageDialog(null,"root= "+x1);---> And printing one of them to the screen


}

else { ---> If the value of delta is bigger than zero
x1=(-b+(Math.sqrt(delta)))/(2*a); ---> We set x1 and x2 variables as in formula.

x2=(-b-(Math.sqrt(delta)))/(2*a);

JOptionPane.showMessageDialog(null,"root1= "+x1+"\nroot2= "+x2); ---> And printing both of them to the screen


}
}
}

Thursday, February 28, 2008

Programming Languages

Instead there is another old languages the most popular programming languages are object oriented ones such as C++ and Java. ın these two more independent one is Java since it is platform independency. Java programs can be executable on every platform since it structure.
While using these languages you define some object by creating classes and you can improve that classes by inheritance. I mean first you write a class than you get all the features of the class and adding new features to it you create a new class. For instance you create a Car class that has just gas varible (a variable is a memory area that stores the gas value of the Car you created and you can change the value by programming since it is called variable!) to improve that Car you write a BetterCar class and get the gas variable with the same type and you add DecreaseSpeed variable to it to decrease speed for example.
There is also set-oriented languages as SQL. While using SQL you get a set as output although you get a object as output by using object-oriented languages. SQL cammands are used to create a database and improve it. Adding it datas deleting datas from the database and so on. Also you can has the data set as output to your any command.In SQL the commands are called as Query. There are three platforms that you can use SQL. These are MySQL, MS SQL and ORACLE. These three are really near to each other some syntax differences occurs between them.
I have tried to explain programming languages in a general format that i can. By adding some code examples and explaining them these things that i wrote are gonna be more clear. :)

Tuesday, February 26, 2008

Data Storage

In this article i will begin with Bits and Their Storage.

Inside today's computers the datas are stored as pattern of 0's and 1's. Every 0 and 1 is called as a bit. These patterns sometime represents a numeric value or a character from the alphabet. Some boolean operations can be implemented by them.The basic operations are AND, OR. AND operation is represented with a '.' and OR operation is represented with a '+'.

AND OR
0.0=0 0+0=0
0.1=0 0+1=1
1.0=0 1+0=1
1.1=1 1+1=1

These operations are made on physically on gates which can be produced from elctrical circuits. And the level of the voltage applied to these circuits represents 1 and 0. The voltage is the input of the gate and the output is a voltage again. These two gates has two inputs and one output. Also there is another structure called as flip flop which stores the past output value and represents a new output related to it and the inputs. Another and old storage technique is core which is donut shaping ring of magnetic metarial. The more recent method is capacitor that has two small matelic plates positioned parallel. A capacitor can be charged or discharged. So one situation represents 0 and another one 1. Also a chip consist of millions of capacitors. And in conclusion the most modern method is the flash memories. In this method bits are stored by trapping electrons in champers of silicon dioxide.Full champer and empty champer represents 1 or 0.

Introduction to Computer Science

A large outline of the working principle of the computer and networks can be analised in 10 parts as:

  1. Data storage
  2. Data manipulation
  3. Operating system
  4. Network
  5. Internet
  6. Algorithms
  7. Programming languages
  8. Software engineering
  9. Data abstraction
  10. Database systems

I will explain these parts in seperate articles.

Sunday, February 24, 2008

What is computer engineering firstly ?

Composite study of electronical engineering and computer science is called as computer engineering which provides you the knowledge of both harware and software components of a computer in detail. Generally takes 4 years to gradurate. At the 4th year of the education students have to complete one or two projects on an issue that they can decide on their own. They get help from their instructors as well.By these 4 years students become an engineer and deeply expert on these core knowledge areas below:

  • Circuits and signals
  • Digital logic design
  • Electronics
  • Computer architectures
  • Algorythms
  • Different type of programming languages
  • Algorithms
  • Data Structures
  • Operating systems
  • Database design and management
  • Computer organiztions
  • Software engineering
  • Information systems and analysis
  • Computer networks
  • Embeded systems
  • Social and professional issues