0% found this document useful (0 votes)
17 views2 pages

Mid Exam 2024

This document outlines the mid-exam for a Computer Programming course for pre-engineering students, scheduled for June 6, 2024. It consists of three parts: true/false statements, multiple-choice questions, and practical coding exercises. The exam tests knowledge on programming concepts, C++ syntax, and problem-solving skills.

Uploaded by

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

Mid Exam 2024

This document outlines the mid-exam for a Computer Programming course for pre-engineering students, scheduled for June 6, 2024. It consists of three parts: true/false statements, multiple-choice questions, and practical coding exercises. The exam tests knowledge on programming concepts, C++ syntax, and problem-solving skills.

Uploaded by

hibutefera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Course: Computer Programming Allowed Time: 1 Hr.

& 30 Mins
Course offered to: Pre-engineering students Date: June 6, 2024
Mid-exam

Full Name _______________________________ ID ___________________ Section _________

Part I: Write True if the statement is correct and False if the statement is incorrect. (1.5 pt
each=6pts).

1. In nested if else, if a condition is false, the statement associated will not be executed and it
terminates the whole if-else chain
2. Break statement terminates the execution of the running program even if the current iteration of a
loop has not been completed.
3. The statements in a do-loop are executed at least one time even if the condition is false.
4. In C++ programming language, the default case in a switch is always used as the end case.

Part II: Choose the best answer among the given alternatives (1.5 pt each=12pts)

____1. _________ translates a source code program one line at a time.

A) Compiler
B) Interpreter
C) Assembler
D) All

____2. operator is used for comparing numeric quantities.


A. Arithmetic B. Logical C. Assignment D. Relational
____3. Which one of the following is not a C++ data type?
A) int B) double C) float D. main
____4. One of the following is an invalid identifier.
A) 2file B) _myNumber C) integer D) date_in_year
____5. Which one of the following variable declarations is NOT correct?

A) int myAge, myWeight;


B) float num1, int num2;
C) long area, width=7, length;
D) char stdName, yourName;
____6. _________is a piece of descriptive text which explains some aspect of a program.
A) Variable
B) Comment
C) Constant
D) Literal

____7. Which for-loop will run a variable from 5 to 105 in steps of 4?


A) for(int i = 5; i <= 105; i += 4)
B) for(int i == 5; i > 105; i = i + 4)
C) for(int i == 5; i < 105; i = i + 4)
D) for(int i = 5; i > 105; i += 4)

____8. Which one of the following cannot be a modifier in C++?


A) short
B) long
C) unsigned
D) None

Part III: Workout (4 pt each=12pts)

1. Write the pseudo code and draw a flowchart for a program that will produce the sum of the following
sequence.
2 + 5 + 8 + 11. . . + 50
2. Write a program that accepts a character entered from the keyboard and tells whether it is a digit or a
letter or a special symbol.
3. Write a program that accepts a list of marks of students and counts the number of students who have
scored marks less than 25 in an exam out of 50. The total number of students who took the test is to
be entered from the keyboard.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy