Lesson contents

Calculate a total

Multiply the number of items by the price of one item to get the total.

Simple example

Start2 × 3
Result6
lesson.jl
function main()
    println((2 * 3))
end

main()
Output
6
Advertisements

Everyday examples

Three notebooks cost 4 each. What is the total?

Start3 × 4
Result12
lesson.jl
function main()
    notebooks = 3
    price = 4
    println((notebooks * price))
end

main()
Output
12
Run the example
Terminal
julia lesson.jl
Official documentation