Array prints random numbers into string, JAVA Programming

Assignment Help:
Prompt the user for an int between an upper and lower boundary. Reuse the validateInput() method from project 2 to validate if the input is in bounds. If it is not, print an error that the given input is not greater than the lower bound and not less than the upper bound, then end the program.
If input is in bounds, create an array of type String of that length. Loop the length of the array. For each array element, generate a random number from 0 to 9. Reuse the convertInput() method from project 2 and put into each array element the String value that corresponds to the random number.
Create a second loop that prints the contents of the array as array index followed by the array index contents. Use the escape character for the tab stop to line up the output.
Your upper and lower boundaries should be constants. Use 1 as lower and 20 as upper boundaries.
Sample:
C:\Users\andy\java\141\p3>java Java1302CMIS141C801Project
Enter size of the array, between 1 and 20. -3
Invalid input. -3 is not >= 1 and <= 20.

C:\Users\andy\java\141\p3>java Java1302CMIS141C801Project
Enter size of the array, between 1 and 20. 2332
Invalid input. 2332 is not >= 1 and <= 20.

C:\Users\andy\java\141\p3>java Java1302CMIS141C801Project
Enter size of the array, between 1 and 20. 5
The contents of the 5 element array:
0. zero
1. zero
2. six
3. three
4. two
End of array contents.

Project 2 uses: (previous project, Have source code if you need a reference.)
Your static methods will be:
public static boolean validateInput(int); // returns true if the length of the int parameter is 1 digit long. Returns false otherwise.
public static String convertInput(int); // returns a string of the word that represent the integer passed as an argument.


Related Discussions:- Array prints random numbers into string

Tasks with the classes Currency, In this assignment you work on a set of ta...

In this assignment you work on a set of tasks with the classes Currency, Money and Bank. Money and Currency You have been given a template for the Currency and Money classes (Lab1.

Inheritances and interfaces, #queThis assignment will give you practice wit...

#queThis assignment will give you practice with defining classes. You are to write a set of classes that define the behavior of certain animals. You will be given a program that r

Functionality of customer relationship management system, The basic system ...

The basic system has to offer the following options: 1. Exit the program 2. Enter new customer The program prompts for the details of a new customer, assigns a unique cust

Hospital management system in java-jsp, Hospital Management System: Te...

Hospital Management System: Technology Used Java-JSP, Apache Tomcat (webserver), SQL SERVER 2000. This project is aimed at developing a web-based system for taking records

Need to develop chat application for j2me, Need to develop Chat application...

Need to develop Chat application for j2me and I want Image Processing code Project Description: We want a chat application for a community website. Image processing and co

Expertise in gps or navigation app coding, Project Description: Two co-f...

Project Description: Two co-founders are in search of a developer to join us to launch a tech startup. We have experience at fortune 500 companies, elite consulting firms, etc.,

Minimum Passing Credential, Alia is appearing for the board exams. In order...

Alia is appearing for the board exams. In order to qualify for the next class Alia need to get exactly X credits. In current semester Alia has to study N number of subjects, and ev

We want an e commerce site, We want an E Commerce site Project Descripti...

We want an E Commerce site Project Description: We want an E Commerce site like fifacointrader.. You must have experience with that kind of work We will award the proje

How many kinds of errors can be found during a program, How many kinds of e...

How many kinds of errors can be found during a program development? List them. 1. Syntax errors 2. Semantic errors 3. Run-time errors

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd