0% found this document useful (0 votes)
2 views3 pages

NIT Computer Programming Test 02

The document is a test paper for a Computer Programming Principles module at the National Institute of Transport, dated June 15, 2026. It includes a C# program with multiple syntax and type errors, followed by a series of questions aimed at identifying and correcting these errors. The test is designed to assess students' understanding of programming concepts and C# syntax within a 30-minute timeframe.

Uploaded by

obbdky
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

NIT Computer Programming Test 02

The document is a test paper for a Computer Programming Principles module at the National Institute of Transport, dated June 15, 2026. It includes a C# program with multiple syntax and type errors, followed by a series of questions aimed at identifying and correcting these errors. The test is designed to assess students' understanding of programming concepts and C# syntax within a 30-minute timeframe.

Uploaded by

obbdky
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NATIONAL INSTITUTE OF TRANSPORT

PROGRAM: BCICT
Module Code and Name: ITT 04207 - Computer Programming Principles

Date: June 15, 2026 Test Number: TEST 02

Time Allowed: 30 Minutes Max Marks: 20 Marks

REGISTRATION NUMBER:

INSTRUCTIONS:
1. Answer ALL questions.
2. All answers must be written neatly in the spaces provided below each question.

PROGRAM SOURCE CODE


Study the C# program below carefully and answer all questions that follow.

using System;

class Program {
static void Main() {
int age = "20";
Float salary = 2500
Char grade = AB;
Bool status = "true";

[Link]("Age: " + age);


[Link]("Salary: " + salary);
[Link]("Grade: " + grade);
[Link]("Status: " + status);

if (age > 18)


{
[Link]("Adult");
}
else
{
[Link]("Minor");
}

return 0;
}
}

Page 1 of 3
QUESTIONS

1. Which lines are missing a terminating semicolon (;)?

2. Which built-in types are incorrectly written with uppercase first letters (e.g., Float, Char, or Bool)?

3. What keyword should Float be replaced with in standard C# syntax?

4. Identify the literal assignment error in the declaration statement: int age = "20";

5. Which type mismatch configuration causes the compilation to fail immediately and why?

6. Identify the syntax error in the declaration of the variable salary and rewrite the statement correctly.

7. Identify the error and fix it in this specific line: Float salary = 2500

8. Identify the literal syntax error in the statement: Char grade = AB;

9. Provide the completely corrected declaration and assignment statement for the grade variable.

10. Identify the literal syntax error in the statement: Bool status = "true";

11. What is the correct value assignment format for a boolean status variable in C#?

12. Which declaration statement block or initialization line is missing a closing punctuation mark?

13. What exact punctuation mark is missing at the end of the salary variable declaration?

14. What is the exact purpose of the [Link]() method in a C# program?

Page 2 of 3
15. What is the exact string literal output label displayed before the evaluated value of age?

16. Which comparison operator is used inside the condition block of the if statement?

17. If the variable age evaluates successfully to 20, what word string will be displayed by the conditional
block?

18. What keyword is normally utilized to exit a execution context and pass a value back from a method body?

19. What compilation issue occurs when trying to use return 0; inside a static void Main() method
block?

20. After correcting all syntax and structural errors in the code above, write out the expected program
execution output.

Page 3 of 3

You might also like