Arrays, 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.

Posted Date: 7/10/2013 4:19:08 AM | Location : United States

Related Discussions:- Arrays

What are checked and unchecked exception, What are Checked and UnChecked Ex...

What are Checked and UnChecked Exception? A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. Making a

Api consumer, API consumer -This application should consume a third pa...

API consumer -This application should consume a third party API -You should use more than just one method of the API, I'd like to see at least 3 or 4 -Have some concept

Assingment, hi i want to get my assingment done

hi i want to get my assingment done

Develop a java application, Project Description: Modules of software: ...

Project Description: Modules of software: 1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving some processed pages 3 - System tray application to indicate sta

Payroll calculator application, Payroll Calculator for Both Hourly and Comm...

Payroll Calculator for Both Hourly and Commission Employees In assignment 13, we will create a payroll calculator that calculates   gross pay ,   taxes , and   net pay   fo

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.,

Game of life, Conway's Game of Life is a "cellular automaton" that is playe...

Conway's Game of Life is a "cellular automaton" that is played on a 2D grid (array) of cells. At the start of the game, an initial configuration is set up in which a number of cell

Which are three elements of event handler, The event handler attribute cons...

The event handler attribute consists of three elements. Write about each of them? 1. The identifier of the event handler. 2. The equal sign. 3. A string consisting of JavaScrip

Socket Programming, Task back to top Write a JAVA GUI program that would f...

Task back to top Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA soc

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