hw2.docx - Exercise 1 private static MethodModifier float...

This preview shows 1 out of 3 pages.

Exercise 1: - private static: MethodModifier - float min(float a, float b): MethodHeader + float - UnannType: result + min(float a, float b): MethodDeclarator - min: Identifier - float a, float b: ForamlParameterList + float: UnannType + a, b: VariableDeclaratorId - return a <= b ? a : b;: block + return: ReturnStatement Exercise 2: - static: MethodModifier - float min(int[] a): MethodHeader + float: result + min(int[] a): MethodDeclarator - min: Identifier - int[] a: ForamlParameterList + int[]: UnannType + a: VariableDeclaratorId - // TODO: implements this - Comment Exercise 3: - static: MethodModifier - int nextCount(int i): MethodHeader + int: result + nextCount(int i): MethodDeclarator - nextCount: Identifier - int i: ForamlParameterList + int: UnannType + i: VariableDeclaratorId - *int j; { j = i + 1; } return j* - block + int j: LocalVariableDeclarationStatement - int: UnannType - j: VariableDeclaratorId + j = i + 1: ExpressionStatement - j: VariableIdentifier - = i + 1: AssignmentExpression + return j: ReturnStatement
Image of page 1

Subscribe to view the full document.

Exercise 4: - private static: MethodModifier - float min(float a, float b): MethodHeader + float: result
Image of page 2
Image of page 3
You've reached the end of this preview.
  • Spring '18
  • Subroutine

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