Wednesday, January 13, 2016

Difference between For & While Loops

For Loops: 
It is a fixed repetition loop. It will run the given number of times no matter how the body o for loop code changes the values of the variables

If you have a constant (Eg. Max Students), you can run the For Loop for that many times. You can change the value of the constant. Every year you can change the value of Max Students.

The counter value increases or decreases depending upon the for loop min, max, incremental or decremented values automatically as stated per requirement- no separate statement is made within the body of for loops.

A separate variable is needed most times to run a For Loop.

When For Loop is started with a high value, we can work decreasing the counter (instead of increasing) every time the body of the For Loop is executed.

While Loop:
While loop can have various conditions and they can be joined(AND OR). The control enters the loop body only when the condition is met. If the condition is not met, the control goes to the statement following the end of the while loop body. A statements with in the while loop changes the criteria and that actually moves the control out and to the statements that are following the end of while loop body.

Wednesday, October 28, 2015

Input, Output, and Both I/O devices

INPUT:
- Graphics Tablets
- Cameras
- Video Captures Hardware
- Trackballs
- Barcode reader
- Digital camera
- Game pad
- Joystick
- Keyboard
- Microphone
- MIDI keyboard
- Mouse
- Scanner
- Webcam
- Touchpads
- Pen input
- electronic whiteboard
- magnetic key cards

OUTPUT:
- monitor
- printers
- plotters
- projector
- LCD projection panels
- computer output microfilm
- speakers
- radio

BOTH INPUT-OUTPUT:
- modems
- network cards
- touch screen
- headsets
- facsimile
- audio cards/sound card
- USB

Compilers/Interpreters/Bits and Bytes

Compilers: A compiler is when you have a program and you translate it into Binary all at once. It goes through your finished product in one go, converting it and checking for your errors.

Interpreters: An interpreter translates your program into Binary line by line. You translate each line on it's own.

If you want to be able to leave your laptop while you are translating your program into Binary, compilers are better because it is one big job done at once. For an interpreter you have to take your time translating all of your program line by line. If you have an error in your program while it is compiling, the program will give an error message so you can look through and find what you did wrong. If you want to continue compiling but you don't want your computer to stop at a certain mistake you can put */ on each side so that it becomes a comment and the computer ignores it.

Bits and Bytes: In binary, every 1 is a bit and every 0 is a bit. 8 bits is a byte and these bytes are the amount of storage that you have. Depending on which amount of storage you get, you computer can hold that many bytes of data.

Every character on the key board has a certain code of 1's and 0's that tell the computer what it is. If i press a key, it sends a signal to the computer (through the flow of electrons) to say (for example) they pressed an "A" and then it types it on the screen.

Source Program and Object Program: The source program is your program (java, c++, log) that you have written your instructions for your computer with. This is the program that we can understand easier. When you are done with your code you then you use either a compiler or interpreter to translate it into Binary code. This is now called the object code. It is your program translated into 0s and 1s.

Computer Architecture

Q: What is Computer Architecture?

A: Computer Architecture is how the computer is made and put together, or the build of a computer. This includes chips, batteries, and many other things.

Q: How does the computer understand what I type?

A: When we click a key, it tells the computer to type the letter on the key.

Wednesday, September 23, 2015

Systems Thinking

A system is the way something works. There are groups that work together to make other groups work and this slowly builds up to be a company or a school. If one of the groups has a problem it effects the system as a whole but if they work together, like they are supposed to, the system can make many things. The cooperation of all groups is really important to the success of the system. In computer science systems is what is behind all of the coding. It organizes everything to make it more convenient for the person coding and faster to use for the user.