Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 5 0 , RGB ( 2 5 5 , 1 0 0 , 1 0 0 ) . base = alturad = 1 0

150, RGB (255,100,100). base = alturad =100; color = RGB(255,255,100);
call the fPLot function of the object where the console pixels are painted, taking into
consideration the initial values that were applied to the object.
void RecticfPlet(){ SetWindeWPes(m\CCens%le,0,0,500,600,500, SWP_NOMOVE | SWP_NOZORDER); for (int ycoer = yIrait; \cser (XInit +((int)gltura)); ++yCoer){//vertical plot } Releasecc(m\Censole, m\DC); Flowchart / draw a flow chart.Make a project in C++ that encodes an object called a rectangle of the Rect class where it invokes a function that paints the pixels of the rectangle's measure in red.
Encode a "header" file with the attributes of the class objects and their functions, where the fPlot function is found, which is to paint the rectangle in the console.
Header file:
#ifndef RECT_H_
#define RECT_H_
#include "windows.h"
class Rect{
private:
double base, altura, xInit, yInit;
COLORREF color;
public:
Rect();
Rect(double, double, double, double, COLORREF);
~Rect();
void setBase(double);
void setAltura(double);
double getBase() const;
double getAltura() const;
void setColor(COLORREF);
void setCoords(double, double);
void mooveCoords(double, double);
void fPlot();
void fErase();
};
#endif
Encode an object called a rectangle, which is initialized with the values: 100,100,150,150, RGB (255,100,100).
Rect::Rect(){
base = altura =100;
xInit = yInit =100;
color = RGB(255,255,100);
}//default constructor
call the fPLot function of the object where the console pixels are painted, taking into consideration the initial values that were applied to the object.
void Rect::fPlot(){
HWND myConsole = GetConsoleWindow();
SetWindowPos(myConsole,0,0,500,600,500, SWP_NOMOVE | SWP_NOZORDER);
HDC myDC = GetDC(myConsole);
for (int yCoor = yInit; yCoor (yInit +((int)altura)); ++yCoor){//vertical plot
for (int xCoor = xInit; xCoor (xInit +((int)base)); ++xCoor)//horizontal plot
SetPixel(myDC, xCoor, yCoor, color); //pixel painter
}
ReleaseDC(myConsole, myDC);
}//plotting functionMake a project in C++ that encodes an object called a rectangle of the Rect class
where it invokes a function that paints the pixels of the rectangle's measure in red.
Encode a "header" file with the attributes of the class objects and their functions, wher
the fPlot function is found, which is to paint the rectangle in the console.Header file:
#ifndef RECT_H_
#define RECT_H_
#include "windows.h"
class Rect{
private:COLORREF SOlor:
public:Rect(double, double, double, double, COLORREF);void setbase(double);double getRase() const;void Setcolac(COLORREF);void meg\ecoerds(double, double);void fEcase();Make a project in C++ that encodes an object called a rectangle of the Rect class
where it invokes a function that paints the pixels of the rectangle's measure in red.
Encode a "header" file with the attributes of the class objects and their functions, wher
the fPlot function is found, which is to paint the rectangle in the console.Header file:
#ifndef RECT_H_
#define RECT_H_
#include "windows.h"
class Rect{
private:COLORREF SOlor:
public:Rect(double, double, double, double, COLORREF);void setbase(double);double getRase() const;void Setcolac(COLORREF);void meg\ecoerds(double, double);void fEcase();
};
#endif
};
#endif
image text in transcribed

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Is this really true, or am I just taking it for granted?

Answered: 1 week ago