Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

CPTS 121 EXAM 2 QUESTIONS AND ANSWERS 2026

Beoordeling
-
Verkocht
-
Pagina's
18
Cijfer
A+
Geüpload op
19-02-2026
Geschreven in
2025/2026

CPTS 121 EXAM 2 QUESTIONS AND ANSWERS 2026

Instelling
CPTS 121
Vak
CPTS 121

Voorbeeld van de inhoud

CPTS 121 EXAM 2 LATEST
What is a structure or struct in C? Explain. - ANSWERS-Allows for
multiple data types under one variable defined by user.


What is an input validation loop? - ANSWERS-A loop that stops when
it is equal to something example: while(input != valid).


What is a C string? - ANSWERS-An array of characters ended by the
NULL character.


A(n) __________ is a variable that stores as its contents the address of
another variable. - ANSWERS-Pointer


A loop that executes "forever" is known as a(n)________ loop. -
ANSWERS-infinite


A(n) ___________ loop is a pattern in which the number of loop
repetitions is generally not known before loop execution. The condition
relies on a special value to terminate the loop. - ANSWERS-input
validation loop




END OF
PAGE
1

, CPTS 121 EXAM 2 LATEST
The act of joining two strings is called __________. The string library
function that performs the joining is called ______________. -
ANSWERS-String cat and strcat


A(n) _______ structure is a way of storing and organizing information.
An array is an example of one of these. - ANSWERS-data


The dereference or indirection operator is represented by the ________
symbol or character in C. - ANSWERS-*sum = i + j


True / False: Evaluating the expression strcmp("dog", "Dog") results in
the value 0 returned from strcmp (). - ANSWERS-False


True / False: An input validation loop is a pattern which is used to repeat
statements as long as a user entered value is not within a valid range. A
do-while loop is best suited for this pattern. - ANSWERS-True


True / False: array[index] is equivalent to (array + index). - ANSWERS-
False




END OF
PAGE
2

, CPTS 121 EXAM 2 LATEST
Answer the following questions based on the array declaration below:
char vehicle[20] = "porsche", my_candy[5] = "twix"; - ANSWERS-
Below


a.The value of strlen(vehicle) is _________ - ANSWERS-7


b. The contents of my_candy[4] is - ANSWERS-\0\


c. The value of strcmp (vehicle, "dodge") is: negative, positive, or zero?
- ANSWERS-positive


d. The contents of my_candy after the call strncpy(my_candy, vehicle,
2) is - ANSWERS-park


e. The contents of vehicle[3] after the call strcat (vehicle,
&my_candy[2]) is: - ANSWERS-'s'


(8 pts) Write a function called sum_squares () that accepts an integer n
as an argument, and returns the sum of the squares of each number
between 1 to n, inclusive: i.e. 1^2 + 2^2 + 3^2 + 4^2 + ... + (n - 1)^2 +
n^2. Precondition: n must be greater than or equal to 1. - ANSWERS-int
sum_squares(int n) {
END OF
PAGE
3

Geschreven voor

Instelling
CPTS 121
Vak
CPTS 121

Documentinformatie

Geüpload op
19 februari 2026
Aantal pagina's
18
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$18.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Teacher101 Teachme2-tutor
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
472
Lid sinds
2 jaar
Aantal volgers
74
Documenten
10486
Laatst verkocht
2 dagen geleden

Quality is my middle name.....100% ...my policy is to create and nurture people of quality by continuous education and training.....i guaranteed good grades 100% Feel free to get in touch through inbox...anything regarding help or issue with the exams posted... Finally after purchase please leave a good rating if satisfied with my work.... All the best as we continue working to improve ourselves through education

4.6

274 beoordelingen

5
222
4
15
3
26
2
3
1
8

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen