Challenge: Scopes
Завдання
Swipe to start coding
You want to calculate total sales for a day using local and global variables.
- Declare a global variable
grandTotal(outside any method) to store the total sales. - Create a method
AddSalethat:- Declares local variables
priceandquantity. - Calculates the total for that sale and adds it to the global
grandTotal.
- Declares local variables
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 6. Розділ 12
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 1.25
Challenge: Scopes
Свайпніть щоб показати меню
Завдання
Swipe to start coding
You want to calculate total sales for a day using local and global variables.
- Declare a global variable
grandTotal(outside any method) to store the total sales. - Create a method
AddSalethat:- Declares local variables
priceandquantity. - Calculates the total for that sale and adds it to the global
grandTotal.
- Declares local variables
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 6. Розділ 12
single