top of page

Make a program: functions and subroutines

  • a01337106
  • 10 feb 2015
  • 1 Min. de lectura

Now that we know the basics of pseudocode, we are going to learn functions, this is a function:

public class Sumar{

int a=10;

int b=5;

public static int suma(number a,b){

int sum;

sum=a+b;

}

}

First, a class is initialized, the name of this class will be "Suma":

public class Sumar{

Then a function is opened:

public static int suma(number a,b){

"public" refers to the persons or programs that can access to the method.

"int" refers to the value returned by the method.

"suma" is the name of the method

(number a,b) refers to the variables that are called inside the method.

Then, inside the method, is the code that will be executed, in this case is a sum between a and b.

int sum;

sum=a+b;

Finally you close the method and the class:

}

}

 
 
 

Comments


 THE ARTIFACT MANIFAST: 

 

This is a great space to write long text about your company and your services. You can use this space to go into a little more detail about your company. Talk about your team and what services you provide. Tell your visitors the story of how you came up with the idea for your business and what makes you different from your competitors. Make your company stand out and show your visitors who you are. Tip: Add your own image by double clicking the image and clicking Change Image.

 UPCOMING EVENTS: 

 

10/31/23:  Scandinavian Art Show

 

11/6/23:  Video Art Around The World

 

11/29/23:  Lecture: History of Art

 

12/1/23:  Installations 2023 Indie Film Festival

 FOLLOW THE ARTIFACT: 
  • Facebook B&W
  • Twitter B&W
  • Instagram B&W
 RECENT POSTS: 
 SEARCH BY TAGS: 

© 2023 by Karla Lugo. Proudly created with Wix.com

bottom of page