CSE HW-4.docx - 1 Statement int Program State x = 15 y = 30...

Info icon This preview shows pages 1–6. Sign up to view the full content.

1. Statement Program State int x = 15, y = 30, z = 10, a = 0; x = y = z = a = if ( x > y ) { x = y = z = a = if (x > z) { x = y = z = a = a = x; x = y = z = a = } else { x = 1
Image of page 1

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

y = z = a = a = z; x = y = z = a = } } else { x = y = z = a = if (y > z) { x = 15 y = 30 z = 10 a = 0 a = y; x = 15 y = 30 z = 10 a = 30 } else { 2
Image of page 2
x = y = z = a = a = z; x = y = z = a = } } x = 15 y = 30 z = 10 a = 30 System.out.println("The value is: " + a); x = 15 y = 30 z = 10 a = 30 2. package homework; 3
Image of page 3

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

import java.util.Scanner; public class homework5 { public static void main(String[] args) { Scanner Keyboard = new Scanner(System.in); System.out.print("Enter a grade value between 0 and 100: "); int numberGrade = Keyboard.nextInt(); while ((value >= 0)&&(value <=100) ) } } if (numberGrade >= 90) { System.out.println("You receive letter grade of an A"); } else if (numberGrade >= 80) { System.out.println("You receive letter grade of a B"); } else if (numberGrade >= 70) { System.out.println("You receive letter grade of a C"); } else if (numberGrade >= 60) { System.out.println("You receive letter grade of a D"); } else if (numberGrade <60) { System.out.println("You receive letter grade of an E"); } else System.out.print("number should be in between 0 and 100");
Image of page 4
Image of page 5

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

Image of page 6
This is the end of the preview. Sign up to access the rest of the document.
  • Summer '13
  • Ravichandran

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern