Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1: A Bar for Charts! @ Points: 25% Required API Implement class Bar, to represent a Bar in a Bar Chart. Each bar has:
Part 1: A Bar for Charts! @ Points: 25% Required API Implement class Bar, to represent a Bar in a Bar Chart. Each bar has: a length (a non-negative integer). a label (a string describing the bar). a color (an integer between 1 and 16 inclusive). The class must have the following public API: // public constructor Bar(int length=1, string label="", int color=GREE // getters int getLength() const string getLabel() const int getColor() const // setters void setLength(int) void setLabel(string) void setColor(int) // prints the bar to the screen after scaling it void print(float factor=1); Colors We will use colors.h for printing with colors. This header file provides 16 different colors that can be used as background colors for the printed text. Here is am example for using the header file: #include "colors.h" #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started