Hi Please help When I try to call the given_name function from the main, my error says "use of undeclared identifier given_name" even though I already included the proper libraries
Hi Please help When I try to call the given_name function from the main, my error says "use of undeclared identifier given_name" even though I already included the proper libraries
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
Hi Please help
When I try to call the given_name function from the main, my error says "use of undeclared identifier given_name"
even though I already included the proper libraries
![C+ Student.cpp
> f Student
1 #include <iostream>
2 #include <cstring>
3 #include <stdlib.h>
IE
4 #include <string>
5
#include "Student.h"
6
#include "Date.h"
7
#include "Names.h"
8
using namespace std;
9
10
11
12
13
2225
X
unsigned Student::nextID = 1000;
14▼ Student::Student (const string &n, const string& p, const string& b) : ID_() {
15 name = n;
16
17
18
19
11
cout << endl << n << " was born on << b<< endl;
20
cout << "Student ID #:' << nextID <<
21 }
22
23 string Student::given_name() const {
24
+
27
26 }
pronouns_ = p;
birthday_ = b;
nextID++;
string first_name
return first_name;
=
name_.substr(0,
I
endl << "Pronouns: << p << endl;
11
_');
["
> Console x
Shell x +
>sh -c make -s
./main.cpp:35:1: error: use of undeclared identifier 'given_name'
given_name();
1 error generated.
make: *** [Makefile:9: main] Error 1
exit status 2](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F46c0fb16-724b-4726-818c-9156075ac6cc%2F3ca7c054-81a1-4504-bf56-b9ba9d5d6bad%2Fg7lbdk_processed.jpeg&w=3840&q=75)
Transcribed Image Text:C+ Student.cpp
> f Student
1 #include <iostream>
2 #include <cstring>
3 #include <stdlib.h>
IE
4 #include <string>
5
#include "Student.h"
6
#include "Date.h"
7
#include "Names.h"
8
using namespace std;
9
10
11
12
13
2225
X
unsigned Student::nextID = 1000;
14▼ Student::Student (const string &n, const string& p, const string& b) : ID_() {
15 name = n;
16
17
18
19
11
cout << endl << n << " was born on << b<< endl;
20
cout << "Student ID #:' << nextID <<
21 }
22
23 string Student::given_name() const {
24
+
27
26 }
pronouns_ = p;
birthday_ = b;
nextID++;
string first_name
return first_name;
=
name_.substr(0,
I
endl << "Pronouns: << p << endl;
11
_');
["
> Console x
Shell x +
>sh -c make -s
./main.cpp:35:1: error: use of undeclared identifier 'given_name'
given_name();
1 error generated.
make: *** [Makefile:9: main] Error 1
exit status 2
![C+ main.cpp x +
8 using namespace std;
9 int main() {
10 ▼ /*
11 cout << "Testing the overloaded operator <<" << endl;
12 Date date;
13 for (int i= 0; i < 3; i++) {
cin >> date;
cout<<date << endl << endl;
14
15
16 }
17
18
19
20 Date date1, date2;
21
22
23
24
25
cin>> date2;
26 cout <<date2 << endl << endl;
27
if(date1<date2) {
28 cout << date1 << " < "<<date2 << endl << endl;
29 }
30
else cout << date1 << " > " << date2 << endl << endl;
31
*/
32 Student stu1("Jessica Hernandez", "she/her/hers", "02/12/1999");
Student stu2("Brian Ramirez", "he/him/his", "01/17/1990" );
33
34
35 given name();
36 return 0;
37 }
cout << "Testing the overloaded operator <" << endl;
[14
for (int i=0; i<3; i++) {
cin >> datel;
cout<<date1 << endl << endl;
⠀
> Console x
Shell x +
>sh -c make -s
./main.cpp:35:1: error: use of undeclared
en_name'
given_name();
1 error generated.
make: *** [Makefile:9: main] Error 1
exit status 2](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F46c0fb16-724b-4726-818c-9156075ac6cc%2F3ca7c054-81a1-4504-bf56-b9ba9d5d6bad%2Fupev9ms_processed.jpeg&w=3840&q=75)
Transcribed Image Text:C+ main.cpp x +
8 using namespace std;
9 int main() {
10 ▼ /*
11 cout << "Testing the overloaded operator <<" << endl;
12 Date date;
13 for (int i= 0; i < 3; i++) {
cin >> date;
cout<<date << endl << endl;
14
15
16 }
17
18
19
20 Date date1, date2;
21
22
23
24
25
cin>> date2;
26 cout <<date2 << endl << endl;
27
if(date1<date2) {
28 cout << date1 << " < "<<date2 << endl << endl;
29 }
30
else cout << date1 << " > " << date2 << endl << endl;
31
*/
32 Student stu1("Jessica Hernandez", "she/her/hers", "02/12/1999");
Student stu2("Brian Ramirez", "he/him/his", "01/17/1990" );
33
34
35 given name();
36 return 0;
37 }
cout << "Testing the overloaded operator <" << endl;
[14
for (int i=0; i<3; i++) {
cin >> datel;
cout<<date1 << endl << endl;
⠀
> Console x
Shell x +
>sh -c make -s
./main.cpp:35:1: error: use of undeclared
en_name'
given_name();
1 error generated.
make: *** [Makefile:9: main] Error 1
exit status 2
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.
Step by step
Solved in 2 steps with 4 images
![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.Similar questions
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