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-
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
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 :](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe444b5e4-3657-44ce-8fa3-69e9397b0e32%2F933b947c-1292-437a-ae8e-c60fdfcf67b3%2Fdn20l8k_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education