05-jan30 [Autosaved]

# 05-jan30 [Autosaved] - COMP 110 Branching Statements and...

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

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

View Full Document

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

View Full Document

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

View Full Document

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.

Unformatted text preview: COMP 110 Branching Statements and Boolean Expressions Tabitha Peck M.S. January 28, 2007 MWF 3-3:50 pm Philips 367 1 Announcements Program 1 Due Today Hand in Pseudocode after class Program 2 Assigned Today Lab 2 Due Friday 2 Questions? 3 Today in COMP 110 Formatting decimals Review Worksheet If/Else statements Boolean Expressions 4 Formatting Decimals import java.text.*; DecimalFormat df = new DecimalFormat( "0.00" ); df.format(myVariable); Example code on class website 5 Review Worksheet public class MyProgram { public static void main(String args) { String myString = “This is a string”; int len = myString.length(); System.out.print(“the length is “ + len); String shortString = myString.substring(10); } } 6 Integer division Double myDouble = (1 / 2) * 5.0; int i = 1 / 2; 0.5 O 7 Classes Suppose that mary is an object of class Person , and suppose that increaseAge is a method of class Person that uses one argument, an integer. argument, an integer....
View Full Document

## This note was uploaded on 02/02/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

### Page1 / 21

05-jan30 [Autosaved] - COMP 110 Branching Statements and...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online