Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: (Enhancing Class Rectangle) Modify class Rectangle from Exercise II to include a draw function that displays the rectangle inside a 25-by-25 box enclosing the portion of the first quadrant in which the rectangle resides. Include a set Fill Character function to specify the character out of which the body of the rectangle will be drawn. Include a set Perimeter Character function to specify the character that will be used to draw the border of the rectangle. If you feel ambitious, you might include functions to scale the size of the rectangle, rotate it, and move it around within the designated portion of the first quadrant.

Exercise II: (Enhancing Class Rectangle) Create a more sophisticated Rectangle class than the one you created in Exercise I. This class stores only the Cartesian coordinates of the four corners of the rectangle. The constructor calls a set function that accepts four sets of coordinates and verifies that each of these is in the first quadrant with no single x- or y-coordinate larger than 20.0. The set function also verifies that the supplied coordinates do, in fact, specify a rectangle. Provide member functions that calculate the length, width, perimeter and area. The length is the larger of the two dimensions. Include a predicate function square that determines whether the rectangle is a square.

Exercise I: (Rectangle Class) Create a class Rectangle with attributes length and width, each of which defaults to 1. Provide member functions that calculate the perimeter and the area of the rectangle. Also, provide set and get functions for the length and width attributes. The set functions should verify that length and width are each floating-point numbers larger than 0.0 and less than 20.0.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92418834
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

You are evaluating two different silicon wafer milling

You are evaluating two different silicon wafer milling machines. The Techron I costs $255,000, has a three-year life, and has pretax operating costs of $68,000 per year. The Techron II costs $445,000, has a five-year lif ...

When using todays digital cameras file sizes are often

When using today's digital cameras file sizes are often saved in a format that is well over 1 Megabyte. This may be great for high definition photo reproductions but is a disaster for uploading to the web. Images on your ...

Question research the recording industry association of

Question : Research the Recording Industry Association of America (RIAA) and the Motion Picture Association of America (MPA), their influence on Federal regulations, and their evolving role in digital media distribution. ...

What service is defined as it services for example in a gym

What service is defined as IT services? For example, in a gym, is members called IT services? What else? could you give me another example?

Describe some of the advantages and disadvantages of using

Describe some of the advantages and disadvantages of using the N-version programming approach.

Sql statement neededcreate a table compatable with oracle

SQL STATEMENT NEEDED: Create a table (compatable with Oracle) to store the names of your friends' pets: -Any name -Mostly any structure -You must include a column that uniquely identifies each pet's owner -Add five+ pets ...

Suppose that two teams are playing a series of games each

Suppose that two teams are playing a series of games, each of which is independently won by team with probability p and by team B with probability 1-p. The winner of the series is the first team to win i games. (a) If i= ...

Requirementsdesign and implement an application with a

Requirements Design and implement an application with a graphical user interface to manage a library of songs. A song is uniquely identified by name and artist (case insensitive). Your application should have a SINGLE WI ...

The big bad wolf loves eating little pigs for breakfast

The big bad wolf loves eating little pigs for breakfast, lunch, dinner, supper, midnight snacks and he does know all about second breakfast. He tends to consume a lot of little pigs in a week. (He is probably not Jewish) ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As