2) Which of the following statements about creating an array (size 20) of the below structure is true? struct Employee{ string emp_id; string emp_name; string emp_sex;}; 111101101 01010101111110 10101010101012 101010 A. None of the answers B. Employee emp[20]; C Employee empl0-191-

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
1) What is the output of the following code after fixing the errors if any?
(assume all libraries are included).
struct MyStruct {
{
int foo(int, int);
int myArr[8] = {6, 5, 10, 11, 37, 5, 40, 6};
int myVar;
}
int MyStruct::foo(int i, int e) {
if(i ==mVar)
return 0;
if(myArr % e == 0)
return myArr[i] + foo(++i, e);
}
Return foo(++i, e);
}
int main(){
MyStruct struct;
strt.mVar = 8;
cout << strt.foo(0,3);
return 0;
}
01010
111101101
0101010111111
101010101
A. 13
B. 15
C. 20
D. 21
E. 17
F. 16
G. None of the answers
iTeam
struct Employee{
string emp_id;
2) Which of the following statements about creating an array (size 20) of the
below structure is true?
001010
111101101
01010101111116
1010101010101
111010101010
101100
string emp_name;
string emp_sex;};
111101101
01010101111110
10101010101012
A. None of the answers 101010
B. Employee emp[20];
C. Employee emp[0-19];
D. Employee [] emp=new Employee[20];
E. Emp Employee [20];
A. True
B. False
3) You can use vectors to store elements in a 2-D array like structure, this
sentence is :
Transcribed Image Text:1) What is the output of the following code after fixing the errors if any? (assume all libraries are included). struct MyStruct { { int foo(int, int); int myArr[8] = {6, 5, 10, 11, 37, 5, 40, 6}; int myVar; } int MyStruct::foo(int i, int e) { if(i ==mVar) return 0; if(myArr % e == 0) return myArr[i] + foo(++i, e); } Return foo(++i, e); } int main(){ MyStruct struct; strt.mVar = 8; cout << strt.foo(0,3); return 0; } 01010 111101101 0101010111111 101010101 A. 13 B. 15 C. 20 D. 21 E. 17 F. 16 G. None of the answers iTeam struct Employee{ string emp_id; 2) Which of the following statements about creating an array (size 20) of the below structure is true? 001010 111101101 01010101111116 1010101010101 111010101010 101100 string emp_name; string emp_sex;}; 111101101 01010101111110 10101010101012 A. None of the answers 101010 B. Employee emp[20]; C. Employee emp[0-19]; D. Employee [] emp=new Employee[20]; E. Emp Employee [20]; A. True B. False 3) You can use vectors to store elements in a 2-D array like structure, this sentence is :
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education