In this homework, you will write a program that suggests a route to get from a starting point to a target point on a met

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In this homework, you will write a program that suggests a route to get from a starting point to a target point on a met

Post by answerhappygod »

In This Homework You Will Write A Program That Suggests A Route To Get From A Starting Point To A Target Point On A Met 1
In This Homework You Will Write A Program That Suggests A Route To Get From A Starting Point To A Target Point On A Met 1 (80.42 KiB) Viewed 13 times
I need part B answers not A.
In this homework, you will write a program that suggests a route to get from a starting point to a target point on a metro line. The details of the program are given below. A) Please write the following definitions: 1) Define a constant SIZE with the value 10. 2) Write a MetroStation struct that has to contain a char array of size 20, named as name (example: Haydarpasa); a double x and a double y that represent the location of a metro station. typedef it to MetroStation. 3) Write a MetroLine struct that has to contain a char array of size 20, named as color (example: red) and a MetroStation [] array of size SIZE, named as MetroStations that contains all metro stations in this metro line ordering from start to end. typedef it to MetroLine. 4) Write a MetroSystem struct that has to contain a char array of size 20, named as name (example: Istanbul) and a MetroLine [] array of size SIZE, named MetroLines that contains all metro lines in this metro system. typedef it to MetroSystem. B) Please implement the following functions: 1) Write a function equals (MetroStation s1, MetroStation s2) which returns a non-zero value if the name property of the MetroStation s1 is equal to the name property of MetroStation s2; zero otherwise. 2) Write a function addStation which takes two inputs, a MetroLine* and a MetroStation; and adds the given metro station to the end of the MetroStations [] array pointed by the MetroLine* pointer. It should return void. 3) Write a function hasStation which takes two inputs, a MetroLine and a MetroStation and returns a non-zero value if the given metro line has a metro station with the same name as the given metro station; zero otherwise. 4) Write a function getFirstStop which takes input as a MetroLine and returns the MetroStation representing the first stop of the given metro line. If there is no such station, your function should return an empty MetroStation. 5) Write a function getPreviousStop which takes two inputs, a MetroLine and a MetroStation and returns the previous Metro Station to the MetroStation
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply