QUESTION 1 If you have a program that provides you with a letter grade and you want to do something specific for each grade given, what type of statement should you use? For example, your program would ask for a letter grade (i.e. A,B,etc.). Given this grade, you would then say ”You have an A”. Provide the code that would do this. QUESTION 2 Give an example of an if statement QUESTION 3 What are the differences between a string and a char data type. Give an example of each. QUESTION 4 What is a class? QUESTION 5 What is the difference between = and == QUESTION 6 How would you fix the following int x = 5; if(x % 5) { System.out.println(”Hello”); } QUESTION 7 Given an array of strings, how would you check to see if a slot is empty or already filled? QUESTION 8 What are the differences between a while and a do..while loop? QUESTION 9 What is a method? QUESTION 10 Which data types can hold the following value : 3.14 QUESTION 11 Given an array of 1000 values, how would you find the length of this array and the value of it’s 330th member? QUESTION 12 Identify the three pieces of a for loop QUESTION 13 Give an example of a for loop QUESTION 14 Write a program that asks for a listing of 10 dollar amounts. Given these dollar amounts, you will need your program to output the highest value, lowest value, and average value entered. QUESTION 15 How man times would the following run: int x = 2; do{ System.out.println(”Hello”) } while(x<3); QUESTION 16 Given the boolean variable doorStatus, what are two ways you can check to see if this variable is equal to false. QUESTION 17 How man times would the following run int x = 2; while(x<3) { System.out.println(“Hello””); x– x*=2 } QUESTION 18 If you have a program that gives you a final grade percentage (i.e. 93
If you have a program that provides you with a letter grade and you want to do something specific for each grade given, what type of statement should you use?
07
Aug