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

bookChallenge: Compose a Computer Class

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 2
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

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

Veeg om het menu te tonen

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 2
single

single

some-alt