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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!