Description
CSCI231 Project 02: Java Basic introduces fundamental Java programming concepts through a coin change calculator. The assignment focuses on integer variables, Scanner input, String objects, arithmetic operators, and the modulus operator. Students develop a program that converts cents into quarters, dimes, nickels, and pennies, then modify it to generate random change amounts.
Assignment Description
Project Objectives:
This project was designed to reinforce programming concepts from Chapter 2. In this
project, the students will practice:
1. Declare variables
2. Use Scanner and String objects
3. Do arithmetic operations, including /, %
4. Use basic data types int
Description of the Problem:
Write a program that asks the user input a change between 1 and 99 cents. The program
then will display it in amount of quarters, dime, nickels and pennies.
Example run 1: (the bold Italic numbers/strings are input):
Enter a change between 1 and 99 cents:
68
You have change 68 cents. That is:
2 quarters
1 dimes
1 nickels
3 pennies
Example run 2:
Enter a change between 1 and 99 cents:
97
You have change 97 cents. That is:
3 quarters
2 dimes
0 nickles
2 pennies
After finish the program successfully, you need to comment away (don’t delete) the user
input part. Replace it by the code that randomly generates a change between 1 and 99
cents, inclusive. Run and test the modified program.
Submit YourNameProject02.java via blackboard link. The due date is specified on
blackboard.
Solution Overview
The solution covers a Java program that accepts 1–99 cents and calculates quarters, dimes, nickels, and pennies using integer division and modulus. It also addresses commenting out Scanner input, generating random amounts, and testing the modified program.

