Homework Questions? Ask a Tutor for Answers ASAP
1. (TCO 8) 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. (TCO 4) 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. (TCO 4) Suppose you had to create an algorithm that chooses between several different processing paths, and the control variable was a discrete data type. What would be the best approach?
4. (TCO 6) You have in your program an ArrayList that contains employee salaries (double type) in arbitrary order. You need to display the employees’ salaries ordered in descending order. Provide detailed steps 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. (TCO 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. (TCO 3) 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. (TCO 1) Classes are the blueprints of objects. What kinds of relationships exist among classes? Explain these relationships using some appropriate real-world examples.
I required this 7 quest with in arund 3 hour, can you help me with it please ?
File ID: 180508