Challenge: Methods Creation
Завдання
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
itemPriceandquantity. - Calculates the total price as
itemPrice * quantity. - Print the result using
Console.WriteLine
- In
Main, call this method.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 6. Розділ 4
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 1.25
Challenge: Methods Creation
Свайпніть щоб показати меню
Завдання
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
itemPriceandquantity. - Calculates the total price as
itemPrice * quantity. - Print the result using
Console.WriteLine
- In
Main, call this method.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 6. Розділ 4
single