Секція 6. Розділ 9
single
Challenge: Scopes
Свайпніть щоб показати меню
Завдання
Проведіть, щоб почати кодувати
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. Розділ 9
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат