Question: C. A structure pointer Just like you can define a pointer of a standard data-type such as an int or a double, you can also

C. A structure pointer

Just like you can define a pointer of a standard data-type such as an int or a double, you can also define a pointer of programmer defined data-type (which is a struct). The syntax is identical. struct_name *struct_pointer_name; Remember that to access a structure member using a pointer, you have use the -> operator. For example, struct_pointer_name->struct_member_name In this program, we will define a structure and a structure pointer, do some operations on the members using the pointer. Using this template to start your code

#include using namespace std;

struct Employee {

string name; int experience; double bonus; }

int main() {

} ~

Update the provided code as follows Declare an Employee pointer and assign dynamic memory to it. Using a suitable message, prompt the user to enter value for name and number of years of experience for the employee. Calculate the bonus for the employee using the following criterion. o If years of experience is greater than 10, bonus is 5000.00. o Otherwise, bonus is 3000.00. Display the name of and the bonus earned by the employee using a suitable message. Delete the structure pointer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!