Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a complete program includes public class 4. Write a method called countcoins that accepts a scanner representing an input file whose data is a

image text in transcribed

write a complete program includes public class

4. Write a method called countcoins that accepts a scanner representing an input file whose data is a series of of tokens, where each pair begins with an integer and is followed by the type of coin, which will be "pennies"( cenm each), "nickels" (5 cents each), "dimes" (10 cents each), or "quarters" (25 cents each), case-insensitively. Add up the cash values of all the coins and print the total money. For example, if the input file contains the following text coins and print the total money. For example, if the input file contains the following text 3 pennies 2 quarters 1 Pennies 23 NckeLs 4 DIMES For the input above, your method should produce the following output: Total money: $2.09

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

More Books

Students also viewed these Databases questions

Question

Are my points each supported by at least two subpoints?

Answered: 1 week ago