Write a program to find distance between the two points

Assignment Help C/C++ Programming
Reference no: EM131422108

Assignment- Arrays and Parallel Arrays

Introduction

In this assignment you will write a small C program. Your program should compile correctly and produce the specified output.

Please note that the computer program should comply with the commenting and formatting rules as has been done in class. For example, there should be a header for the whole program that gives the author's name, class name, date, and description. End braces should be commented, and there are alignment and indenting requirements as discussed. Please ask if you have any questions.

Program #1

Given the following list of point coordinates and label:

Point Label

X-Coordinate

Y-Coordinate

A

50.2

75.8

B

45.7

48

C

76.7

99.1

D

12

14

F

-25

48

G

23

-36

Table 1: Point Information

The information is given as three arrays:

i) A char array named point_label, for column 1 in Table 1
ii) A double array named x_coord, for column 2 in Table 1
iii) A double array named y_coord, for column 3 in Table 1

The table information can be hard coded.

Given two points, entered using the labels (i.e. A and B), the program will compute:

a) The distance between the two points
b) The equation of the line crossing these points in the form: y = mx+k
c) The closest perpendicular point to the line described by the two points given.

The distance from a point P0(x0,y0) to a line in the form ax+by+c=0 , is defined as:

distance (ax+by+c=0, P0) = |ax0+by0+c| / √(a2+b2)

Where a and b are not both zero.

Introduction to Programming Assignment: Arrays and Parallel Arrays

The program should display a menu (10 points) with the following options:

a) Enter points (5 points)
b) Compute the distance (20 points)
c) Display the line equation (25 points)
d) Find the closest point to the line in c)(35 points)
e) Exit

The program will finalize ONLY when option e) is chosen. (5 points)

Deliverables

You will turn in two files, a C source code file, and text file with an example of the program output and any special instruction to run your program.

The C source code file should:

1) Comply with all of the formatting requirements already discussed.
2) Query the user(input)
3) Display the output
4) Perform the operations described.

Reference no: EM131422108

Questions Cloud

Describe the fertilization process : You are asked to describe the fertilization process. Explain how the sperm travels from the testes and arrives at the fallopian tube in time to meet the ova.
Describe sampling distribution model of mean fuel economy : Write appropriate hypotheses.- Are the necessary assumptions to make inferences satisfied?- Describe the sampling distribution model of mean fuel economy for samples like this.
Identify and briefly explain the underlying technologies : For two of the applications presented in Part 1, you are to identify and briefly explain the underlying technologies, recognise any difficulties in the delivery of the service and briefly describe how those difficulties are overcome
How is biotechnology used in every day life : What are some examples of biotechnology and how is biotechnology used in every day life?
Write a program to find distance between the two points : CS1325- Write a program to find distance between the two points. The equation of the line crossing these points in the form: y = mx+k. The closest perpendicular point to the line described by the two points given.
Find mean and standard deviation of observed weights : Do these data satisfy the assumptions for inference? Explain.- Find the mean and standard deviation of the observed weights.- Create a 95% confidence interval for the mean weight of such bags of chips.
How clinical applications can support quality management : Discuss how clinical applications can support quality management and cost control programs in health care. Give an example of at least 2 clinical applications.
Acceptable macronutrient distribution range : Why is the Acceptable Macronutrient Distribution Range important to consider when assessing your dietary intake?
Find the mean and standard deviation of the observed weights : Do these data satisfy the assumptions for inference? Explain.- Find the mean and standard deviation of the observed weights.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd