Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Order Information | Gestion des Types de Données
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Bases de C#

bookChallenge: Order Information

Tâche

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

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 3
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Order Information

Glissez pour afficher le menu

Tâche

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

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 3
single

single

some-alt