Abschnitt 6. Kapitel 9
single
Challenge: Scopes
Swipe um das Menü anzuzeigen
Aufgabe
Wischen, um mit dem Codieren zu beginnen
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
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 6. Kapitel 9
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen