Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

1) [8 points] You've been hired by Map Masters to write a C++ console application that calculates and displays the distance between two points on

1) [8 points] You've been hired by Map Masters to write a C++ console application that calculates and displays the distance between two points on a map. Prompt the user for four integer coordinates:

x1

y1

x2

y2

Calculate the distance in kilometers from (x1, y1) to (x2, y2). See www.mathsisfun.com/algebra/distance-2-points.html for background information. Use function sqrt() to calculate the square root of . Use formatted output manipulators (setw, left/right) to print the following five rows:

x1

y1

x2

y2

Distance

And three columns:

A left-justified label.

A right-justified value.

A left-justified units (output manipulators not needed here, just place one space before the units name to separate it from the second column).

Define constants for the column widths. Format all real numbers to one decimal place.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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