Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Order Information | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Basics
Sectionย 1. Chapterย 12
single

single

bookChallenge: Order Information

Swipe to show menu

Task

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 desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 1. Chapterย 12
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt