Question: 2. (25 points) Write a program the reads a string from the user that represents dollars and cents. The user will enter the dollarsign and
2. (25 points) Write a program the reads a string from the user that represents dollars and cents. The user will enter the dollarsign and amount, SXxx.XX. The user will enter the S sign as part of the string. The output should be how many dollars and how many cents are represented by the amount entered. For example: Please enter an amount: $35.46 The output will be There are 35 dollars and 46 cents. Hint: You will want to use the indexOf and substring methods to solve this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
