Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Write a C program that prompts the user for coordinates of two 3-D points (X1, 91,21) and (x2.Y2,2) and displays the distance between them

image text in transcribed
4. Write a C program that prompts the user for coordinates of two 3-D points (X1, 91,21) and (x2.Y2,2) and displays the distance between them using the following formula. (20 points) Distance = (x1 - x2)2 + (y1 - y2)2 + (21 - 2)2) Note that the coordinate values should be declared as int. The distance calculation should be rounded to 2 decimal places. The mass of a single molecule of water is about 3 x 10-23 grams. A quart of water is about 950 grams. Write a program that requests the amount of water in quarts, and displays the number of water molecules in that amount. (25 points) a. Request the amount of water in quarts. (6 points) b. Convert that amount of water to grams. (5 points) c. Calculate the number of water molecules in that many grams of water. (5 points) d. Display the results in scientific notation. (6 points) Note: The conversion factors should be defined as constant macros. (3 points)

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

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions