Tutorial 3: Basic Operators in GDScript

GDScript Basic Operators

In this tutorial, you'll learn how to use the basic operators like addition, subtraction, multiplication and division used in the compound interest formula, as shown above. You can download the source code here.

It utilizes the lessons from previous tutorials, and I suggest studying them first before this. The example is straightforward. Also, you'll notice I used variables with similar words but in different case and type; just to show that you can use variables this way.

The answer to the problem above is shown in the Output console.

Answer to the Compound Interest Problem

To practice what you've learned, create a similar program using the Amortization Formula.

Related Posts:

  • Tutorial 8: Basic For Loop in GDScript GDScript of Basic For Loop In this example, it shows the basic uses of a for loop statement. One is to increment and the other decrements the value of 'n'. There are other usages but for now let's tackle the common ones. … Read More
  • Tutorial 10: Diamond Shapes using Loops in GDScriptextends Node2D # Draws a diamond with adjustable size func _ready(): # Try changing 6 with even integers from 4 to 26 diamond_for(6) diamond_while(6) func diamond_for(size: int): tri_for(size) #Upside T… Read More
  • Tutorial 7: Basic Match Statement in GDScript GDScript Match Statement The Godot match statement is the equivalent of switch statement in other programming languages. It's a cleaner way of handling conditional statements. If a match statement can handle my conditions… Read More
  • Tutorial 11: Series 1 Exercise 1 in GDScriptextends Node2D const CURRENT_PRINCIPAL: float = 5678.9 const INTEREST_RATE: float = 0.03 const COMPOUND_PER_YEAR: int = 1 var years_to_grow: int = 50 var target_amount: int = 7000 func _ready(): plot_years(CURRENT_PRINCIPA… Read More
  • Tutorial 9: Basic While Loop in GDScript GDScript While Loop The GDScript above shows the basic uses of while loop to increment and decrement values. In this example the decrement operator -= is introduced. You can download the source code here. In this tutoria… Read More

0 comments:

Post a Comment

© 2020 by Emman Lijesta, all rights reserved. Powered by Blogger.