100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS1511 assignment 3 2023

Beoordeling
-
Verkocht
1
Pagina's
30
Cijfer
A
Geüpload op
13-09-2023
Geschreven in
2023/2024

solutions for COS1511 assignment 3 2023 95%

Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
13 september 2023
Aantal pagina's
30
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

UNISA  2023  COS1511-23-Y  Welcome to COS1511 Module Site  Assessment 3

QUIZ




Question 1

Answer saved

Marked out of 1.00




Consider the following struct definition:
struct temp {

int b; };
temp s[50];
The correct syntax to access the member of the ith structure in the array of
structures is?



a. s.b.[i];

b. s.[i].b;

c. s.b[i];

d. s[i].b;

Clear my choice




Question 2

Answer saved

Marked out of 1.00




Given the declaration below, which statement assigns the element in the first
row and first column a value of 99?

int scores[3][2] = {0};



a. scores[1][1] = 99;

b. scores[0][0] = '99';

c. scores[0][0] = 99;

d. scores[1][1] = "99";

Clear my choice

,Question 3

Answer saved

Marked out of 1.00




Which of the following function header lines is valid for a function called
findMax that finds and returns the maximum value stored in an array of integers
that is passed in as a parameter?



a. int findMax(int [])

b. int findMax(int values[])

c. int findMax(int)

d. int findMax([])

Clear my choice




Question 4

Answer saved

Marked out of 1.00




Given the declarations below, using the find function, write the statements to
search the number string variable to determine if the sequence "123" exists. The
location should be placed in the position variable.
int position = 0;
string number = "1234567890";




a. position = number.find(123);

b. find("123", 0);

c. position = number.find("123", 0);

d. find(number("123", 0), position);

Clear my choice

, Question 5

Answer saved

Marked out of 1.00




Which one of the following options represents the output of the program below?

struct play
{

int score, bonus;
};
void calculate(play &p, int n = 10)
{

p.score++;
p.bonus += n;

}
int main()

{
play pl = {10, 15};

calculate(pl, 5);
cout << pl.score << ":" << pl.bonus << endl;

calculate(pl);
cout << pl.score << ":" << pl.bonus << endl;

calculate(pl, 15);
cout << pl.score << ":" << pl.bonus << endl;
return 0;

}


a. 11:20
12:30
13:45

b. 16:10
17:40
18:55

c. 10:20
11:30
12:45

d. 11:10
12:20
13:35

Clear my choice

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.
foxNotes Acsess Business Academy
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
112
Lid sinds
2 jaar
Aantal volgers
63
Documenten
35
Laatst verkocht
3 maanden geleden
saveNotes

5,0

5 beoordelingen

5
5
4
0
3
0
2
0
1
0

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 Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

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

Alisha Student

Veelgestelde vragen