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 WITH 100% CORRECT ANSWERS | GRADED A+

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

CMSC 140- FINAL EXAM QUESTIONS WITH 100% CORRECT ANSWERS | GRADED A+ 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] - answer-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 - answer-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. - answer-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) - answer-True QUESTION 5Using 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 - answer-#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), - answer-True QUESTION 7: Which of the following is a correct statement about for loop (select two) - answerQUESTION 8 Vinte a function prototype and a function definition called average that receives an array of type integer, and the number of elements in the arra) It returns the average of the numbers in the array - answer-double average(int arr[ ], int size); double average(int arr[ ], int size) { int sum = 0; for (int i = 0; i size; ++i) { sum += arr[i]; }return static_castdouble(sum) / size; } QUESTION 9: Evaliate the following expression (25.0/2* (8/3)) -1 [x1] - answer-24 QUESTION 10: REDO Evaluating Output 2 De be of on be alone code see elito los, please kenty aed oglin. 1 poine - answerQUESTION 11: Rewrite the following conditional expressions as if else statements cout((num%5)==0)? " jackpot !!" "Sorry !!n"; - answer-if ((num % 5) == 0) { cout "jackpot !!" endl; } else { cout "Sorry !!" endl;

Show more Read less
Institution
CMSC 140
Course
CMSC 140









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CMSC 140
Course
CMSC 140

Document information

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

Subjects

$11.49
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.
SARAHnkalu West Virgina University
Follow You need to be logged in order to follow users or courses
Sold
29
Member since
1 year
Number of followers
0
Documents
2365
Last sold
1 week ago
KnowledgeNest

I help students succeed with exams and practice tests . Learn smarter, practice more and ace your exams with confidence!!

4.6

7 reviews

5
6
4
0
3
0
2
1
1
0

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