Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ console program that prompts a user to enter attributes for three students, and outputs the collected data in a nicely-formatted table. Name

Write a C++ console program that prompts a user to enter attributes for three students, and outputs the collected data in a nicely-formatted table. Name the CPP as you wish.

This is very similar to the program sample earlier in this module with Jack and Jill and their classmate, except that all three are to be entered using cin, not just the one classmate. Since the code block to prompt the user for attributes and cin and store their values is to be used three times instead of just one, write a generic value-returning function to do all that and return a Student object. Call it three times from main -- once for each student.

You may write a void function to output the result for a Student object, shared as a parameter. Or do so in a code block in main -- your choice.

Here are other requirements:

Customize the attributes. Include exactly five of your choosing.

Include table column headings, correctly-spaced.

The total of all column widths and the spaces separating them should not exceed 80 spaces.

You choose which attributes to left-justify, right-justify, or center (centering is not easy -- use Q&A to exchange ideas!).

Use cin >> for at least one attribute, and getline for at least one.

Use the string buffer method to cin numbers (as per usual).

Serialize down to students.txt as the last thing that your program does. If you do this right, the file should have 15 lines -- 5 for each of the 3 objects.

We will not fully implement serialization in this assignment. But to prepare for it in later assignments, you'll include "serializing down" int his one. It will have no effect on the program, because you won't be serializing up. But it's done this way here to get you used to making sure that serializing down works right before attempting add serializing up in all future work.

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

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago