Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer with work answer in C++ i will upvote youre creating a number printer that prints out digital looking numbers. initialize them using class's

please answer with work answer in C++ i will upvote
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
youre creating a number printer that prints out digital looking numbers. initialize them using class's with private and public variables. Also using child classes as subclasses. and use that to print the number inputs the user chooses to then print the digital looking form
image text in transcribed
Programming Project \#1 This is a more comprehensive programming project. You should should have formal code that is properly commented and include headers. Your comments will be evaluated after your code is submitted. The following multipliers will be applied: - Proper Comments: 100% - Minimal Comments 80% - No Comments 50% Task. You are to design and build a number-printer class hierarchy. There is one virtual parent class and three concrete subclasses. The parent class should be called NumberPrinter. The three subclasses are called SmallPrinter, Mediumprinter, and LargePrinter. Each class takes in three one-digit numbers [09] and prints it out in various formats. If the three numbers were 1, 2; and 3, then SmallPrinter would print: 123 MediumPrinter would print Each digit is four spaces wide and seven tall with one space between numbers - it is hard to see the spaces with the '7' digit. Think of it as an LCD display with two dashes per element. LargePrinter would print This function will need to be overridden by each of your subclasses. Constructors for your subclasses should not re define the construction: rather they should call the base constructor with the appropriate arguments (ff any) Your print() function (overriding) for each subclass may possibly need to call other functions that you write. If so, make these private members of the class. Note: You may only use the cout stream in your print0 function. Do not invoke other outside libranies to print on the screen. The print! function must stream the output to std out. Main Function You should create a main0 function to test your classes. It should do the following: - 1) Create a Mediumprinter object with the default constructor, then print it out. - 2) Create SmallPrinter and LargePrinter objects with values (5 79 ) and print them both out - 3) Change the values in the LargePrinter object to (478 ) using the "setter" operations and print it out again. - 4) Create an array of pointers to nine NumberPrinter objects. Make the first three be SmailPrinter objects with the values (0,12),(3,4, 5), (678). The next three will be MediumPrinter objects with the same series of values, and the last will be LargePrinter objects with the same series of values. - 5) Write a for0 loop to print out the values of the array of NumberPrinter objects. Normally for Parent classes and Child classes, you would have a separate .cpp/.h file for every class. Since this assignment involves 4 classes, you may put all classes in one . cpp/.h pair. Your main should go in the main.cpp file, but put all class declarations in NumberPrinter.h and all member function definitions in NumberPrinter.cpp. Run your program as often as youd like. before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the progrartis output in the second box NumberPrinterh and all member function definitions in NumberPrinter.opp. Comionabilities Run your program as often as yourd like, before submiting for grading. Below, type any reeded input values in the first bos, then olick Run pregram and obseske the programis cutput in the. second box Normally for Parent clastes and child clastes, yeu would have a septrate epp/.h file for every clast. Since this assignment involves 4 classes, you may put all clatses in one .,p/,h pair. Your main should go in the malnepp file, but put all class declarations in NumberPrinterh and all member function definitions in NumberPrinter cpp. Liat 4 201nis: 209.1. Progianning Project e1. NumberPrinter 0) 100 Run your program as often as youdd toe belore subriating for grading Delow. Type any needed input nilues in the first bex, then cick flun program and observe the progractis output in the posarid boe: This function will need to be overridden by each of your subclasses, Constructors for your subclasses should not re- define the construction rather they should call the base constructor with the appropriate arguments (if any). Your printO function (overriding) for each subclass may possibly need to call other functions that you write. If so, make these private members of the class. Note You may only use the cout stream in your printe function. Do not invoke other outside libraries to print on the screen. The print0 function must stream the output to std.out. Main Function You should create a main0 function to test your classes. It should do the following. - 1) Create a MediumPrinter object with the default constructor, then print it out. - 2) Create SmallPrinter and LargePrinter objects with values {579} and print them both out - 3) Change the values in the LargePrinter object to (478) using the "setter" operations and print it out again. - 4) Create an array of pointers to nine NumberPrinter objects. Make the first three be SmallPrinter objects with the values (012),(3,4. 5), {678). The next three will be Mediumprinter objects with the same series of values, and the last will be LargePrinter objects with the same series of values - 5) Write a for0 loop to print out the values of the array of NumberPrinter objects. Normally for Parent classes and Child classes, you would have a separate .cpp/.h file for every class. Since this assignment involves 4 classes, you may put all classes in one .cpp/.h pair. Your main should go in the main.epp file, but put all class declarations in NumberPrinter.h and all member function definitions in NumberPrinter.epp

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

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago