Computer Science Write a program 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...


Attach code and screenshot




Computer Science<br>Write a program that uses two classes. The first<br>class is called “dAta

Extracted text: Computer Science Write a program 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, lOad(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 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here