100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

COS assignment 3 solutions 96% (questions maybe different)

Puntuación
-
Vendido
-
Páginas
30
Grado
A+
Subido en
13-09-2023
Escrito en
2023/2024

COS assignment 3 solutions (questions maybe different)

Institución
Grado

Vista previa del contenido

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

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
13 de septiembre de 2023
Número de páginas
30
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$5.70
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
CrystalIndigo University of South Africa (Unisa)
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
486
Miembro desde
5 año
Número de seguidores
226
Documentos
73
Última venta
5 meses hace
CrystalIndigo Solutions

providing all solutions to all computer science modules

4.1

51 reseñas

5
27
4
13
3
6
2
1
1
4

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes