Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CMSC 140 FINAL EXAM QUESTIONS AND ANSWERS LATEST UPDATE

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
30-10-2025
Written in
2025/2026

CMSC 140 FINAL EXAM QUESTIONS AND ANSWERS LATEST UPDATE QUESTION 1: The last legal subscript that can be used with the array intlist declared below (see array declaration below) is [×1) Avray declaration: intlist [10] - Answers 9 QUESTION 2: Indicate If the following condition is True or False Assume the variables x=5 y=6 and z=8 7 =(x+y) && z 4 - Answers True QUESTION 3: Choose the best answer to fill in the blank in the statement below. A (An) BLANK function is a function that doesn't return a value. - Answers Void QUESTION 4: Indicate if the following expression is True or False Assume the variables int a=3, b=4, c=6, 4!=b || c! = (a+3) - Answers True QUESTION 5 Using a looping structure, prompt uner for positive integer values from the keyboard. Ignore all negative values and terminate the loop once a value that is greater than 10 is entered. After the loop ends , print the total of the read integers Enter an integer 4 Enter an integer 8 Enter an integer 0 [Console] invalid please try again Enter an integer 10 Enter an integer: 11 Total: 22 - Answers #include iostream using namespace std; int main() { int total = 0, num; while (true) { cout "Enter an integer: "; cin num; if (num 0) cout "Invalid input. Please try again." endl; else if (num 10) break; else total += num; } cout "Total: " total endl; return 0; } QUESTION 6: ind cato it tho lotowina expression is True or Falsel Assume the variables int a = - 3, b = 6, c = 6, a=-1 || c = (b+a/2), - Answers True

Show more Read less
Institution
CMSC 140
Course
CMSC 140

Content preview

CMSC 140 FINAL EXAM QUESTIONS AND ANSWERS LATEST UPDATE 2025-2026

QUESTION 1:



The last legal subscript that can be used with the array intlist declared below (see array
declaration below) is [×1)

Avray declaration: intlist [10] - Answers 9

QUESTION 2:



Indicate If the following condition is True or False

Assume the variables x=5 y=6 and z=8

7 <=(x+y) && z > 4 - Answers True

QUESTION 3:

Choose the best answer to fill in the blank in the statement below.

A (An) BLANK function is a function that doesn't return a value. - Answers Void

QUESTION 4:



Indicate if the following expression is True or False

Assume the variables int a=3, b=4, c=6,

4!=b || c! = (a+3) - Answers True

QUESTION 5



Using a looping structure, prompt uner for positive integer values from the keyboard. Ignore all
negative values and terminate the loop once a value that is greater than 10 is entered. After the
loop ends , print the total of the read integers



Enter an integer 4

Enter an integer 8

, Enter an integer 0

[Console] invalid please try again

Enter an integer 10

Enter an integer: 11

Total: 22 - Answers #include <iostream>

using namespace std;



int main() {

int total = 0, num;



while (true) {

cout << "Enter an integer: ";

cin >> num;



if (num < 0)

cout << "Invalid input. Please try again." << endl;

else if (num > 10)

break;

else

total += num;

}



cout << "Total: " << total << endl;



return 0;

Written for

Institution
CMSC 140
Course
CMSC 140

Document information

Uploaded on
October 30, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TutorJosh Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
450
Member since
1 year
Number of followers
16
Documents
32010
Last sold
1 day ago
Tutor Joshua

Here You will find all Documents and Package Deals Offered By Tutor Joshua.

3.5

73 reviews

5
26
4
16
3
14
2
1
1
16

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions