Question: THIS IS ALL IN C++ A. The LastDigit() Function Follow along in class to complete the lastDigit) function that returns the last digit of an

THIS IS ALL IN C++

THIS IS ALL IN C++ A. The LastDigit() Function Follow along in

A. The LastDigit() Function Follow along in class to complete the lastDigit) function that returns the last digit of an integer. For example, lastDigit(3572) should return 2. It should work for negative numbers as well. For example, lastDigit(-947) should return 7. You may use the abs() function in but no other library functions. You may not use string. Copy and paste a screenshot of your source code here. Copy and paste a screenshot of your the test results here. B - The distance() Function Write a function called distance() that takes four int arguments: x1, y1, x2, and y2 and computes the distance between points (x1, yl) and (x2, y2) on the Cartesian plane. The equation for the distance is: Calling distance(1, e, 4, 4) returns 5.0and calling distance(18, 2, 3, 5) returns 7.615773195863909. You may use the standard library function sqrt() in the header. You may not use any other functions, but you may write a sqr() helper function if you wish

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