Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ question df Turn in a written report that contains your name on page one, and starting on page2 you write screen. all files -header

C++ questionimage text in transcribed

df Turn in a written report that contains your name on page one, and starting on page2 you write screen. all files -header files and source files-plus output file and a snippet of your output 1. Use separate source files and header files to create a class to represent desk. a. A desk object has attributes of color (string) and number of drawers (integer) b. Member functions (methods) are: default constructor with default parameter values of "Steel Blue" and 4, and that displays TnltConstructor called n". Use constructor initializer list format i. i. individual get methods for each attibute that are written as in-line functions ii. a get method (NOT in-line) that uses pass-by-reference for both parameters and has return-type void v. one set method that sets both attributes (NOT in-line) v. PrintMe method that returns string "Tm a ccolors desk with co drawers.", replacing ccolor and co with the appropriate attribute values vi. Destructor that displays InltDestructor called in" 2. Write a complete program that uses the desk dass. a. Declare a vector of S objects of desk class b. Declare a single desk object and tnitialize it at declaration to have color "Silver c. Call the PrintMe method of the single object and display to the screen d. Ask the user for the name of a file to which output should be written e. Call a void function that has the vector of 5 desks as one parameter and the file name as the other. That function should: . Ask the user for S colors and 5 numbers and assign them to each desk in the vector. The numbers must be verified as non-negative or else get another number non-negative . For the 2 desk, if the color's name is 4 or more characters long, change the 3" i. Open the file and write to it using PrintMe method for all desks in your vector one line, followed by PrintMe information for deskd's) with that many drawers on the next character of the name to ' Explicitly close the output file Determine which desk(s) has the most drawers. Then, display on the screen "Most drawerson t. line(s)

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago