EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C++代做
您的位置: 主页 > 编程案例 > C++代做 >
代做C++/C:加拿大CS代写 course.c补全代码 - C++代做
发布时间:2021-07-25 22:46:11浏览次数:
For Question 1, please download the file, and work with the existing code as instructed in the question. To submit the exam, please create a Zip file with the respective answers, labelled by Question number, and send through in a private conversation between yourself and the instructor 加拿大CS代写Question 1The file named DistanceDifference.cpp contains an incomplete program that should be able to calculate the distance between a series of geocoded locations. Two parts of the program need to be completed: 1. The portion of the main() function that calculates the distances between each of the hard-coded 5 locations, and stores it in a two-dimensional array declared as distances. 2. A portion of the calculateDistanceBetweenLocations(l1, l2) function; omitted code spaces are designed with a // TODO: comment. The code is properly commented in order for you to understand exactly what is being done, however you should not touch parts of the program that are not earmarked with a // TODO: comment. Question 2Design and implement a Class called Course –separated into its respective header (Course.h) and implementation file (Course.cpp).  The class contains a dependency on a Section structure, which should have the following interface: struct Section {string section_code;// Section Code string days[2];// Array of days section meets per weekstring times[2];// Array of times section meets each day int student_count;// Number of students in the section}  The class should have the following private variables:string course_namelong int course_idstring departmentstring instructor_nameSection *sectionsint section_count The class should have a default constructor that initializes the following variables to the specified values:course_name = “”course_id= -1department = “”instructor_name = “Baruch Faculty”sections = nullptrsection_count = 0 The class should have the following public functions(The explanation of the function follows in italics):· void setCourseInformation(string courseName, long int courseId, string department, string instructorName);This function sets the class’ private variables to the values passed to the function · void display CourseInformation() const;This function outputs the course information, in the following format: department course_id : course_name by instructor_name  · void addClassSection(string sectionCode, string days[], string times[], int studentCount);This function adds a new section to an array referenced by the sections pointer variable, and updates the section_count variable.HINT: When adding a new section, remember that existing sections must be preserved. · bool removeClassSection(string sectionCode);This function removes an existing section from the sections array. It should ensure that the section exists, and if it does it should return TRUE after being removed. If it does not exist, the function should return FALSE · int getSectionCount() const;This function returns the number of sections attached to the course code: #include  iostream #include  iomanip #include  math.h using namespace std;// Location Structurestruct Location {    // Name of Location    string name;    // Latitude of Location    double latitude;    // Longitude of Location    double longitude;// Location Structure using Radiansstruct LocationWRadians {    // Name of Location    string name;    // Latitude Radians    long double latitude;    // Longitude Radians    long double longitude;    LocationWRadians() {        name = "";        latitude = 0;        longitude = 0;    }    LocationWRadians(string n, long double lat, long double longi) {        name = n;        latitude = lat;        longitude = longi;    } * Calculates the distance between two geographic locations and returns this value * @param Location l1   The first location * @param Location l2   The second location * @return doublelong double calculateDistanceBetweenLocations(Location l1, Location l2); * Displays Summary Table Header * @param locations * @param sizevoid displaySummaryTableHeader(const Location locations[], int size); * Display Summary of Distances * @param locations * @param distancesvoid displaySummaryTable(const Location locations[], const long double distances[5][5]); * Converts earthly degrees to radians * @param degree * @return long doublelong double toRadians(long double degree);int main() {    // An array of five locations    const Location locations[5] = {            {"Moscow", 55.75, 37.62}, {"Calcutta", 22.6763858, 88.0495367},            {"Sao Paulo", -23.6815315,-46.8754883}, {"Buenos Aires", -34.6156625,-58.5033383},            {"New York", 40.6976701,-74.2598661}    };    // An two-dimensional array to hold the distance between each location    long double distances[5][5];    // Calculate distances between all locations and store them in the distances array declared above such that:    // each row of the array represents one of the locations AND    // each column of the array represents the set of distances between the row location and each other location    // HINT: You need two loops, one nested inside of the other. The calculateDistanceBetweenLocations function can be used    //       to find the distance between two locations    // TODO: WRITE YOUR CODE BELOW    // END YOUR CODE    // Output Distances In A Table    displaySummaryTableHeader(locations, 5);    displaySummaryTable(locations, distances);    cout   endl   "Program ending...";    return 0;/*********************************** ***** Function Implementations **** ***********************************/void displaySummaryTableHeader(const Location locations[], int size) {    cout   setw(15)   "";    for (int i = 0; i   size; i++) {        cout   setw(20)   locations[i].name;    }    cout   endl;void displaySummaryTable(const Location locations[], const long double distances[5][5]) {    for(int i = 0; i   i++) {        cout   setw(15)   locations[i].name;        for (int j = 0; j   j++) {            cout   setw(20)   ((distances[i][j] == 0.00) ? "" : to_string(static_cast int (distances[i][j])));        }        cout   endl;    }long double toRadians(const long double degree) {    long double single_degree = M_PI/180;    return single_degree * degree;// TODO: Complete Functionlong double calculateDistanceBetweenLocations(const Location l1, const Location l2) {    // Convert the latitude and longitudes from degree to radians and store the radians version of the two locations    // in the two new LocationWRadians objects, radians1   radians2.    // TODO: Modify code below. You may use the toRadians(degree) function to calculate the radians value, passing the function either a longitude or latitude value    LocationWRadians radians1;    LocationWRadians radians2;    // Calculate Distance Using Haversine Formula    // 1. Calculate difference between radians longitude of second location and first location    long double longitude_difference = // TODO: Write Formula Here    // 2. Calculate difference between radians latitude of second location and first location    long double latitude_difference = // TODO: Write Formula Here    // LEAVE CODE BELOW UNTOUCHED    // Calculate a    long double a = pow(sin(latitude_difference/2), 2) + cos(radians1.latitude)            * cos(radians2.latitude) * pow(sin(longitude_difference/2), 2);    // Calculate b    long double b = 2 * asin(sqrt(a));    // Radius of Earth in    // Kilometers, R = 6371    // Use R = 3956 for miles    const long double R = 6371;    // Multiple b * R and return result    return b * R;}更多加拿大CS代写 参考

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。