
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
I have to create a
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.
![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](https://content.bartleby.com/qna-images/question/75caf353-1d6b-4c64-a099-344a34c0daad/d0b62715-13bc-428d-98b0-4f6f94d8c62b/gq4saf9_thumbnail.png)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 4 images

Knowledge Booster
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
- using python in jupyter notebook; we were given a csv file called stolen_animals.csv which contained data on stolen animals in london . The original raw data was given like this; Count of Stolen Animals,Type of Animal,Borough,Type Of Offence,Animal Recovered,Year and Month1,Dog,Lambeth,Theft and Handling,Not Recovered,Jan-20101,Dog,Islington,Violence Against the Person,Not Recovered,Jan-2010 but have written a function which made each column into list, count of stolen animals into a list of integers and the rest into list of integers. I now need to create functions to find the average number of stolen animals and another to get a list of unique types of animals that have been stolen. To add we are not allowed to use packages and can only input/output to be done by open and close. Below is the specifications given for each functionarrow_forwardwrite in c++Write a program that would allow the user to interact with a part of the IMDB movie database. Each movie has a unique ID, name, release date, and user rating. You're given a file containing this information (see movies.txt in "Additional files" section). The first 4 rows of this file correspond to the first movie, then after an empty line 4 rows contain information about the second movie and so forth. Format of these fields: ID is an integer Name is a string that can contain spaces Release date is a string in yyyy/mm/dd format Rating is a fractional number The number of movies is not provided and does not need to be computed. But the file can't contain more than 100 movies. Then, it should offer the user a menu with the following options: Display movies sorted by id Display movies sorted by release date, then rating Lookup a release date given a name Lookup a movie by id Quit the Program The program should perform the selected operation and then re-display the menu. For…arrow_forwardIn this project you are to design a process queue that is responsible for handling the process requests coming from different users. You have to take into consideration that users have different levels of privileges and priorities. Each user has an identification number and a password, in addition to process priorities. One good idea is to design the queue using an array or pointers while preserving the first-in first-out concept of the queue. For every process request received, the program should check the privileges of that request and whether it can be moved forward in the queue to be served by the operating system prior to serving the other requests. Using the programming language of your choice (preferably C+), write the process queue that would handle the user request. The program must allow for requests coming from different users or from one user.arrow_forward
- in ibmi . READ the Scenario listed below. Once you read the Scenario, answer the questions listed. You are not required to do any programming. As a developer you have been asked to work with a team that is developing a Student Information System. For your part of the project you have been asked to do the tasks listed below (do not actually do anything) . Create a file EXSTUD that will be given to a user to enter data. This file will be accessed by another developer’s program. How would you create your file? What IBM i Utility would you use to enter data into the file? What type of object/attribute would the data file be created as? What needs to be done with the program code to make it executable? List the full command to execute the program you are to create? What type of object would the Program be created as? Where exactly would you put your program code?arrow_forwardWrite a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each row of…arrow_forwardUsing JAVA OOP, needs to work on the eclipse IDE The international Olympics Committee has asked you to write a program to process their data and determine the medal winners for the pairs figure skating. You will be given a file named Pairs.txt.This file contains the data for each pair of skaters. The data consists of each skater’s name, their country and the score from each of eight judges on the technical aspects and on the performance aspects. A typical record in the file would be as follows: SmithJonesAustralia5.0 4.9 5.1 5.2 5.0 5.1 5.2 4.84.3 4.7 4.8 4.9 4.6 4.8 4.9 4.5 LennonMurrayEngland2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.83.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8GustoPetitotItalia4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.85.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8LahaiePetitFrance1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.85.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8BilodeauBernardCanada2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.84.1 4.2 4.3 4.8 4.9 4.6 4.0 4.5LahorePedroMexico3.2 3.1 3.8 3.9 3.0 3.6 3.9 3.35.9 5.8 5.8 5.8 5.9 5.6 5.0…arrow_forward
- When an author produces an index for his or her book, the first step in this process is to decide which words should go into the index; the second is to produce a list of the pages where each word occurs. Instead of trying to choose words out of our heads, we decided to let the computer produce a list of all the unique words used in the manuscript and their frequency of occurrence. We could then go over the list and choose which words to put into the index. The main object in this problem is a "word" with associated frequency. The tentative definition of "word" here is a string of alphanumeric characters between markers where markers are white space and all punctuation marks; anything non-alphanumeric stops the reading. If we skip all un-allowed characters before getting the string, we should have exactly what we want. Ignoring words of fewer than three letters will remove from consideration such as "a", "is", "to", "do", and "by" that do not belong in an index. In this project, you…arrow_forwardDescriptionWrite a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: each line contains a student's first name, then one space, then the student's last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file. The date in the output file will be nearly the same as the data in the input file except that you will print the names as last-name, first-name; each quiz score, and there will be one additional number at the end of each line:the average of the student's ten quiz scores.Both files are parameters. You can access the name of the input file with argv[1]. and the name of the output file with argv[2].The output file must be formatted as described below: 1. First and last names…arrow_forwardYou are creating a database for storing information for a Netflix like service. The database stores movies with id, title, filename and TV shows with id, title. TV Shows have episodes. Each episode has a corresponding TV show, a season id, an episode id, title, filename. Some episodes have a next episode (i.e. the episode that will automatically start showing once the user finishes watching the current episode!). The database also stores users, each user has an id, username, password. Users may watch zero or more movies, zero or more TV show episodes. For each movie or episode, the database stores a watch time value for each user, indicating how many minutes the user watched that movie or show. Finally, the database stores which movie appears similar to which other movie for a given user (to be able to make recommendations). Construct an E-R diagram (based on a Chen's model) to represent the above requirements. Make sure you include all appropriate entities, relationships, attributes,…arrow_forward
- The data in the left column is the data in a file. Write a Python program to read that data and print the data to the console in the format as shown in the second column. Use the first 2 records to test your code.arrow_forwardWrite a Python program for a movie database management system. The program should allow users to add movies, remove movies, and display the current collection. Each movie has a title, director, release year, and rating. The program should have the following features: 1. A menu-based system that allows users to choose between adding a movie, removing a movie, and displaying the collection. 2. When adding a movie, the user should input the title, director, release year, and rating. 3. When removing a movie, the user should input the title of the movie to be removed. 4. Display the current movie collection with details of each movie, including title, director, release year, and rating. Make sure to include comments that explain the purpose of the program, input and output details, and any complex logic. Use self-documenting variable names, white spaces, and indentation for readability. Test your program with sample data to ensure correct functionality and provide screenshots of two…arrow_forwardI have to create a database using python to show geographical points. 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.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education