Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Añadir ejercicio 043-inheritance_and_polymorphism #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Copy link
Contributor

@josemoracard josemoracard commented Jan 3, 2024

No description provided.

Copy link
Contributor

tommygonzaleza commented Jan 17, 2024
edited
Loading

  • Agregar tests con ChatGPT, para que valide:
    • La clase CollegeStudent existe
    • La clase CollegeStudent tiene el atributo name.
    • La clase CollegeStudent tiene el atributo age.
    • La clase CollegeStudent tiene el atributo grade.
    • La clase CollegeStudent tiene el atributo major.
    • La clase CollegeStudent tiene el metodo introduce.
    • El metodo introduce retorna el string esperado (Valida en el mismo test con dos escenarios).
    • La clase CollegeStudent tiene el metodo study.
    • El metodo study retorna el string esperado (Valida en el mismo test con dos escenarios).
    • La clase CollegeStudent tiene el metodo attend_lecture.
    • El metodo attend_lecture retorna el string esperado (Valida en el mismo test con dos escenarios).
  • Agregar solution, que basicamente es el codigo del readme
josemoracard reacted with thumbs up emoji

self.specialization = specialization

def study(self, hours):
print(f"{self.name} is a high school student specializing in {self.specialization} and is studying for {hours} hours for exams.")
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar print por return

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


2. Agrega un nuevo atributo llamado `major` para representar la carrera que están estudiando.

3. Modifica el método heredado `introduce` para imprimir este string:
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para (削除) imprimir (削除ここまで) retornar este string

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,46 @@
# `043` inheritance and polymorphism
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hacer los mismos cambios que en español

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,47 @@
# `043` inheritance and polymorphism
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poner Inheritance con I mayuscula

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

self.major = major

def introduce(self):
print(f"Hi there! I'm {self.name}, a college student majoring in {self.major}.")
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar print por return

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

print(f"Hello! I am {self.name}, I am {self.age} years old, and my current grade is {self.grade}.")

def study(self, hours):
print(f"{self.name} is studying for {hours} hours.")
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar print por return

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

self.grade = grade

def introduce(self):
print(f"Hello! I am {self.name}, I am {self.age} years old, and my current grade is {self.grade}.")
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar print por return

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

print(f"Hi there! I'm {self.name}, a college student majoring in {self.major}.")

def attend_lecture(self):
print(f"{self.name} is attending a lecture for {self.major} students.")
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar print por return

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 31 to 33
college_student = CollegeStudent("Alice", 20, 90, "Computer Science")
college_student.introduce()
college_student.study(3)
Copy link
Contributor

@tommygonzaleza tommygonzaleza Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agregar print

Copy link
Contributor Author

@josemoracard josemoracard Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@tommygonzaleza tommygonzaleza tommygonzaleza approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /