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
icon
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
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
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
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
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
  • SEE MORE 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