1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
statuscvo [17]
3 years ago
7

Implement a class Rectangle that works just like the other graphics classes such as Circle or Line. A rectangle is constructed f

rom two corner points. The sides of the rectangle are parallel to the coordinate axes: You do not yet know how to define a << operator to plot a rectangle. Instead, define a member function plot. Supply a function move. Pay attention to const. Then write a sample program that constructs and plots a few rectangles.
Computers and Technology
1 answer:
kherson [118]3 years ago
6 0

Answer:

Answer explained below with appropriate steps and C++ code

Explanation:

<u>Step 1: </u>

  • Two corner points to draw a rectangle are left top and right bottom corner coordinates.
  • Left and top specifies the X-coordinate and Y-coordinate of top left corner respectively.
  • Right and bottom specifies the X-coordinate and Y-coordinate of right bottom corner respectively.
  • Library graphics.h is declared to use different graphical operations.
  • Member function rectangle() is called 4 times to represent 4 rectangles.

<u>Step 2: </u>

// Program to draw a rectangle using graphics header

#include<graphics.h>

#include<conio.h>

#include<iostream>

int main ()

{

   //To clear the screen

   clrscr ();

//gm is used so that program can enter into graphic mode.

int gm;

   //DETECT is used to tell the compiler that which graphics drivers need to be used

int grap = DETECT;

   //Location of 4 rectangles

int left = 150, top = 250, right = 450, bottom = 350;

int l1 = 150, t1 = 150, r1 = 450, b1 = 450;

int l2 = 250, t2 = 350, r2 = 450, b2 = 150;

int l3 = 250, t3 = 150, r3 = 350, b3 = 450;

   //initgraph function is used to reset the settings of graphics to their default settings.

   initgraph (&grap, &gm, "");

   // rectangle function is called

   rectangle (left, top, right, bottom);

rectangle (l1, t1, r1, b1);

rectangle (l2, t2, r2, b2);

rectangle (l3, t3, r3, b3);

getch ();

   //closegraph function is used to close all the settings that was revoked by gm and initgraph().

   closegraph ();

return 0;

}

You might be interested in
Which of the following is considered a modern method of communication?
Vika [28.1K]
The answer is C. Tablet, because that is the quickest, easiest, and most recent way of communication.
4 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
Alekssandra [29.7K]

Answer:

kinesthetical

Explanation:

please give brainliest please and good luck :)

8 0
2 years ago
Suppose that a laptop identifies its processor as follows: AMD’s A84500M. What does the AMD represent?
zalisa [80]

Answer:

Advanced Micro Devices

Explanation:

4 0
3 years ago
WHO SAYS BUP ALL THE TIME ​
Delvig [45]

Answer:

Mario

Explanation:

7 0
3 years ago
In five to ten sentences, explain what netiquette is and how it improves efficiency and productivity in the workplace.
dlinn [17]

Netiquette is a form of communication done correctly online. Good netiquette involves respecting others privacy, using correct grammar, and not doing anything online that will annoy or disrupt others. It is important to have netiquette while online, because communication online is non verbal and you can’t tell how someone is reacting. Having netiquette is important. It implies that you have polite behaviors, and want to build up relationships with people in your work space or at a party you plan on attending. Netiquette is one way to show respect to a person, and to show that you deserve respect. It improves how you organize your writing, and shows how productive you can be. By helping you to become polite online and respectful to other users of the internet, Netiquette is especially important for future letters, emails, or other writing forms.


4 0
3 years ago
Read 2 more answers
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n)
    10·2 answers
  • Which of the following might an early 20th -century film producer do in order to draw an audience?
    13·1 answer
  • A self-confident person knows that:
    13·1 answer
  • Instructions:Drag the tiles to the boxes to form correct pairs.
    11·2 answers
  • Which option in presentation software can you use to apply a “fly in” effect to the objects on a slide? A)flowchart B)shapes C)
    11·2 answers
  • Your friend’s parents are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    10·2 answers
  • Explain each of the three important concepts behind the Federal Networking Council's definition of the term Internet. Explain ho
    8·1 answer
  • Tweaking existing technology in a new way is usually called _____. leveraged creativity state-of-the-art breakthrough applicatio
    5·1 answer
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • Question 1
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!