Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 240 – Computer Programming I Lab

Similar presentations


Presentation on theme: "CS 240 – Computer Programming I Lab"— Presentation transcript:

1 CS 240 – Computer Programming I Lab
Kalpa Gunaratna –

2 Contact Contact by e-mail Office hours kalpa@knoesis.org 376 Joshi
Mondays & Wednesday 3:00 pm – 4:00 pm

3 Methods <access modifier> <return type> <method name>(<parameters>){ } Example: private int getAge() { return <something of int type>; } The above method returns an int value and some int value should be returned.

4 Example : public static void doCalc() { body }
Since above method is of type “void” it does not return anything. Because it is “static” you can directly call it from anywhere using the class name it belongs to. If the class it belongs to is Calculations, it can be called by Calculations.doCalc(); .

5 In Lab Do the lab having one method to get user input for the size of the shae.

6 Post Lab Use methods to get user input for the character to print the shapes. Please follow the grading scheme when you do post labs and projects.


Download ppt "CS 240 – Computer Programming I Lab"

Similar presentations


Ads by Google