[S2-SUMMATIVE] Summative Assessment 2 - STRUCTURES REVIEWER

Structures Review Quiz
Test your knowledge of structures in C++ with this comprehensive quiz designed to reinforce your understanding of fundamental concepts. Whether you're a student preparing for exams or a professional brushing up on your skills, this quiz is for you!
Topics covered include:
- Declaring and defining structures
- Working with structure variables
- Fun
ctions utilizing structures
How many members are in this structure?
struct Person
{
char name[50];
int age;
double salary;
};
Complete the code below:
#include <iostream>
#include <string>
using namespace std;
struct Person
{
string name;
int age;
double salary;
};
int main()
{
Person s1;
s1.name = "Ronel";
s1.age = 35;
____________ = 83095.99;
return 0;
}
Check the given structure:
struct Person
{
string name;
int age;
float salary;
};
The salary is :
What is the purpose of p from the following code?--
void displayData(Person p)
{
cout << "\nDisplaying Information." << endl;
cout << "Name: " << p.name << endl;
cout <<"Age: " << p.age << endl;
cout << "Salary: " << p.salary;
}
In the code:
Student s;
What does the s stand for?
How many members are in this structure?
struct Person
{
char name[50];
int age;
float salary;
};
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;
}
Complete the following:
struct Person
{
string name = "Ronel Ramos";
int age = 34;
________ salary = 70514.55;
};
Complete the code below:
#include <iostream>
#include <string>
using namespace std;
struct Person
{
string name;
int age;
};
int main()
{
Person student;
student.name = "Ronel";
cout << _________________;
return 0;
}
What is the output of the program?
int main()
{
structure hotel
{ int items;
char name[10];
}
a;
strcpy(a.name, "Neji");
a.items=10;
cout << a.name;
return 0;
}
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?
;
What is the output of the following program?
#include <iostream>
using namespace std;
struct ship
{
int size;
} boat1, boat2;
int main()
{
boat1.size = 10;
boat2.size = 50;
boat2.size += boat1.size;
cout<< boat2.size;
return 0;
}
What is the output of the following program?
#include <iostream>
using namespace std;
struct ship
{
int size;
} boat1, boat2;
int main()
{
boat1.size = 10;
boat2.size = boat1.size;
cout<< boat2.size;
return 0;
}