Introduction to Programming MCQs with Answers
Practice important Introduction to Programming MCQs with answers and explanations.
Chapter: 1
Q1:
What is a program?
A. A vague idea
B. A random sequence of tasks
C. A precise sequence of steps to solve a problem
D. A sequence of unrelated activities
Correct Answer:
C
Chapter: 1
Q2:
According to Alan Perlis, modern education often fails to teach which critical skill?
A. Organizing thoughts
B. Acquiring discipline
C. Devoting attention to detail
D. All of the above
Correct Answer:
D
Chapter: 1
Q3:
What is the first hard thing about programming according to Steve Summit?
A. Writing complex code
B. Understanding programming languages
C. Learning and accepting artificial mechanisms
D. Debugging errors
Correct Answer:
C
Chapter: 1
Q4:
Why is programming important according to Matthias Felleisen?
A. It is only useful for high-tech programmers
B. It teaches problem-analysis and problem-solving skills
C. It imposes the overhead of traditional programming notations
D. It is purely a vocational skill
Correct Answer:
B
Chapter: 1
Q5:
Which skill is NOT emphasized as important in programming?
A. Paying attention to detail
B. Thinking about reusability
C. Ignoring user interface
D. Commenting the code liberally
Correct Answer:
C
Chapter: 1
Q6:
Why is it important to think about the reusability of a program?
A. Because programs should only solve one problem
B. To ensure that the program can be reused for solving related problems
C. To make the program complex
D. To prevent others from using the program
Correct Answer:
B
Chapter: 1
Q7:
Why should we never assume that the user of a program is computer literate?
A. Because users know everything
B. Because users may not understand complex interfaces
C. Because users are always programmers
D. Because users can create their own interfaces
Correct Answer:
B
Chapter: 1
Q8:
What is the nature of computers according to the text?
A. They can think independently
B. They do exactly what you tell them to do
C. They can guess what you mean
D. They can understand vague instructions
Correct Answer:
B
Chapter: 1
Q9:
Why should instructions to a computer be explicitly stated?
A. Because computers can infer information
B. Because computers are intelligent
C. Because computers follow instructions exactly as given
D. Because computers need human-like intuition
Correct Answer:
C
Chapter: 1
Q10:
What should you do to be in the right frame of mind when programming?
A. Think as complexly as possible
B. Assume the computer will understand everything
C. Think as stupidly as the computer
D. Assume the program will work without explicit instructions
Correct Answer:
C
Chapter: 1
Q11:
Why is it important to comment the code liberally?
A. To make the code run faster
B. To use more memory
C. To explain the functioning of the program
D. To confuse other programmers
Correct Answer:
C
Chapter: 1
Q12:
What is the first step in the program design recipe?
A. Write the code
B. Analyze a problem statement
C. Test the program
D. Ignore problem statements
Correct Answer:
B
Chapter: 1
Q13:
What should be done after formulating statements and comments in a precise language?
A. Ignore the results
B. Evaluate and revise the activities
C. Write random code
D. Skip testing the program
Correct Answer:
B
Chapter: 1
Q14:
Why is it important to divide a problem into small segments during program design?
A. To make the program complex
B. To check and test each part separately
C. To confuse other programmers
D. To ignore details
Correct Answer:
B
Chapter: 1
Q15:
What is the purpose of the design recipe in programming?
A. To create confusion
B. To help in creating effective programs
C. To skip important steps
D. To avoid testing
Correct Answer:
B
Chapter: 2
Q16:
What does the system software control?
A. The computer
B. Application software
C. User interface
D. Hardware
Correct Answer:
A
Chapter: 2
Q17:
Which of the following is NOT a subcategory of system software?
A. Operating system
B. Device drivers
C. Utilities
D. Compilers
Correct Answer:
D
Chapter: 2
Q18:
What is the role of an operating system?
A. Manages all other programs
B. Allocates CPU time
C. Provides input/output control
D. All of the above
Correct Answer:
A
Chapter: 2
Q19:
What is the software responsible for controlling the allocation and usage of hardware resources?
A. Device drivers
B. Operating system
C. Utilities
D. Compiler
Correct Answer:
B
Chapter: 2
Q20:
Which software communicates between devices and the computer?
A. Operating system
B. Device drivers
C. Utilities
D. Compiler
Correct Answer:
B