Skip to content

A map of 10 cities of Punjab made in c language & ASCII, fetching the distance between various cities from a database using file handling techniques

Notifications You must be signed in to change notification settings

usxv/map_of_punjab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: map_of_punjab

We have created a project that focuses on 10 cities in the Punjab region. The project includes several key components:

  1. We used ASCII art to create a visual map of these cities.
  2. We implemented file-handling techniques to access data from a database that consists of 10 different files. Each file contains distance values between cities.

Here's how the program works:

  • The user provides the current city and the destination city.
  • A linear search algorithm is used to find the user's input cities within an array of city names.
  • When both cities are located in the array, the linear search function returns the index values of these cities.

Now, here's where the switch case comes into play:

  • The switch case takes the index of the current city as input, which ranges from 0 to 9. Each case corresponds to a specific database file related to that index element.
  • For example, if the user inputs "Mohali," the index of Mohali is determined by the linear search.
  • The switch case for index 7 is triggered because "Mohali" corresponds to index 7 in the city array.
  • The program then retrieves data from the "city_moh.txt" database file, which contains distances considering Mohali as the starting point.

This approach ensures that the distances are accurately determined, taking into account Google Maps data for precision.

  • Code credits: Sumit, Suraj, Simran.

CHANGELOGS:

  • Updated panjab map file so if you want to use this project download "panjabmapv2.c" and "panjabmapv2.exe" along with the "database" folder for the program to work properly!!!
  • If downloaded as a zip delete the old files named "a.exe" & "map_punjab.c"

About

A map of 10 cities of Punjab made in c language & ASCII, fetching the distance between various cities from a database using file handling techniques

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages