Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please. Using the below code Change the structure name to student and change the contents of the structure to contain a name and a

C++ please.

image text in transcribed

Using the below code Change the structure name to student and change the contents of the structure to contain a name and a student number. Adapt the print function appropriately. Extend the functionality of the program with the following functions routines: void insert name(student * head, string name, int student number); int list length(student * head); bool find student(student * head, int student number); void print student details(student *head); Demonstrate the functionality by writing a program that allows the user to input an aribtrary number of students, specified by the user at run time. The program should store these students in a linked list. The program should keep inputting students until the user inputs a user with the name end at which point all the user details should be printed to the screen. #include #include using namespace std; struct customer { string name; customer* next; }; void print_customers(customer& head) { customer* cur=&head; while (cur != NULL) { cout name next; } } int main({ customer customer1, customer2, customer3; customerl.next=&customer2; customer2.next = &customer3; customer3.next = NULL; customerl.name "Jack"; customer2.name "Jane"; customer3.name = "Joe"; print_customers(customerl); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

Qu es la Razn Rpida de Chester?

Answered: 1 week ago

Question

LO2.6 Explain how the market system deals with risk.

Answered: 1 week ago