Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is an electrical engineering computer science programming question, can som

ID: 3605924 • Letter: T

Question

This is an electrical engineering computer science programming question, can someone answer it at all?

USE VISUAL STUDIO C++ 2015

THIS IS SUPPOSED TO BE ANSWERED AS A PROGRAM, NOT ANYTHING ELSE

USE #include NOT ANYTHING ELSE

I've seen that this question has been answered incorrectly 3 times already since its been posted before, so ANSWER IT AS IT IS ASKED PLEASE

THE SAMPLE EXECUTION IS INCLUDED AND THAT IS EXACTLY HOW THE ANSWERS SHOULD BE DISPLAYED BY THE PROGRAM

THANK YOU IN ADVANCE!

Problem 2 (35 points): The file placelist.txt contains the place information (name, country. latitude and longitude). Write a C program that a) Reads places from a file called placelist.txt and stores it in an array of type place b) Prints, on screen, places in the database that are NOT in USA. c) Sorts the array of places in distance from Tucson city center and print the sorted array on screen. To do so, you will modify the void selection(int x[], int size) function that sorts ints given on the next page. If you hard-code the list of cities sorted by distance in your code, 0 point for this problem 1) Your program MUST use the following structure: typedef struct place_s char name [100]; char country[30] double latitude; double longitude; place; Note: the above structure can be modified (i.e., to include distance) so that it can be used with sorting.

Explanation / Answer

#include #include #include int main() { int startA, endA, startB, endB; float distance; clrscr(); printf(" Enter the startA and StartB coordinates of the first point : "); scanf ("%d %d", &startA, &startB) ; printf(" Enter the endA and endB coordinates of the second point :") ; scanf("%d %d", &endA, &endB); functions defined in math.h header file*/ distance= sqrt(pow((endA-startA), 2)+pow((endB-startB), 2)); printf(" Distance= %f", distance); getch(); return 0; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote