Please help zybooks lab. C++ any warnings will result in termination of program For this activity we attempt to make our own container class (like vector) to hold instances of our "point" class. To do...




Please help zybooks lab. C++ any warnings will result in termination of program



For this activity we attempt to make our own container class (like vector) to hold instances of our "point" class. To do this you will need create 2 classes as described below:


CMyPoint - This class will contain a point in an arbitrary 2 dimensional space. You will create instances of this class and store them in the container CMyPointArray. To achieve this you will need to implement the following: int _X - which is an integer that contains the location of the point in the horizontal direction int _Y - which is an integer that contains the location of the point in the vertical direction const int GetX() - which is the "getter function for the "x" coordinate. const int GetY() - which is the "getter function for the "y" coordinate.


friend ostream& operator <><">private and all functions declaredpublic.


CMyPointArray - This class will dynamically (e.g. new and delete) allocate and de-allocate memory so that it is capable of containing an arbitrary number of instances of the CMyPoint object. To achieve this you will need to implement the following: CMyPoint* pPoints - This variable is a pointer to the memory that contains the CMyPoint objects. CMyPoint Get(const int iIndex) - This is the "getter" function used to retrieve a particular point that is contained in an instance of the CMyPointArray class. The parameter const int iIndex is used to locate the particular point. void Set(const int iIndex, const CMyPoint pt) - This is the "setter" function used to store a particular point in an instance of the CMyPointArray class, at the location indicated by iIndex. The class constructor should take as a parameter the size of the container (e.g. how may CMyPoint objects it will hold) and allocate the appropriate space to hold theses objects. The class destructor should free any memory the CMyPointArray class owns. All variables are to be declaredprivate and all functions declaredpublic.


Note: Do not use the STL vector object in any part of your program or you will receive 0 points. Instead go caveman style and use the C++ new and delete functions as described in this chapter.





Q133;

A convex-convex lens has radii of curvature with magnitudes of and . The lens is made of glass with index of refraction. We will employ the convention that refers to the radius of curvature of the surface through which light will enter the lens, and refers to the radius of curvature of the surface from which light will exit the lens.


Is this lens converging or diverging?


























converging



diverging




Correct







Part B


What is the focal length of this lens in air (index of refraction for air is)?


Express your answer in centimeters totwo significant figures or as a fraction.



 =12 cm


Correct






Part C


What is the focal length of the lens if it is immersed in water ()?


Express your answer in centimeters, to two significant figures or as a fraction.


how do I alter the formula1/f=(n-1)(1/R1-1/R2) for water if in air it's refract. Index -1 (n-1)?


1.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here