I have to create a program that will create a database when using geo points. I will include a previous program and the instructions: You are going to change program 8 so that instead of reading in a list of five or more points from a file you will read the points in from a database. Create a program the will create your database and insert at least five points. Use your own data, something like: 100, 200, 123, Main Campus 120, 133, 142, Montoya 153, 123, 322, Rio Rancho 133, 123, 143, STEMULUS Center 153, 142, 122, ATC   Run your initialization code to create the database. Modify your GUI program from program 8 so that it reads points from your database instead of a file. Turn in the initialization code, the database and your new GUI program

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

I have to create a program that will create a database when using geo points. I will include a previous program and the instructions:

You are going to change program 8 so that instead of reading in a list of five or more points from a file you will read the points in from a database.

  1. Create a program the will create your database and insert at least five points. Use your own data, something like:

100, 200, 123, Main Campus

120, 133, 142, Montoya

153, 123, 322, Rio Rancho

133, 123, 143, STEMULUS Center

153, 142, 122, ATC

 

  1. Run your initialization code to create the database.
  2. Modify your GUI program from program 8 so that it reads points from your database instead of a file.
  3. Turn in the initialization code, the database and your new GUI program.
IDLE File Edit
D2L Program 9 - Geo Poi
X
bartleby
Ask or
Keep
includ
Format Run Options Window Help
Conta
textbo
help.
#ral alliCLI IZCU alu ucιανιι CUIISLIULUI
def
#Getter
_init__(self, lat=0, lon=0, description = 'TBD');
self. _lat= lat
self.__lon = lon
self.__description
# Setter for setting latitude and longitude
def SetPoint (self, coords):
lat coords [0]
self.__
self.__lon = coords [1]
for having point
def Get Point (self):
=
return(self.__lat, self.__lon)
description
#Distance method to calculate distance between points
def Distance (self, toPoint):
return self.__description
##Point property to access and set point values
Point = property (Get Point, SetPoint)
Aski ##Description property to access adn set point description
Description = property (GetDescription, Set Description)
p = pi/180
a = 0.5 cos((toPoint [0]-(self.Point)[0])*p)/2 + cos((self.Point) [0] *p) cos (toPoint [0]*p) * (1-cos((toPoint [1]-(self.Point) [1]) *p))/2
return 12742 * asin(sqrt(a))
#Method that will set the objects self.description attribute
def Set Description(self, description):
self.__description = description
##Method that will return the objects self.description attribute
def GetDescription(self):
##Open file in read mode
O
## Created list to store lat lon and description values
# #Initialzing list
pointList = []
YazzieTP9.py - /Users/tishenayazzie/Documents/YazzieTP9.py (3.7.9)
file = open("input.txt","r")
##Reading points from file input.txt
for line in file:
#Close file
file.close()
temp = line.split(",")
pointList.append(GeoPoint (float(temp [0]), float(temp [1], temp [2].strip()))
point GeoPoint()
while True:
lat, lon= map (float, input ("Enter the location points of latitude and longitude:").split(","))
## Use list of values to calculate distance from points [lat, lon]
minDistance = pointList[0]. Distance ([lat, lon])
for p in pointList:
tempDisp. Distance ([lat, lon])
if minDistance > tempDis:
minDistance = tempDis
NOV 1
22
TXT
tv ♫
A
W
Ln: 58
Ơ
00
Col: 12
Tue Nov 22 4:42 PM
Shell
TXT
DO
01:31:08)
se()" for more informat
Points
Ln
Transcribed Image Text:IDLE File Edit D2L Program 9 - Geo Poi X bartleby Ask or Keep includ Format Run Options Window Help Conta textbo help. #ral alliCLI IZCU alu ucιανιι CUIISLIULUI def #Getter _init__(self, lat=0, lon=0, description = 'TBD'); self. _lat= lat self.__lon = lon self.__description # Setter for setting latitude and longitude def SetPoint (self, coords): lat coords [0] self.__ self.__lon = coords [1] for having point def Get Point (self): = return(self.__lat, self.__lon) description #Distance method to calculate distance between points def Distance (self, toPoint): return self.__description ##Point property to access and set point values Point = property (Get Point, SetPoint) Aski ##Description property to access adn set point description Description = property (GetDescription, Set Description) p = pi/180 a = 0.5 cos((toPoint [0]-(self.Point)[0])*p)/2 + cos((self.Point) [0] *p) cos (toPoint [0]*p) * (1-cos((toPoint [1]-(self.Point) [1]) *p))/2 return 12742 * asin(sqrt(a)) #Method that will set the objects self.description attribute def Set Description(self, description): self.__description = description ##Method that will return the objects self.description attribute def GetDescription(self): ##Open file in read mode O ## Created list to store lat lon and description values # #Initialzing list pointList = [] YazzieTP9.py - /Users/tishenayazzie/Documents/YazzieTP9.py (3.7.9) file = open("input.txt","r") ##Reading points from file input.txt for line in file: #Close file file.close() temp = line.split(",") pointList.append(GeoPoint (float(temp [0]), float(temp [1], temp [2].strip())) point GeoPoint() while True: lat, lon= map (float, input ("Enter the location points of latitude and longitude:").split(",")) ## Use list of values to calculate distance from points [lat, lon] minDistance = pointList[0]. Distance ([lat, lon]) for p in pointList: tempDisp. Distance ([lat, lon]) if minDistance > tempDis: minDistance = tempDis NOV 1 22 TXT tv ♫ A W Ln: 58 Ơ 00 Col: 12 Tue Nov 22 4:42 PM Shell TXT DO 01:31:08) se()" for more informat Points Ln
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education