Define a struct type to represent a university student with a name, surname, course, year. 2) Define a couple of named instances, e.g., David, Pearl, Computing, Year1. 3) Apply selector function to return the course and year of your student.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

) Define a struct type to represent a university student with a name, surname, course,
year.
2) Define a couple of named instances, e.g., David, Pearl, Computing, Year1.
3) Apply selector function to return the course and year of your student.
4) Write a function that updates the year of a student, i.e. if year is “Year1”, then
update to “Year2”, if year is “Year2”, then update to “Year3”, if the year is “Year3”
then updated to “Graduated”. Make sure to write what the difference between
mutable and immutable is.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Datatypes
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning