CSCI 1301
COMPUTER SCIENCE I
INTRODUCTION TO JAVA AND PROBLEM SOLVING
AGENDA
Algorithms
Programming Languages
Java
Parts of a Program
Problem Solving
INTRODUCTION
The thought process that computer scientists employ to develop
algorithms is more important than the algorithm itself.
Algorithm
Step-by-step description of how to accomplish a task
PROGRAMMING LANGUAGES
Program
A list of instructions to be carried out by a computer
Can be executed
The act of carrying out the instructions contained in a program
Stored internally as a set of binary numbers
Machine language
PROGRAMMING LANGUAGES
Editor
Source File
Compiler
Executable
JAVA
Editor
Source File
Compiler
Bytecode File
Windows JVM Mac JVM Linux JVM
JAVA
Procedural
Procedures are a set of statements that, together, perform a
specific task.
Object-oriented
OOP
Based on creating objects
Software entity that contains data and procedures
Attributes
Methods
PARTS OF A PROGRAM
Keywords
Words with special meaning in the programming language
Can only be used for their intended purpose
Operators
Symbols or words that perform operations on one or more
operands
Punctuation
Serves specific purpose such as marking the beginning or end of a
statement
PARTS OF A PROGRAM
Programmer-defined names
Used to identify storage locations in memory
AKA identifiers
Syntax
Rules to be followed when writing a program
PARTS OF A PROGRAM
Lines vs. Statements
Line
Single line as it appears in a program
Statement
Complete instructions that causes the computer to perform some action
Variables
Store an item of data in memory
May change during execution
HOW TO PROGRAM
Problem Solving Steps:
1. Identify/Understand the Problem
2. Design/Walkthrough a solution
3. Map solution to program elements
4. Code the solution
5. Test and Refine