Question: This program converts a cost read for a particular product into dollars and cents. Ask the user to type in both a product and how

This program converts a cost read for a particular product into dollars and cents. Ask the user to type in both a product and how much it costs in decimal numbers. Then print the price written as dollars and cents. I recommend you store the cost as a String to take advantage of the String methods length() and charAt(). For full credit, you must use exactly one if statement and one else statement (the use of two if statements and the use of else if are both disallowed). Note that you can assume the user will always enter a price between $10.00 and $999.99 Your program should work identically to the examples below: mple Output: Enter the name of a product: bubble gum Enter the price: $2.95 bubble gum cost is 2 dollars and 95 cents
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
