13 - Basic Arithmetic with Integer Variables in Java

preview_player
Показать описание

Learn about Java variables and arithmetic operations. We will learn how to use integers to calculate quantities by assigning values and performing math operations on the varialbes.
Рекомендации по теме
Комментарии
Автор

Amazing lesson! Many thanks for making this freely available!

GeorgiosMichalopoulos
Автор

Helped 👍🏽 I’m watching all you videos so I can complete my programs due tomorrow 🙃

robloxvempor
Автор

It would have been more helpful if you explained how the decimal point is lost. Does JAVA choose the closest integer to the decimal number or what?
PS:
1. JAVA does floored division (i.e. rounding towards zero). Eg. 100/27 (=3.7) is stored as 3 in int variable.
2. Repeatedly add the digits in a number until a single digit remains using: int digSum = num - 9*((num-1)/9);

trianglesupreme
Автор

How to code this
Enter·the·2-digit·integer:·34
Product·of·3·and·4·=·12

dennlly
Автор

I do not come around with the following error statement:
"Error: Main method is not static in class Lesson13, please define the main method as:
public static void main(String[] args)"
Can you help me?
Thx

nicolasjoye