Devam Ediyor

Basic C++ Project 2

All the details are provided here:

[url removed, login to view]


There was an error in the description of the find function for assignment 4 (part 6). The original specification stated that the function should have a single string parameter. It should also have a parameter of the vector <City> to be searched.

The paragraph discussing this should (and now does) read:

To find the city you should write a function that searches a vector of cities for a city. T he function should have two parameters, a string representing the name of the city and the vector of cities to be searched . The function should return the index of the city, or -1 if the search is unsuccessful.


A rather strange situation that may cause an error can occur when calculating the distance between two cities (actually the distance between a city and itself). This error occurs when the acos() function receives an input greater than 1 (which it should not do). Without going into the details of exactly what is going on (it's to do with double arithmetic) the acos() function may get inappropriate input when you calculate the distance between a city and itself . So for example, calculating the distance between Vancouver and Vancouver! In these cases the distance should (obviously) be 0.

The easiest way of avoiding this error is to recognize that you are calculating the distance between a city and itself and just setting this distance to be 0, without using the spherical law of cosines formula. The simplest place to handle this is in the distance method of the City class. You can check to see if the latitude and the longitude of the calling object are the same as the parameter's latitude and longitude and then return 0.

Beceriler: C Programlama, C++ Programlama

Daha fazlasını görün: vector string, vector cplusplus, vector c, string vector, string cplusplus, read vector, project details example, programming vector, programming error, original programming, method programming, index bit, function calling, find project programming, double programming, vector example, c vector, string programming, search string, read example, programming string, programming get, programming function

İşveren Hakkında:
( 8 değerlendirme ) BURNABY, Canada

Proje NO: #761559



Please check PMB, thanks.

1 gün içinde 30$ USD
(35 Değerlendirme)

8 freelancer bu iş için ortalamada 70$ teklif veriyor


hi, plz check pmb.

in 2 gün içinde40$ USD
(25 Değerlendirme)

Hi, please read inbox message.

1 gün içinde 30$ USD
(13 Değerlendirme)

Hello! Please check PM for details. Thanks

1 gün içinde 50$ USD
(21 Değerlendirme)

Hi, am the one who did the last assignment for you. Am ready to do this like the other one.

1 gün içinde 40$ USD
(16 Değerlendirme)

hii see pmb please.

1 gün içinde 80$ USD
(5 Değerlendirme)

Hello, please read the PM

1 gün içinde 40$ USD
(1 Değerlendirme)

pleasure to work with u:)

in 7 gün içinde250$ USD
(0 Değerlendirme)