Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Methods Creation | Methoden
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Grundlagen

bookChallenge: Methods Creation

Aufgabe

Swipe to start coding

You run a small store. Each order has a fixed price per item and quantity. Your task is to calculate the total price using a separate method.

  • Create a method (CalculateTotalPrice) that:
    • Does not take any parameters.
    • Uses hardcoded values for itemPrice and quantity.
    • Calculates the total price as itemPrice * quantity.
    • Print the result using Console.WriteLine
  • In Main, call this method.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 6. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Methods Creation

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

You run a small store. Each order has a fixed price per item and quantity. Your task is to calculate the total price using a separate method.

  • Create a method (CalculateTotalPrice) that:
    • Does not take any parameters.
    • Uses hardcoded values for itemPrice and quantity.
    • Calculates the total price as itemPrice * quantity.
    • Print the result using Console.WriteLine
  • In Main, call this method.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 6. Kapitel 4
single

single

some-alt