# pre5.3 - Prelab Exercises Sections 5.1-5.3 1 Rewrite each...

This preview shows pages 1–2. Sign up to view the full content.

Prelab Exercises Sections 5.1-5.3 1. Rewrite each condition below in valid Java syntax (give a boolean expression): a. x > y > z x>y && y>z b. x and y are both less than 0 x<0 && y<0 c. neither x nor y is less than 0 x>=0 && y>=0 d. x is equal to y but not equal to z x==y && x!=z 2. Suppose gpa is a variable containing the grade point average of a student. Suppose the goal of the program is to let a student know if he/she made the Dean's list (the gpa must be 3.5 or above). Write an if... else... statement that prints out the appropriate message (either "Congratulations -- you made the Dean's List" or "Sorry you didn't make the Dean's List"). if (gpa >= 3.5) System.out.println("Congratulations -- you made the Dean's List"); else System.out.println("Sorry you didn't make the Dean's List"). 3. Complete the following program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise. The input to the program includes the current annual salary for the employee and a number indicating the performance rating (1=excellent, 2=good, and 3=poor). An employee with a rating of 1 will receive a 6% raise, an employee with a rating of 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern