Question
2.28 Convert pennies (Java) Write a program called ConvertPennies to input an integer value representing a number of pennies and convert it to its equivalent
2.28 Convert pennies (Java)
Write a program called "ConvertPennies" to input an integer value representing a number of pennies and convert it to its equivalent number of Dollars, Quarters, Dimes, Nickels and Pennies.
Following is the result of the execution of this program for 292 pennies.
Enter the amount of pennies to convert: 292 pennies is equal to 2 one dollar bills 3 quarters 1 dimes 1 nickels 2 pennies
This is given:
//********************************************************************** // Programmer: Your first and last names // Problem Description: // Convert a number of pennies into its equivalent larger denominations. //**********************************************************************
import java.util.Scanner; public class yourprogramname {
public static void main(String[] args) { // Declare the identifiers
// Create a Scanner object. // Input the number of pennies to convert
// Convert the amount into its equivalent denominations // Display the result
} }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started