Challenge: Compose a Computer Class
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
Computerclass forCPU,RAM, andStorage. - Implement a constructor for
Computerthat takesCPU,RAM, andStorageobjects as parameters and assigns them to the corresponding fields. - Add a method
GetSpecs()to theComputerclass that returns a string combining the results of callingGetInfo()on each component.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Can you explain this in simpler terms?
What are some examples related to this topic?
How does this information apply to real-world situations?
Incrível!
Completion taxa melhorada para 4.17
Challenge: Compose a Computer Class
Deslize para mostrar o menu
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
Computerclass forCPU,RAM, andStorage. - Implement a constructor for
Computerthat takesCPU,RAM, andStorageobjects as parameters and assigns them to the corresponding fields. - Add a method
GetSpecs()to theComputerclass that returns a string combining the results of callingGetInfo()on each component.
Solução
Obrigado pelo seu feedback!
single