Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Order Information | Umgang mit Datentypen
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Grundlagen

bookChallenge: Order Information

Aufgabe

Swipe to start coding

Complete the code to declare variables with explicit types and print order information.

  • Declare an int variable for order number and assign 1001;
  • Declare an int variable for quantity and assign 3;
  • Declare a long variable for price per item and assign 5000;
  • Calculate the total order price by multiplying quantity by price per item, and store the result in a long variable;
  • Use Console.WriteLine to print the order number, quantity, price per item, and total price, each on a separate line.

Example output:

Order number: 1001
Quantity: 3
Price per item: 5000
Total price: 15000

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 3
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: Order Information

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

Complete the code to declare variables with explicit types and print order information.

  • Declare an int variable for order number and assign 1001;
  • Declare an int variable for quantity and assign 3;
  • Declare a long variable for price per item and assign 5000;
  • Calculate the total order price by multiplying quantity by price per item, and store the result in a long variable;
  • Use Console.WriteLine to print the order number, quantity, price per item, and total price, each on a separate line.

Example output:

Order number: 1001
Quantity: 3
Price per item: 5000
Total price: 15000

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 2. Kapitel 3
single

single

some-alt