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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
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
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,