Challenge: Methods Creation
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 6. Hoofdstuk 4
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 1.25
Challenge: Methods Creation
Veeg om het menu te tonen
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 6. Hoofdstuk 4
single