Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using loops with the String and Character classes. You can also use the StringBuilder class to concatenate on the error messages. Floating point literals can

Using loops with the String and Character classes. You can also use the StringBuilder class to concatenate on the error messages. Floating point literals can be expressed as digits with one decimal point or using scientific notation. The only valid characters are digits (0 through 9) At most one decimal point. At most one occurrence of the letter E At most two positive or negative signs. examples of valid expressions: 3.14159 -2.54 2.453E3 66.3E-5 Write a class definition file that has a String field to hold a possible floating point number. Name this class ValidateFloat. Write a method in ValidateFloat that returns true if the String is a valid floating point literal and false if it is not valid. Use other methods in your ValidateFloat class to create a modular solution. Write a Driver class with main( ) that prompts the user to enter candidate strings and prints a message stating whether the entry is a valid floating point number or not. For 10 additional extra credit points, print all the reasons why an expression that is not valid fails the tests. Remember, all the printing is done in main( ). The program ends when the user enters quit. Note: the Driver class does all the printing. The ValidateFloat class does no printing. You will be graded on: If the code does not compile the grade is a zero. documentation- Javadoc, inline comments, conventions, proper use of white space, Use of two classes with the classes each performing their separate tasks as described above. (for example- Driver does all input/output, ValidateFloat does all the validation of the String) Style of code- readability, clearness Object oriented design

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

More Books

Students also viewed these Databases questions

Question

a. How will the leader be selected?

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago