SSL Certificate
  • You have in your program an ArrayList that contains employee names


1. When debugging a class, you can step through the code to follow the flow of the program. There are four ways you can step through the code. Explain each option for stepping through the code of a class.


2. Give an example of an if-else statement. Give an example of a switch-case statement. Explain when using a switch-case would be more appropriate than using an if-else and vice versa.


3. Why are exceptions particularly appropriate for dealing with errors produced by methods of classes in the Java API.


4. You have in your program an ArrayList that contains employee names (strings) in arbitrary order. You need to display the employees ordered alphabetically by name. Provide detailed steps of how you plan to accomplish this task. You do not need to give correct Java code (a detailed pseudocode is sufficient) but indicate which method(s) and which Java class(es) you would use.


5. Suppose that you have an array of baseball scores (type integer) called Scores. The values in the array are ordered from largest to smallest. You need to find the average score, and how many scores are less or equal to the average, and how many are greater than the average. Write a code fragment to accomplish it, or at the very least write a detailed plan (pseudocode).


6. Do we need to format our program output? Does formatting only apply to numeric values? What about percent values and currencies? Give an example that uses the NumberFormat class in the java.text package that formats percent values.


7. Classes are the blueprints of objects. What kinds of relationships exist among classes? Explain these relationships using some appropriate real-world examples.



================
*Instant Download


Write a review

Please login or register to review

You have in your program an ArrayList that contains employee names

  • $9.99


*All your data are SECURED & ENCRYPTED using a valid, trusted server certificate (Comodo SSL) and we don't store credit card information on our servers and all Payments are SECURED & handled by Paypal.
SSL CertificatePaypal

Tags: java, writeup, debugging, switch case, pseudocode, grade range, exception-handling, ArrayList, baseball scores, format, blueprints