Is Ch 1-3 Test C++ Your Forte? Find Out With This Quiz!

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Tcarter1
T
Tcarter1
Community Contributor
Quizzes Created: 1 | Total Attempts: 163
| Attempts: 163 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. Assume that for each operation, a is 5, b is 14, and c is 8. a, b and c are all integers.
a / b

Explanation

5/14=0

Submit
Please wait...
About This Quiz
Is Ch 1-3 Test C++ Your Forte? Find Out With This Quiz! - Quiz

C++ language was developed in 1979 and it is a sophisticated general purpose programming language based on C. If you are a starter at this language, then the quiz below is perfect for you, if you consider chapter one to three your forte. Take up the quiz and prove yourself!

Personalize your quiz and earn a certificate with your name on it!
2. Check_Grade

Explanation

The given correct answer is "Valid". This suggests that the "Check_Grade" is a valid action or function. It implies that the system or program is able to check the grade of something or someone, and this action is considered valid or acceptable within the context of the question or problem.

Submit
3. Cpu

Explanation

not-available-via-ai

Submit
4. Assume that for each operation, a is 5, b is 14, and c is 8. a, b and c are all integers.
float(a) / c

Explanation

5.0/8 = 5/8 = 0.625

Submit
5. Assume that for each operation, a is 5, b is 14, and c is 8. a, b and c are all integers.
a % b

Explanation

5%14 = 5

Submit
6. Sprint.L.L.C

Explanation

no periods allowed

Submit
7. Student-grade

Explanation

cannot have a dash

Submit
8. Evaluate the following numerical expression. int number; int x = 9, y = 5; float ave = 13.5 number = ( x + y / 3 * 2 ) + ave / x -1 * ave;

Explanation

number = (x+y / 3*2) + ave / x - 1 * ave;
number = (9+5 / 3*2) + 13.5 / 9 - 1 * 13.5;
number = (9+1*2) + 1.5 - 1 * 13.5;
number = (9+2) + 1.5 - 13.5;
number = (11) - 12.0;
number = - 1.0;
number = -1;

Submit
9. Counter value

Explanation

no spaces allowed

Submit
10. Evaluate the following logical expressions as true or false: int x=0, y=1; bool value=false;   (these values are the same for each expression).     (x + y || value && x || !value)

Explanation

(x + y || value && x || !value)
(0 + 1 || false && 0 || true)
(1 || false || true)
true

Submit
11. What is wrong with the following code that will assign my first initial to a variable? char initial; initial=M;

Explanation

The correct answer is that the m needs to have ‘’ around it ‘M’. In programming, characters need to be enclosed in single quotes ('') to indicate that they are a character literal. Therefore, the correct code should be initial = 'M';

Submit
12.     If the following are valid identifiers, check valid, otherwise check invalid, return

Explanation

You cannot use keywords in an identifier.

Submit
13. STUDENTS

Explanation

The given answer "Valid" suggests that the students mentioned in the context are considered valid or acceptable. However, without any additional information or context provided in the question, it is difficult to determine the specific criteria or conditions for determining the validity of the students.

Submit
14. 2file

Explanation

Cannot start with a number

Submit
15. Counter4Data

Explanation

not-available-via-ai

Submit
16. Put the steps of the software development cycle in order.
Submit
17. Evaluate the following logical expressions as true or false: int x=0, y=1; bool value=false;   (these values are the same for each expression).         (x=0 && y < 5/3 + 3 || value == 0/y)

Explanation

(x=0 && y (FALSE && 1 (FALSE && 1 (FALSE || false == 0)
(FALSE || TRUE)
TRUE

Submit
18.
  1. What is the output of the following code fragment?
int i=20;   do {     cout << i << i+1 << endl; }while(i > 10);

Explanation

20 21
20 21
20 21
20 21
20 21
20 21
repeating.

Submit
19. Write only the code necessary to declare a variable that would hold the cost of an automobile.  Initialize it with a value of 0;

Explanation

The correct answer is "double cost = 0;". This is the correct way to declare a variable named "cost" that can hold decimal values (double) and initialize it with a value of 0.

Submit
20. Assume that for each operation, a is 5, b is 14, and c is 8. a, b and c are all integers.
float(a / b)

Explanation

float(0) = 0.0

Submit
View My Results

Quiz Review Timeline (Updated): Feb 17, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 17, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 17, 2012
    Quiz Created by
    Tcarter1
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Assume that for each operation, a is 5, b is 14, and c is 8. a, b and...
Check_Grade
Cpu
Assume that for each operation, a is 5, b is 14, and c is 8. a, b and...
Assume that for each operation, a is 5, b is 14, and c is 8. a, b and...
Sprint.L.L.C
Student-grade
Evaluate the following numerical expression....
Counter value
Evaluate the following logical expressions as true or false: ...
What is wrong with the following code that will assign my first...
 ...
STUDENTS
2file
Counter4Data
Put the steps of the software development cycle in order.
Evaluate the following logical expressions as true or false: ...
What is the output of the following code fragment?...
Write only the code necessary to declare a variable that would hold...
Assume that for each operation, a is 5, b is 14, and c is 8. a, b and...
Alert!

Advertisement