Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Program - Python

This is my program for a horse race class (Problem below code)

class Race:
    def __init__(self,name,time):
        self.name = name
        self.time = time
        self.entries = []


class Entrant:
    def __init__(self,horsename,jockeyname):
        self.horsename = horsename
        self.jockeyname = jockeyname


race1 = Race('RACE 1','10:00 AM May 12, 2021')
race2 = Race('RACE 2','11:00 AM May 12, 2021')
race3 = Race('RACE 3','12:00 PM May 12, 2021')


race1.entries.append(Entrant('Misty Spirit','John Valazquez'))
race1.entries.append(Entrant('Frankly I’m Kidding','Mike E Smith'))


race2.entries.append(Entrant('Rage against the Machine','Russell Baze'))


race3.entries.append(Entrant('Secretariat','Bill Shoemaker'))
race3.entries.append(Entrant('Man o War','David A Gall'))
race3.entries.append(Entrant('Seabiscuit','Angel Cordero Jr'))


print(race1.name, race1.time)
for entry in race1.entries:
    print('Horse:',entry.horsename)
    print('Jockey:',entry.jockeyname)
    print()

print(race2.name, race2.time)
for entry in race2.entries:
    print('Horse:',entry.horsename)
    print('Jockey:',entry.jockeyname)
    print()

print(race3.name, race3.time)
for entry in race3.entries:
    print('Horse:',entry.horsename)
    print('Jockey:',entry.jockeyname)
    print()

 

Problem: Need help to modify program so that

Make a race class, which has attributes 

  Race name - a string which is the name of the race

  Race time - the time of the race

  Race entrants - a list of the entrants to the race

Make an entrant class, which has attributes

  Horse name - the name of the horse

  Jockey name - the name of the jockey

 

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education