Write a program in c++ Language that uses two classes. The first class is called "dAta" and holds x and y coordinates of a point in 2-d space called p1. The second class is called "cOmpute" and holds...

Answer this question please.Write a program in c++ Language that uses<br>two classes. The first class is called

Extracted text: Write a program in c++ Language that uses two classes. The first class is called "dAta" and holds x and y coordinates of a point in 2-d space called p1. The second class is called "cOmpute" and holds an array of two pointers to the “dAta" class. The "cOmpute" class has a function, IOad(float x, float y, int n), which loads x and y coordinate data into the array at index n. It also has a function, sLope(), which computes the slope of the line connecting the two array data coordiantes. It also has a function, pRint(), which prints the slope result to the screen. Implement a divide by zero exception using throw in the sLope() nd/or pRint() function as appropriate. The exception should, when caught, print "Slope calculation error..." to the screen and exit the function. The program should load the array with some example points and print the slope to the screen using the class functions.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here