Question: Question Completion Status: 40 points Save Answer Complete the code of the following two classes (Double and DoubleArray) so th intended output is produced when

 Question Completion Status: 40 points Save Answer Complete the code of

Question Completion Status: 40 points Save Answer Complete the code of the following two classes (Double and DoubleArray) so th intended output is produced when the program is executed. The Class Double encapsulates a validated positive double value with acceptable value between 0 and the max_value constant global variable. Any attempt to set the value of th class to an invalid amount should result in setting the value to -1. Add an attribute to the Double class to be able to hold a double value. [1 mark] All of the modifiers and the constructor of the class will set the value of the Double class -1 if the provided value is not between 0 and max_value. [1 mark] When constructed the Double class will set the value of the object using a one-argume constructor. If the argument is not provided, the value should be set to zero. [3 marks] An object of type Double should be able to be assigned to a double value using th assignment operator. [ 3 marks] Casting an object of type Double should result in returning the double value of the Doub object. [3 marks] An Double object should be printable using the cout object and insertion operator, and th result should be printing the double value inside the object. [5 marks] (Insertion operator overload for cout and Double) An Double object should be readable from the console by receiving a validated double [10 marks] This read should be foolproof: . If the double is not readable (alphabetic instead of digits), the message: "Bad Dou re-enter: " should be printed and the entry should be tried again. . If the double is valid but the value is invalid, the message: "Invalid Value, re-ente should be printed and the entry should be tried again. DoubleArray class is a safe array of Doubles

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 Programming Questions!