Purchase Solution

application program that prompts the user to enter a number

Not what you're looking for?

Ask Custom Question

Write an application program that prompts the user to enter a number (a number only, error check for numerals only), subtract 50 from that number, and then declare an array using the calculated size. If you attempt to declare an array whose computed size is a negative, the program should throw an exception. Use a catch block to catch the exception if there is one, and then display the associated message.

Please help with the .java and .class files.... :-)

Purchase this Solution

Solution Summary

An application program that prompts the user to enter a number is shown.

Solution Preview

Attached files contain an example code of what you want to ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C# variables and classes

This quiz contains questions about C# classes and variables.

Javscript Basics

Quiz on basics of javascript programming language.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.