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)
{
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller foxNotes. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $4.95. You're not tied to anything after your purchase.