Docsity

Computer Science Terms – C++ Concepts & Programming Definitions, Exams of Computer Science

Toggle sidebar
bg1
Computer Science Terms questions and
answers 2025/2026
Compiler - answerSets of programs that transform source code written in a programming language into
binary computer language
IDE - answerDenoting binary compounds of a nonmetallic or electronegative element (or group)
Expression - answerassigns a value to a variable
Algorithm - answerseries of steps to solve a problem
Debugging - answeridentify and remove errors from (computer hardware or software)
Machine Language - answera computer programming language consisting of binary or hexadecimal
instructions that a computer can respond to directly.
Assembly Language - answera low-level symbolic code converted by an assembler.
High-Level Language - answereasier to use, uses natural language
3 example of good programming practices - answer1. Adding comments so that another programmer
can understand what exactly is happening
2. Clear naming of variables so that later the programmer does not get confused
3. Keep the code simple, make it easy to read & modify a complicated code could be confusing to
others.
Flow Control Structures: Name 3 - answer1. If-Else
Ex.
if (hrs > 40)
grossPay = rate*40 + 1.5*rate*(hrs-40);
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Computer Science Terms – C++ Concepts & Programming Definitions and more Exams Computer Science in PDF only on Docsity!

Computer Science Terms questions and

answers 2025/2026 Compiler - answerSets of programs that transform source code written in a programming language into

binary computer language IDE - answerDenoting binary compounds of a nonmetallic or electronegative element (or group) Expression - answerassigns a value to a variable Algorithm - answerseries of steps to solve a problem Debugging - answeridentify and remove errors from (computer hardware or software) Machine Language -instructions that a computer can respond to directly. answera computer programming language consisting of binary or hexadecimal

Assembly Language - answera low-level symbolic code converted by an assembler. High-Level Language - answereasier to use, uses natural language 3 example of good programming practices -can understand what exactly is happening answer1. Adding comments so that another programmer

  1. Clear naming of variables so that later the programmer does not get confused
  2. Keep the code simple, make it easy to read & modify a complicated code could be confusing toothers.

Flow Control Structures: Name 3 - answer1. If-Else Ex.if (hrs > 40) grossPay = rate40 + 1.5rate*(hrs-40);

else grossPay = rate*hrs;

  1. While Switch Statements -2. switch are great for menus or for asking user to input data. answer1. switch provides a "point of entry" Example: Display a menu with 8 options & handle the choice made by user == - answermeans equality = -Example: answermeans assignment if (x = 12)Do_Something elseDo_Something_Else

Nested statements - answerAre if else statements, more than one. if (speed > 65) if (speed > 80)cout << "You're gonna get pulled over!"; elsecout << "You're driving OK for I-5.";

Break; - answerProvides clearer "big-picture" view Shows menu structure effectivelyEach branch is one menu choice

count++; // Update expression } For Loop Example -{ answerfor (count=0;count<3;count++) cout << "Hi "; // Loop Body}

Used for 1, 22, 333, 4444 Also: Collect 20 data points from the user Nested For Loop Example -for (inner=7; inner>2; inner--) answerfor (outer=0; outer<5; outer++) cout << outer << inner; Factorial - answer C Family Tree -2. C++ answer1. C

  1. Java C# C++ LibraryBeginning of every code - answer#include using namespace std; int main(){ }

\n - answernew line: in hexadecimal format \r - answercarriage return (Positions the cursor at the start of the current line.) \t - answer(Horizontal) Tab: Advances the cursor to the next tab stop. \a - answerAlert: Sounds alert noise (bell sound) \ - answerAllows you to place a backslash in a quoted expression intVar++; - answeralso means : intVar = intVar + 1;

  • answerdefines cout, cin, cerr cin.fail() - answerreturns True is data can not fit into target variable cin.good() - answeropposite of fail cin.clear() - answerresets the input buffer cin.ignore(num, '\n' ) - answerclears out the bad data in input buffer getline(cin, name ) - answerwhere name is a string Declare a string variable -#include answer#include using namespace std;

What is the valid assignment statement that assigns the value 5 to the variable num_people? - answernum_people = 5;

The value of the expression 20.0 * (9/5) + 32.0 is? - answer 52 9/5 evaluates to 1 using integer division What is the value assigned to the variable x? int x;x= 1/2; - answer 0

C++ reserved keywords - answerif, double, else C++ requires every identifier to be declared prior to use. The type is specified in the declaration. - answerTrue

Built into C++ language -long answerint shortdouble

C++ is case sensitive - answerAlpha, ALPHA, & AlphA are all different identifiers || operator - answer1.it is the logical OR operator

  1. it has two operands
  2. it returns true if either operands is true
  1. it uses short circuit evaluation What loop is guaranteed to literate the body of loop at least once? - answerdo body while(control); What is the value of x when the statement is executed? int count = 0, x=10int limit = 25; if ( count == 0 && limit < 20){

}x = 20; cout << x << endl; -x= 10 answercout << x << endl;

&& operator - answer1. It uses short circuit evaluation

  1. It has two operands
  2. It is the logical AND operator What control repeats a sequence a statement 0 or more times? - answerFor loop int x = 1; int y;y = x++; - answer1. change the value of x to 2
  3. the ++ is a postfix operator