Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Compose a Computer Class | Composition, Inheritance, and Refactoring
C# OOP Class Construction Drills

bookChallenge: Compose a Computer Class

Tarefa

Swipe to start coding

Practice composition by building a Computer class that contains other component classes. In this task, you will implement a Computer class that holds references to CPU, RAM, and Storage objects as its fields.

  • Add fields to the Computer class for CPU, RAM, and Storage.
  • Implement a constructor for Computer that takes CPU, RAM, and Storage objects as parameters and assigns them to the corresponding fields.
  • Add a method GetSpecs() to the Computer class that returns a string combining the results of calling GetInfo() on each component.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

How does this information apply to real-world situations?

close

bookChallenge: Compose a Computer Class

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Practice composition by building a Computer class that contains other component classes. In this task, you will implement a Computer class that holds references to CPU, RAM, and Storage objects as its fields.

  • Add fields to the Computer class for CPU, RAM, and Storage.
  • Implement a constructor for Computer that takes CPU, RAM, and Storage objects as parameters and assigns them to the corresponding fields.
  • Add a method GetSpecs() to the Computer class that returns a string combining the results of calling GetInfo() on each component.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 2
single

single

some-alt