tutorial-5-countercontrol-loop.pdf - KING SAUD UNIVERSITY COLLEGE OF COMPUTER AND INFORMATION SCIENCES INFORMATION TECHNOLOGY DEPARTMENT CSC 111

tutorial-5-countercontrol-loop.pdf - KING SAUD UNIVERSITY...

This preview shows page 1 out of 1 page.

KING SAUD UNIVERSITY COLLEGE OF COMPUTER AND INFORMATION SCIENCES INFORMATION TECHNOLOGY DEPARTMENT CSC 111: Introduction to Programming I Tutorial #5 1 nd Semester 1436-1437 Q1) Trace the following code fragments and then find the output: a) int x; int y=0; for (x = 1; x < 5; x += 1) {y += (int)4.0; y+= 1;} value of y:__ _ __ b) char ch = 'D'; for (int i = 0; i <= 8; i++) if (i < 5) System.out.print('#'); else { System.out.print(ch); ch--; } value of result:_______ Q2) The Amazon bookstore offers discounts in the occasion of the start of each academic year. The discount depends on the status of the customer as well as his profession. The status of the customer signifies how often the customer buys from Amazon. The
Image of page 1
  • Fall '10
  • ZuhairShentuf
  • Saudi Arabia, Computer program, faculty member

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

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes