This lab will explore how to define a new C++ data type and also how to combine multiple C++ files into a single executable program. The lab has the following requirements: • Please make sure all your function must have function header documentation, please see PrintMeFirst function as example. • student.h file: Write a struct Student and save it in student.h file with the following: o struct Student must have the following data field: name of data type string • idNum of data type int • creditHours of data type int gpa of data type double • student.cpp file: o write a function Student getData ( ) that will do the following: • define a local variable Student studentInfo • this function will ask user to enter "Student name" and save the user input to the data member name of local variable studentInfo • this function will ask user to enter "Student ID" and save the user input to the data member idNum of local variable studentInfo this function will ask user to enter "Student name" and save the user input to the data member creditHours of local variable studentInfo • this function will ask user to enter "Student name" and save the user input to the data member gpa of local variable studentInfo return studentInfo o write a function void printStudentīnfo(Student studentInfo) that will do the following: • print out the all the data member of studentInfo printMeFirst.h file: I have provided this file printMeFirst.cpp file: I have provided this file • Makefile file: I have provide this file studentMain.cpp file: This is a test driver program. I have provided this file, but you need to change the parameters for printMeFirst function to your own name and the name of this lab. • After your compile all these programs, it will link into an executable program studentMain Run studentMain program, and it should have a similar output below:
This lab will explore how to define a new C++ data type and also how to combine multiple C++ files into a single executable program. The lab has the following requirements: • Please make sure all your function must have function header documentation, please see PrintMeFirst function as example. • student.h file: Write a struct Student and save it in student.h file with the following: o struct Student must have the following data field: name of data type string • idNum of data type int • creditHours of data type int gpa of data type double • student.cpp file: o write a function Student getData ( ) that will do the following: • define a local variable Student studentInfo • this function will ask user to enter "Student name" and save the user input to the data member name of local variable studentInfo • this function will ask user to enter "Student ID" and save the user input to the data member idNum of local variable studentInfo this function will ask user to enter "Student name" and save the user input to the data member creditHours of local variable studentInfo • this function will ask user to enter "Student name" and save the user input to the data member gpa of local variable studentInfo return studentInfo o write a function void printStudentīnfo(Student studentInfo) that will do the following: • print out the all the data member of studentInfo printMeFirst.h file: I have provided this file printMeFirst.cpp file: I have provided this file • Makefile file: I have provide this file studentMain.cpp file: This is a test driver program. I have provided this file, but you need to change the parameters for printMeFirst function to your own name and the name of this lab. • After your compile all these programs, it will link into an executable program studentMain Run studentMain program, and it should have a similar output below:
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 5PP: (Data processing) Write a C++ program that reads the file created in Exercise 4, permits the user to...
Related questions
Question
so every time I ask this question and the code that is provided does not compile it gives a "student.h" header file error
can u please fix that and give me the right code that will compile.
I also provided the code that I get from the tutor it's not compiling.
Expert Solution
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
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
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr