Assignment1a - *Hwa-Shy(Simon Wu 454 5302 S Section 0*This...

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

View Full Document Right Arrow Icon
/*Hwa-Shy (Simon) Wu 454 5302 Section 0 */ S /*This program allows us to farmiliarize ourselved with Java language. It shows us the type of coding that Java does and doesn't understand. The variables assigned in the following program are all answers to questions 3, 4, and 5. Expressions that gave an incorrect answer (if it was to be handed in math class) were changed to the correct ones.*/ w // The "Assignment1" class. import apsc142.*; public class Assignment1 { public static void main (String[] args) { //question 3 / int answer3A, answer3B; double answer3C; answer3A= 5 + 10 % 3 + 2; //The original expression is legal in Java. //Answer is 14 (correct). Considering that desired % to mean modulus (the remainder). //Remember % takes precedence over +. answer3B= 5 + 10 %(3+2); //The original expression is legal in Java. //Answer is 5 (correct). Considering that desired % to mean modulus (the remainder). //Remember () takes precedence over everything. answer3C= 23 /(4.0/8.0); //The original expression is illegal in Java.
Image of page 1

Info icon This 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