Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Class and method question, Java?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Sean Ramon
Class and method question, Java?
0 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


Consider a Java class that you could use to get an acceptable integer value from the user. An object of this class will have the attributes:

**Minimum accepted value Maximum accepted value Prompt string** and the following method:

getValue displays the prompt and reads a value using the class Scanner. if the value read is not within the allowed range, the method should display an error message and ask the user for a new value, repeating these actions until an acceptable value is entered. The method then returns the value read.

a. Write preconditions and postconditions for the method getValue b. implement the class in Java c. Write some Java statements that test the class.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com