Prep 1: Module 1

Introduction to Data Types

Video Description
Module Overview Dr. Cytron gives a brief overview of Module 1
Module Introduction An introduction to Data Types
The int data tye An introduction to a data type that is used to represent integer values
Operations on the int data type What can we do with integers?

Roundtable: Translating a story about carrots

In this series of videos, we will use integer variables to tell a story

Video
Part 1
Part 2
Part 3
Part 4
Part 5
Part 6

Gathering user input

Video Description
Prompting How can we request input from the users?

Exercise: Making Change

Part 1: Introduction

Introduction: Making change

Part 2: The Exercise

In the repository you are using for this course, look inside the exercises source folder, and you will see assignments organized by name. Before continuing on to the next portion of the prep material, spend some time on the exercise.

It is not so important that you get the exercise exactly right. It is important to work through it as best you can before you look at the solution or continue with other work in this module.

You have some number of pennies, and you would like to determine how to make change for those pennies to obtain the proper number of each of the following currencies:

currency pennies
dollars 100
quarters 25
dimes 10
nickels 5

In making change, we seek the maximum number of each denomination in decreasing order. For example, given 798 pennies, your program should print the following:

For 798 pennies: 7 dollars 3 quarters 2 dimes 0 nickels 3 pennies

Instructions

  • Update your repository to make sure you have all the code that has been distributed to you.
  • Find and open the Change Java program in the exercises1 package of the exercises source folder.
  • Add code as directed there to prompt the user to supply the number of pennies.
  • Compute and print the output as suggested above.

Hints:

  • You need to use integer division and remainder (%) to complete this exercise.
  • Review the video materials as necessary for this module.

Part 3: Solution

Solution: Making change

Roundtable: Math on Computers

This roundtable dives deeper into the kinds of math that can be performed on computers

Video
Part 1
Part 2
Part 3
Part 4

The double data type

Video Description
Building bigger expressions How can we make even bigger expressions in Java?
The double data type An introduction to the double datatype

Roundtable: Randomness

This roundtable explores how we can do random things in our code

Video
Part 1
Part 2
Part 3

Booleans and Strings

Video Description
Mixed-type Expressions What happens when we use multiple types in the same expression?
The String data type We can use Strings to represent text values. Find out how they work!
The boolean data type This video introduces the concept of a boolean value
Conclusion You’ve made it through module 1!