CIS111 Programming Examples

Your system will have to have a program set to load .java extension files. Examples will generally follow book, but will have enhancements.

Basic Input Class - Will Not be Reviewed in Class
0 Savitchin.java input/output class will not be reviewing in class but needed for programs
Chapter 1 Examples
1 HelloWorld1.java First Java Program Prints Out Hello World
2 HelloWorld2.java page 27 Second Java Program Prints Out Hello World and Also accept keyboard input
Chapter 2 Examples
3 EggBasket.java page 54
4 Optional will not be covered EggBasket1.java structure - object oriented version of EggBasket
5 DinnerBill.java Compute whole dollar amounts for sharing a Restaurant bill. Demonstrates typecasting, mixed types, assignments, variables.
5 Optional will not be covered DinnerBill1.java
6 Discount.java computes a 15% discount before and after tax
7 ChangeMaker.java page 76 example
8 Increment.java java example showing pre and post increment and decrement unary operator

9

Discount2.java String example of Discount.java
10 Optional will not be covered Discount1.java OOP example of Discount1.java with methods
11 MyString.java illustrates some of the methods on page 82-85 Display 2.6 - Has ASCII chart
12 StringDemo.java same as example on page 87 but with escape character added
13 MyPrintStuff.java section 2.3 example
14 MySavitchIn.java demonstrates I/O from section 2.3 - has double prompt( )
Chapter 3 Examples
15 BankBalance.java book example page 130
16 BankBalance1.java illustrates block if
17 MyIf.java book examples on pages 133-135
18 StringEqualityDemo.java display 3.3 example
19 StringCompareDemo.java pages 138-139 example
Chapter 4 Examples
21 SpeciesFirstTry.java page 214 Display 4.2
22 SpeciesFirstTryDemo.java page 217 Display 4.3
23 SpeciesFirstTry_1.java added showLandPortion page 225
24 BankAccount.java Display 4.4 (Used Illustrating Masking of a Local Variable) page 230Loca
25 LocalVariablesDemoProgram.java (Creates BankAccount Object, and masks a local variable of BankAccount)
26 SpeciesSecondTry.java Display 4.5
27 SpeciesSecondTryDemo.java Display 4.6