Question: DESCRIPTION The file spHWselectionData.txt contains data describing five rectangles, one rectangle per line. Each line consists of four floating-point numbers separated by a space with

DESCRIPTION

The file spHWselectionData.txt contains data describing five rectangles, one rectangle per line. Each line consists of four floating-point numbers separated by a space with the first two defining the lower-left corner of the rectangle, label A in drawing, and the last two defining the upper-right corner of the rectangle, label C in drawing. These points are always stored with the x-coordinate followed by the y-coordinate. All rectangles will be in the orientation shown below. For this assignment, there will be no coordinate with a value of 0.0.

DESCRIPTION The file spHWselectionData.txt contains data describing five rectangles, one rectangle per

Write a program that will read the data for a single rectangle and determine the following. Any floating-point value should be displayed with four decimal places.

  • If the rectangle is a square.
  • The (x, y) coordinates of corners B and D.
  • The perimeter of the rectangle.
  • The quadrant or quadrants in which the rectangle resides. If the rectangle spans more than one quadrant, each quadrant in which any part of the rectangle resides should be listed. line. Each line consists of four floating-point numbers separated by a space

The program should read and make these determinations for all five rectangles in the file. Please be aware that the data file used when grading will contain different values but the format will be the same.

***Important message: I can cannot use loops yet because we have not made it to that section just yet.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!