{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

65-lecture03

# 65-lecture03 - Computer Science 65 Intro to CS January 31st...

This preview shows pages 1–12. Sign up to view the full content.

Computer Science 65 Intro to CS January 31st, 2008 Psuedocode Java Syntax

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Announcements Assignment #2 Paper and Pencil Assignment Out today, posted on blackboard Due Thursday, February 7th
Intro to Programming Two types of programming Procedures: set of programming statements that perform a specific task Procedures operate on data items that are separate from the procedures What happens if data format is altered?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Quick Intro Object Oriented Programming Object Oriented Programming (OOP) is centered on creating Objects Advantages of OOP: Combining data and code Object’s ability to hide data from code outside the object
Object Example Rectangle Attributes? (data) Methods? (procedures)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms & Psuedocode Computer Science is the study of algorithms Computers are programmable machines that can be used to implement algorithms Computers help us solve problems Programming languages have strict rules, known as syntax , that must be carefully followed Psuedocode:
What’s Wrong with the following psuedocode? ***calculate the ratio a/b*** Display “Input the value of a” Input a Display “Input the value of b” Input b Display “the ratio is” Display ratio

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Psuedocode Predict the Result variable x starts with 7 variable y starts with 2 add 1 to x add 3 to y subtract y from x, store the result in x print x print y
How To Program 1. Think about the problem 2. Write down the algorithm on paper Psuedocode: informal high-level description of an algorithm Step1: Step2: … 3. Translate psuedocode to java and enter the code in Eclipse 4. Fix errors 5. Test code to make sure it works for all expected input

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Java Fundamentals Java programs are made up of several elements words that have special meaning examples: public, int, float, main Key Words are also known as _________________
Java Reserved Keywords abstract assert boolean break byte case catch char class const continue default do double else enum extends false for final finally float goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}