JaskaranSingh 4532244 Test2
JaskaranSingh 4532244 Test2
JaskaranSingh 4532244 Test2
Test – 2 (30%)
Term: Spring 2023 Professor: Dr. Manisha Krishnan
Course: PROG1124 – Software Development Email: manisha.krishnan@niagaracollegetoronto.
ca
Copyright Disclaimer:
The materials provided in class and in Canvas are protected by copyright. They are intended for the
personal, educational uses of students in this course and should not be shared externally or on websites
such as Chegg, Course Hero or OneClass. Unauthorized distribution may result in copyright
infringement and violation of Niagara College’s policies.
Submission Instructions:
1. Download this document. Rename it as YourFirstnameLastname_YourStudentID_Test2.
2. Take two screenshots of each project and paste them at the spaces provided in this document:
Run the project and take a screenshot of the output (active) window.
Screenshot of the whole Visual Studio screen including the Taskbar that shows the date and
time.
Use Alt + PrtSc to take the screenshot of the active window.
Use PrtSc to take the screenshot of the whole screen.
3. Make sure the screenshots are clear and readable.
4. Please note that if your screenshots didn’t follow the above-mentioned instructions, your lab will not
be graded.
5. When finished, submit it to Test-2 under Assignments module on Canvas.
Page 1 of 7
PROG1124 – Software Development
Question 1: Write a C# program that outputs the numbers from 50 to -50 counting down by 5’s.
For e.g.: 50 45 40 35 30 25 20 15 10 5 0 -5 -10 -15 -20 -25 -30 -35 -40 -45 -50 (5 marks)
[Take a screenshot of the C# sharp code in the Visual studio window and paste it here]
Page 2 of 7
PROG1124 – Software Development
Question 2: Write a C# program to get a number from the user to print the result of the Fibonacci
series. (5 marks)
Eg: Enter a number:7
0 1 1 2 3 5 8
Hint: Print 0 and 1. To calculate the third number = sum of first 2 numbers, fourth number = sum of third
number and second number and so on. Ie., The series is number = sum of the previous 2 numbers.
Page 3 of 7
PROG1124 – Software Development
[Take a screenshot of the C# sharp code in the Visual studio window and paste it here]
Page 4 of 7
PROG1124 – Software Development
Question 3: Write a C# program to count the number of digits in a number entered by the user.
(5marks)
Eg: Enter the number : 23567
Output: Number of digits = 5
Page 5 of 7
PROG1124 – Software Development
[Take a screenshot of the C# sharp code in the Visual studio window and paste it here]
Page 6 of 7
PROG1124 – Software Development
Page 7 of 7