Docsity

CS 110 Notes: An Introduction to Computing - Hardware, Software, and Developing Programs -, Study notes of Computer Science

Toggle sidebar
bg1
CS 110 Notes – Computing 1
Copyright C. Tanner 2009
Computing
• Hardware
o Everything goes through main memory
Including things stored on disk
o Types of computers
Super, Mainframe, Mini, Personal
• Software
o Programs and Data which make computer work
o Types
System
• Operating System
o Purpose is to control hardware and users interaction
with computer
o Examples -- Windows, Linux
• Network Software
o Allows sharing of resources and communication
between users
• Tools
o Compilers
High level languages are converted to machine
language 1-n
Input Main Memory
IR
PC
…etc
ALU
CPU
OUTPUT
IO
pf3
pf4
pf5
pf8

Partial preview of the text

Download CS 110 Notes: An Introduction to Computing - Hardware, Software, and Developing Programs - and more Study notes Computer Science in PDF only on Docsity!

Computing

• Hardware

o Everything goes through main memory ƒ Including things stored on disk o Types of computers ƒ Super, Mainframe, Mini, Personal

• Software

o Programs and Data which make computer work o Types ƒ System

  • Operating System o Purpose is to control hardware and users interaction with computer o Examples -- Windows, Linux
  • Network Software o Allows sharing of resources and communication between users
  • Tools o Compilers ƒ High level languages are converted to machine language 1-n

Input Main Memory

IR PC …etc

ALU CPU

OUTPUT

IO

o Assemblers ƒ Assembly Language programs are converted to machine language 1- ƒ Application Software

  • Allows the computer to do something specific
  • Uses the OS to manipulate the hardware
  • COTS o Commercial off the shelf o Come as is o General purpose – Word Processor, spread sheet, database, graphics, etc o Special purpose -- Communications, WWW
  • Special purpose –library, bookkeeping, Video Store, o Embedded -- Cash register, Microwave
  • Custom Built o Uses a High Level Language such as ƒ JAVA, C, C++, ADA, Basic, Prologue, SPSS, SAS, LISP etc ƒ Each has a specific grammar (rules) which must be translated by a compiler into machine language

• Developing Software

o Steps/Stages ƒ Understand the Problem

  • Determine WHAT the program must do
  • Determine test cases to demonstrate it does what it is supposed to do ƒ Design Solution to Problem ƒ Implement the solution in HLL
  • Translate the design into HLL ƒ Verify
  • Test and Debug
  • With test cases previously determined ƒ Maintain o Problem Solving Techniques ƒ Algorithm
  • General solution to a problem
  • analogies – recipe, instructions, graphics to assemble something
  • formal definition o a step by step procedure for solving a problem in a finite amount of time ƒ Solving by Analogy
  • Use as a starting point

End Repeat

o Test Cases ----

• Pseudo-Code for Sequential Statements of a General

Purpose Programming Language

o get

ƒ assign value from the user to a variable ƒ example get radius assign value given by user to the variable radius

o put

ƒ display value of variable to user ƒ example put “radius: “ + radius display the verbiage “radius:” followed by the value of the variable radius

o =

ƒ Assign variable a value ƒ Examples x = assigns the value 5 to variable x x = y+zc calculates the value of y+zc and assigns it to x

• Problems

o Calculate the Circumference and Area of Circle o Test Cases --

o Pythagorean Triples

ƒ A^2 + B^2 = C^2

ƒ For m > n a = m^2 - n 2 b = 2mn c = m^2 + n 2

o Test Cases—

o Perimeter and Area of rectangle – example 1.1 on page 19

• Homework

ƒ Page 29 # 12, 14, 16

• Steps in Developing and Executing a Program

o Use text editor to enter the program source code

ƒ Call it ProgramName.java

o Compile the program

ƒ javac ProgramName.java

o repeat above until the program is error-free

ƒ once error free bytecode version of program will be created

• java’s machine language

o combine bytecode with System utilities programs

ƒ loader

ƒ now ready to execute

o load program into main memory

ƒ interpreter

ƒ translates bytecode into machine language (JVM)