Upload
allyson-may
View
217
Download
0
Embed Size (px)
Citation preview
CIS 120
Problem Solving Programming Java
Problem Solving
Problem-Solving: the process of defining a problem, searching for relevant information and resources about the problem, and of discovering, designing, and evaluating the solutions for further opportunities.
Very desirable to be a good Problem Solver in any CIS discipline.
Polya’s – How to Solve a Problem?
Understand the Problem Devise a Plan Implement the Plan Evaluate/Examine the Solution
Understand the Problem
First. You have to understand the problem.
What is the unknown? What are the data? What is the condition?
Draw a figure. Introduce suitable notation.
Devise a Plan
Review prior experience Find connections between the
knows and unknowns. Simplify problem into a smaller
problems Design a solution
Implement the Plan
Carry out the plan checking the preliminary results at each step.
Code A Little Test A lot
Evaluate/Examine the Solution
Check result in alternate ways Look for new solutions Can other problems be solved
using these techniques?
Programming
Programming – the creation of an ordered set of instructions to solve a problem with a computer.
Not enough to know a particular programming language… Must be able to problem solve…
Programming Languages Machine Languages
Natural language of a particular computer Any other types of languages must be translated
down to this level Assembly Languages
English-like Abbreviations used for operations (Load R1, R8)
High Level Languages Look of everyday English using common
mathematical notation Total Cost = Price + Tax; Java, C, C++, FORTRAN, BASIC, PASCAL
Brief History of Java
Developed by SUN Microsystems for consumer-electronic devices
First widespread use was to provide dynamic web content
Created by James Gosling
Java Environment Edit – JGRASP Compile – JAVAC (translated into
bytecodes) -> class file Load – class is loaded into main memory Verify – bytecodes are verified as they
are loaded into memory Execution – JAVA Interpreter interprets
the bytecodes for that system.
Two Types of Java Programs
Applications – stored and run from a local computer
Applet – stored on a remote computer and executed by a Web Browser What does this say about a web
browser? The Browser must support loading,
verifying and interpreting the applet.