homework3 - 15-100 HOMEWORK 3 FALL 2007 Read sections...

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

View Full Document Right Arrow Icon
15-100 HOMEWORK 3 - FALL 2007 Read sections 3.1-3.4 and 3.9-3.10 in your textbook and answer the following questions based on your readings and the course lectures. 1. Let the variable b be of type boolean . What value is assigned to b in each of these four assignment statements? Show your work for full credit. (a) b = !(false && (true || false)); (b) b = (Math.pow(4.0, 3.0) > Math.pow(3.0, 4.0)); (c) String s = new String("AUTUMN"); b = s.equals("FALL"); (d) b = ((b || !b) && (!b || b)); 2. Assume x and y are int variables. For the Java code fragment below: if (x < 0) { if (x - y < 0) System.out.println("B"); else System.out.println("C"); } else System.out.println("A"); (a) Draw a flowchart to illustrate the flow of execution of the fragment. (b) Draw a graph like the one shown below, shading in the area where "A" would be output in one color, the area where "B" would be output in another color, and the area where "C" would be output in a third color. If the border of an area is included in the shaded area, draw the border as a solid line. Otherwise, draw the border as a dashed line.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ 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