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

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 1E
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT