4.  Write an application that prompts the user to enter a number to use as an array size, and then attempt to declare an array using the entered size.  If the array is created successfully, display an appropriate message.  Java generates a NegativeArraySizeException if you attempt to create an array with a negative size, and it creates a NumberFormatException if you attempt to create an array using a nonnumeric value for the size.  Use a catch block that executes if the array size is nonnumeric or negative, displaying a message that indicates the array was not created.  Save the file as NegativeArray.java.

 

Week 3 Lab 5: Exercise 4 on page 667 of your text

Due in Week 3 and worth 20 points

Complete the weekly labs based on the following:

  • Write the code for each lab assignment.
  • The lab is to be submitted in a single zip file in the online course shell, which must contain all .java files, along with any additional files that may be necessary for your project to run (ex: text files). 
  • Any and all written answers must be entered into the online course shell with the submission of the attached lab assignment.

Each lab assignment will be graded based on the following: 

  1. The program must compile, execute, produce correct results, and meet all of the specifications in the weekly lab. Additionally, you must
  2. Organize the code for user readability.
  3. Organize the code for reusability.
  4. Provide documentation with embedded comments for reader understanding.
  5. Organize the code for efficiency.

 


What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."


"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"