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

  An application that instantiates five librarybook object

Write an application that instantiates five LibraryBook objects

  Implement a graphics system that has classes

Implement a graphics System that has classes for various figures: rectangles, squares, triangles and circles. A rectangle has data members height, width, color , and center point. A square has center point and an edge and color

  Program that will read in such an array

Write a program that will read in such an array, and repeatedly prints it so the user can select the direction in which to move next. The user's requested move can prompt a number of responses

  Create a text adventure game that uses pointers

Create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased.

  Implement a puzzle game

Write a program which will do the tedious recombining part for us in order to present us with words spelled using only elements symbols.

  Write a c++ program to calculate the sum

The list of all natural numbers less than 10 that are multiples of 3 or 5 is 3,5,6,9. The sum of these multiples is 23. Write a C++ program to calculate the sum of all such multiples less than 1,000.

  Program that reads a student''s name together with score

A value-returning function, calculateGrade, to determine and return each student's grade. (This function does not output the grade. That task must be done in the function main.)

  Write a program that takes data a line at a time

Write a program that takes data a line at a time and reverses the words of the line

  Mark the following statements as valid or invalid

Mark the following statements as valid or invalid. If a statement is invalid, explain why.

  Program in c to ask the user to input a set of characters

Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node. This means that each nod..

  Design a class include a constructor and members

Design your own C++ class. Keep it simple but use the readings this week to include a constructor, members and methods. Be sure to test your class by constructing it and using its functionality

  Write the equation for the logic-hazard free function

Write the equation for the minimum Boolean function first. Now, eliminate all logic hazards that can result from the 0's

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