美文网首页
讲解:DistanceDifference、C/C++、C/C+

讲解:DistanceDifference、C/C++、C/C+

作者: duanquju | 来源:发表于2020-03-02 14:38 被阅读0次

    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 instructorQuestion 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:str代写DistanceDifference作业、代做C/C++编程作业、C/C++实验作业代做、代写Baruch Facuing course_namelong int course_idstring departmentstring instructor_nameSection *sectionsint section_countThe 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 = 0The 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: : by ?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 FALSEint getSectionCount() const;This function returns the number of sections attached to the course转自:http://ass.3daixie.com/2018122030851932.html

    相关文章

      网友评论

          本文标题:讲解:DistanceDifference、C/C++、C/C+

          本文链接:https://www.haomeiwen.com/subject/qnzmkhtx.html