Part 4.5 - Intro to Methods

This is a brief introduction to how to add your own methods.  This is not intended to be anything close to a comprehensive explanation.  Just enough information for you to create a simple method to reduce the size of your main method.

Introduction to Methods

What to Do

1 - Read through the Methods Lesson Tutorial and complete the example program.

2 - Open up your assignment Basic Input from Part 3 and put the code from each part (Greetings, Adder, Distance and Hypotenuse) into a separate method, and call those methods from your Main() method.  None of these methods need to have parameters.

If you are up for a challenge, try to make a static method that has two Parameters, 2 sides of a right triangle (as doubles), and returns the hypotenuse (as a double).  Use it for the assignment.

3 - Complete Methods Assignments.

4 - For your future programming tasks, try to separate each part into its own method as I do in many of my solutions.

What to Submit?

1 - Submit the Intro to Methods Assignment program.

Methods Lesson Tutorial

Part 5.5 Intro to Methods.pdf

Programming Assignment

Part 5.5 Intro to Methods Assignments.pdf

Files