Visual Basic.NET Programming. Beginner Lesson 7. Arithmetic Operators

preview_player
Показать описание
This is the seventh in a series of computer science video tutorials for beginners, about programming with Visual Basic.NET (VB.NET) in Visual Studio. In this lesson, you will learn how to use arithmetic operators to perform calculations. Specifically, you learn see how to add, subtract, multiply and divide numbers, and how raise one number to the power of another, namely, exponentiation. You will also learn how to perform whole number division with the backslash operator (which works in the same way as the DIV operator in other programming languages and in pseudocode), and how to obtain the remainder after whole number division with the Mod operator. This video also introduces the runtime error, also known as an exception, caused when VB.NET is unable to convert a string into a number. Handling run time errors (exception handling) is covered in detail in a later video.
Рекомендации по теме
Комментарии
Автор

I'm glad I came across your videos. I will recommend my classmates. My lecture has been getting paid for mumbling.

azothazwane
Автор

\ / MOD - very helpful explanations of my confused mind. Made notes so I don't forget where to look next time I use one or more of these operators and Data Type to match.

jtlunsford
Автор

With your naming convention you have to go through your complete code if you decided to change the type of the variable like in your example.
Not very helpful in big projects.

Maxxermaximus
Автор

Hi, it doesn't work for me, it says Cast not valid from String to the Integer type

weibinren
Автор

If you input text instead of a number is going to use something like ascii to turn it into a number or is going to raise an exception?

kikawet
Автор

I was very surprised to see strings converted to integers or double. Is this a compiler option?

feraudyh
Автор

I'm attempting to write a calculator such that the user can input digits and operators (including parentheses) and end up with a string such as ((8+3)*7-2)/25. and then have VB6 evaluate the entire expression (no matter the expression length). Also, where does MOD fit in in PEMDAS?

allenbennett
Автор

Thank you for this entire series, mate. I’m taking online courses and was tripping over basic stuff for a minute, these helped. I noticed some people mentioning conversions, I used CDbl(txtBox1.Text) and it worked brilliantly.

CapnCook