click below
click below
Normal Size Small Size show me how
CCS7 mod 4
Reviewer
| Question | Answer |
|---|---|
| If you have a structure named Person, how can you create a structure variable named s1 and s2? | Person s1, s2; |
| How many members are in this structure? struct Person { char name[50]; int age; double salary; }; | 3 |
| It is a collection of variables of different data types under a single name | Structure |
| The instance of the structure is known as: | Structure variable |
| Which of the following is a properly defined struct? | struct a_struct {int a;}; THIS IS CORRECT yet it is not by the canva struct {int a;}?!?! Ito yung tama amp |
| struct Person { string name; int age; }; int main() { Person student; student.name = "Ronel"; cout << _________________; return 0; } | student.name THIS IS CORRECT yet it is not by the loader |
| Which of the following accesses a variable in structure b? | b.var; |
| What operator is used to access the members of a structure? | dot operator |
| Can a structure contain an integer, string and double data type? | Yes |
| Check on the given structure: struct Person { char name[50]; int age; float salary; }; If you will create an instance of the structure named p1, what would be the command? | Person p1; |
| The function body is written inside ___________ | {} |
| The empty parentheses in a function means that it _______________ | doesn't have any parameters |
| Complete the following: struct Person { string name = "Ronel Ramos"; int age = 34; ________ salary = 70514.55; }; | double IS CORRECT yet it is not by the loader BOOLEAN?! yun yung tama amp |
| Two or more functions having the same name but different argument(s) | Overloaded function |
| What is the purpose of s from the following code? void displayData(Student s) { cout << "\nDisplaying Information." << endl; cout << "Name: " << s.name << endl; cout <<"Age: " << s.course << endl; } | Argument |
| struct ship { int size; } boat1, boat2; int main() { boat1.size = 10; boat2.size = 50; boat2.size += boat1.size; cout<< boat2.size; return 0; } | 60 |
| How many members are in this structure? struct Person { char name[50]; int age; float salary; }; | 3 |
| In the code: Student s; What does the s stand for? | Structure variable |
| Which of the following functions does not use a return statement? | Void Function |
| A ________________ can be passed to a function in similar way as normal argument. | Structure variable |
| You need to create an array from a structure named Students, which is correct? | Students stud[3]; |
| Which of the following statements assigns a value to the hourlyWage member of the employee? | employee.hourlyWage = 75.00; |
| Which of the following statements assigns a value to the age member of students? | students.age = 22; |
| Check the given structure: struct Person { string name; int age; float salary; }; The salary is : | A member |
| Which of the following is the correct declaration of a structure variable? | Person p,q; |
| What is a "structure" in C++? | All the above |
| void displayData(Person p) { cout << "\nDisplaying Information." << endl; cout << "Name: " << p.name << endl; cout <<"Age: " << p.age << endl; cout << "Salary: " << p.salary; } | Argument |
| int main() { structure hotel { int items; char name[10]; }a; strcpy(a.name, "Neji"); a.items=10; cout << a.name; return 0; } | Error |
| In the code: Student s; What does the s stand for? | Structure variable |
| struct ship { int size; } boat1, boat2; int main() { boat1.size = 10; boat2.size = boat1.size; cout<< boat2.size; return 0; } | 10 |
| A keyword used to define a structure? | struct |
| struct Person { string name; int age; double salary; }; int main() { Person s1; s1.name = "Ronel"; s1.age = 35; ____________ = 83095.99; return 0; } | s1.salary |
| A structure variable can be passed to a function in a similar way as a normal argument | True |
| What does struct Point arr[5]; do? | All of the mentioned |
| Which of the following is the correct declaration of a structure variable? | Student s1,s2; |
| Which of the following statements assigns a value to the age member of students? | students.age = 22; |
| It is a block of code to perform a specific task | Function |
| What will be used when terminating a structure? | ; |
| What is a "structure" in C++? | A structure is a collection of elements that can be of same data type. Elements of a structure are called members. All the above (Ito yung sagot hehe) A structure is a collection of elements that can be of different data type |
| It is simply a function that doesn't need to return anything | Void Function |