CS111A (Section 31850)

Spring 2018

9:10am - 11am (M/W)

Batmale 453


Course Syllabus (subject to change throughout the semester)

First Exam was on Wednesday, Feb. 7th. We graded the exams together in class on Monday, February 12th.
Second Exam will be on Wednesday, Mar. 21st.
Third Exam will be on Monday, April 23rd.
We will take the Final Exam together on Wednesday, May 16th.

Miscellaneous Information

Homework Assignments are submitted through our course Canvas site

The textbook used for this course is referenced in the Syllabus and is available on 2-hour reserve in the library

Using Hills @CCSF for Completing Homework Assignments

Using repl.it for Completing Homework Assignments

Homework Submission


Programming Lab 1: Hour of Code Programming Puzzles due Monday 1/22/18 | raw

Programming Lab 2: Hello World due Wednesday 1/24/18 | raw

Programming Lab 3: Muni Ridership due Wednesday 1/31/18 | raw

Programming Lab 4: Time Calculator due Wednesday 2/14/18 | raw

Programming Lab 5: Rock Paper Scissors due Wednesday 2/28/18 | raw

Programming Lab 6: Jackalope Populations due Wednesday 3/7/18 | raw

Programming Lab 7: Parallelogram due Wednesday 3/14/18 | raw

Programming Lab 8: Consumer Loan Program due Friday 4/6/18 | raw

Programming Lab 9: Analyze Phrase due Monday 4/16/18 | raw

Programming Lab 10: Palindrome Program due Monday 4/23/18 | raw

Programming Lab 11: DeDup Program due Wednesday 5/2/18 | raw

Programming Lab 12: Distance File due Friday 5/11/18 | raw

Extra Credit: Design a Lottery due 5/23/18 | raw

Class Notes

Computer and Java Basics

posted 1/24/18Basic Input Output

posted 1/29/18Calculations

posted 2/4/18Decision Structures

posted 2/20/18DeMorgan's Law and Random Number Generation

posted 2/28/18Loops

posted 3/10/18Methods

posted 4/8/18Arrays

posted 5/6/18File I/O

Sample Programs

Java Fundamentals

HelloWorld.java | Sample console output

Echo.java | Using the Scanner class for console input

Hello World program using JOptionPane for GUI input of age input

CalcFormatDemo.java: Demonstrates calculations and formatting with printf.

StringDemo.java: Shows various ways to manipulate strings.

Decision Structures

Interest.java calculates interest on an investment at one of 2 rates

MoreInterest.java A version of the above program, with more if-statements, more interest rates.

BooleanApp.java demonstrates Boolean values and multi-way if-statements

Chapter 4: Loops

Invest.java uses a loop to add up interest on an investment over time

InvestAgain.java: Variation of above Invest program that allows user to repeat the calculation as many times as user wants.

Retire.java calculates results of monthly retirement savings, using printf for formatting output

NestedControlStructure.java inputs and shows student info with if-else-if inside loop

NestedAlt.java: Alternate version of above using "break"

Here's a document summarizing and demonstrating best practices in code formatting.

AddMoney.java demonstrates switch statements, for loops, and boolean varaibles

Chapter 5: Methods

FunInterest.java demonstrates the definition and use of a method.

RandomExerciseMethod.java - a variation of the In-class exercise solution to generate random numbers: uses a void method.

InflationBetter.java - Uses several methods, calculates inflation rate.

Groups.java - demonstrates using shared static class variables and output with nested loops.

GroupsBetter.java - Variation of above program, without shared static class variable for numGroups.

AddMoneyFun.java uses 2 methods with loops, switch statements, etc. (a variation of the AddMoney.java program above)

Blackjack.java uses several static methods and instance varaibles.

Chapter 6: Arrays

BasicArray.java - Inputs and averages an array of doubles.

ArrayElementArguments.java - Demonstrates how to pass an element of an array into a method.

ArrayParam.java - Demonstrates how array parameters work

ReturnArray.java - shows how to create an array in a function and return it

SearchGroup.java - Sequential search example, searches an array of student IDs to see if user-entered ID is in the array.

ArrayExp.java - Inputs and sorts an array of ints.

SortCommandLine.java Command-line argument variation of ArrayExp.java uses command-line to specify a list of names, searches that list to find a name.

QuarterlySales.java - a 2-Dimensional array example

Pixels.java - Models screen pixels with a 2-D array.

JaggedArray.java - Shows how a 2-D array can be jagged: have different numbers of columns for each row. Inputs test scores for courses - each course can have a different number of tests.