Solved by verified expert:Create a C++ class Rectangle. The class has attributes length and width, with defaults to
1.0. It has member functions for calculating the perimeter and the area of a rectangle. It has
setLength, setWidth, getLength, and getWidth functions for updating and accessing
the length and width values. The set functions should verify that length/width are each
floating-point numbers greater than 0.0 and less than 20.0. If an invalid value is encountered, the
corresponding set function should return –1 to the calling function without changing the
length/width values. Implement a main function that takes a data file name from command line
argument. The main function reads the length and width values from this input file and use the
Rectangle class to calculate the perimeter and area for each data set. (Note: the Rectangle
class should not include any I/O codes. All I/Os should be done external to the Rectangle
class). Source Files: ● Rectangle.h – contains the Rectangle class declaration. ● Rectangle.cpp – contains the Rectangle class implementation. ● hw04.cpp – contains the main function and any other functions for file I/Os. Example Output: % cat hw04.dat
3.456 2.89 0.0 2.90 12.898 20.0 -1.234 13.234 1.0 21.345 % hw04 Usage: hw04
% hw04 hw04.dat foobar.dat Usage: hw04
INPUT: Length = 3.456 Width = 2.890 PERIMETER: 12.692 AREA: 9.988 INPUT: Length = 0.000 Width = 2.900 ERROR: Invalid length: 0.000 INPUT: Length = 12.898 Width = 20.000 ERROR: Invalid width: 20.000 INPUT: Length = -1.234 Width = 13.234 ERROR: Invalid length: -1.234 INPUT: Length = 1.000 Width = 21.345 ERROR: Invalid width: 21.345Submission:Turn in the printout of the program and input data file with at least 3 sets of length/width values.Capture the source code and output into a single file
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more