Avsnitt 1. Kapitel 53
single
Challenge: Methods Creation
Svep för att visa menyn
Uppgift
Svep för att börja koda
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.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 53
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal