1 / 7

CS 112 Intro to Computer Science II

CS 112 Intro to Computer Science II. Sami Rollins srollins@cs.usfca.edu Fall 2006. Administrative Information. Class web page. A bit about programming…. What do you like about programming? What do you want to learn about programming?

kathern
Download Presentation

CS 112 Intro to Computer Science II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 112Intro to Computer Science II Sami Rollins srollins@cs.usfca.edu Fall 2006

  2. Administrative Information • Class web page

  3. A bit about programming… • What do you like about programming? • What do you want to learn about programming? • What do you find most challenging with respect to programming?

  4. Java Review • What is an algorithm? • What is a class? • What is a method? • What is a variable? • How do you declare a variable? • What are the primitive data types in Java? • How does an int differ from a String? • How does a String differ from a Person object? • How do you do input/output in Java?

  5. Java Review • What is the precedence of mathematical operators in Java? • What is a package? • When do you need to use an import statement? • What happens to an object if there are no references that point to it? • What is an if statement and when might you use one? • What are the three types of loops in Java? When would you use each? • What is an iterator? • What is an array?

  6. Exercises • Problem PP2.9 - Write an application that prompts for and reads a double value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assume that a ten dollar bill is the maximum size needed). For example, if the value entered is 47.63, then the program should print the equivalent amount as: 4 tens, 1 five, 2 ones, 2 quarters, 1dime, 0 nickels, 3 pennies Write your algorithm first!

  7. Exercises • Write an application that prompts the user for an integer representing a number of rows and prints the following pattern: ***** **** *** ** *

More Related