Question: Program Specification: Write a Java program that does the following: Prompts the user to input exactly four characters, which constitude a valid double literal in

Program Specification:
Write a Java program that does the following:
Prompts the user to input exactly four characters, which constitude a valid double literal in Java.
Gets whatever the user enters and stores it into a String variable, using the the Scanner's .nextLine() method.
Determines if the input string is indeed a valid four character double literal :
Consists of exactly the following characters: '+','-',',(decimal point), and '0' through '9'
Either the '+' or '-' character may appear only as the first character
The '?(decimal point) character must appear exactly once
All other characters must be the '0' through '9' characters
Displays this determination to the user in a reasonable report format.
Grading:
\table[[Performance Indicator,1,2,3
 Program Specification: Write a Java program that does the following: Prompts

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!