Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part II: Output and Debugging Questions (10 marks each) [20 Marks] Note: Provide

ID: 3772105 • Letter: P

Question

Part II: Output and Debugging Questions (10 marks each)          [20 Marks]

Note: Provide a copy of the code and screen shot for the output in the solutions’

What is the output of the following piece of code?         [10 Marks]

Rewrite the following if-else statement using the ternary operator:                                                                                [4 Marks]

if (points>= 5000)

           Console.WriteLine("You won a Television");

       else

           Console.WriteLine("You won a Laptop");

What is the output of the following piece of code? [6 Marks]

Explanation / Answer

first ine:

2

3

4

5

6

7

8

9

10

series is broken at 11

2 nd output is:

Console.WriteLine((points>=5000)?"you won a telivision" : "you won a laptop");

3 rd output:

The sum is

45

20