Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4. Compare and contrast the practices of the two companies.

Answered: 1 week ago