Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 8:31
mve#realJSOP13-Apr-18 8:31 
GeneralRe: Need help with Functions, ASAP! Pin
BillWoodruff13-Apr-18 9:14
professionalBillWoodruff13-Apr-18 9:14 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 8:42
mve#realJSOP13-Apr-18 8:42 
GeneralRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:01
professionalEddy Vluggen13-Apr-18 9:01 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:07
mve#realJSOP13-Apr-18 9:07 
GeneralRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:12
professionalEddy Vluggen13-Apr-18 9:12 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:28
mve#realJSOP13-Apr-18 9:28 
AnswerRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:10
mve#realJSOP13-Apr-18 9:10 
So here we are. I provided an answer (two, in all actuality), and my answers were down-voted because some pompous ass decided that you didn't deserve the answer I provided.

I didn't provide any guidance, because I don't know if you're TRULY serious about being a programmer, or just taking an elective course to fulfill diploma requirements.

If you're serious, you gotta learn to THINK like a programmer. That means taking a project, breaking it down into logical steps, writing psuedo-code, and then writing actual code.

I'm assuming your instructor taught you about functions, and how they work. Actually, they're called METHODS, and all methods technically return a value, whether it's void or some other type. Methods also (optionally) accept one or more parameters. So let's break down your requirement into easily consumable requirements:

0) write a program that demonstrate the use of a function (method)
1) the function calculates an average of five values
2) the function returns the calculated average

Notice that there is no specification regarding WHERE the function gets the five values. This means you can set up a globally accessible collection of values, or pass parameters to the function. It's your choice how to proceed here.

Once you've decided which way you're going to provide the consumable data (the five values), you can craft your method prototype accordingly.

The body of the method has two processes - calculate the average of the values provided, and return the resulting average.

It's really just that simple (if you were in class for the instructor's guidance regarding the assignment, and paying attention).

If you want definitions for any of the nomenclature I've used above, google is your friend. You certainly shouldn't expect any specific help here, because after all, this is a homework question, and Bill simply won't let that happen.

----------------

Now, that too way too much f*ckin time to type. I don't really care if you are serious about being a programmer, or that this is even homework. I'm not your instructor, and it took LESS of my VALUABLE time to simply "give you the codez" than to give you most of the lesson you should have gotten from your instructor.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013


modified 13-Apr-18 15:31pm.

PraiseRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:15
professionalEddy Vluggen13-Apr-18 9:15 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:33
mve#realJSOP13-Apr-18 9:33 
GeneralRe: Need help with Functions, ASAP! Pin
BillWoodruff13-Apr-18 18:54
professionalBillWoodruff13-Apr-18 18:54 
Questiongetting a 200 or what ever it is status_code not a ok Pin
sadsack12-Apr-18 9:04
sadsack12-Apr-18 9:04 
AnswerRe: getting a 200 or what ever it is status_code not a ok Pin
Afzaal Ahmad Zeeshan12-Apr-18 9:23
professionalAfzaal Ahmad Zeeshan12-Apr-18 9:23 
GeneralRe: getting a 200 or what ever it is status_code not a ok Pin
sadsack17-Apr-18 13:59
sadsack17-Apr-18 13:59 
AnswerRe: getting a 200 or what ever it is status_code not a ok Pin
Richard MacCutchan12-Apr-18 21:38
mveRichard MacCutchan12-Apr-18 21:38 
GeneralRe: getting a 200 or what ever it is status_code not a ok Pin
sadsack17-Apr-18 14:02
sadsack17-Apr-18 14:02 
QuestionWrite a 2D array of objects in range Excel C# Pin
Gtari Abir12-Apr-18 5:29
Gtari Abir12-Apr-18 5:29 
AnswerRe: Write a 2D array of objects in range Excel C# Pin
Dave Kreskowiak12-Apr-18 7:29
mveDave Kreskowiak12-Apr-18 7:29 
QuestionValidate User Against Active Directory Pin
Kevin Marois11-Apr-18 10:23
professionalKevin Marois11-Apr-18 10:23 
AnswerRe: Validate User Against Active Directory Pin
Keviniano Gayo11-Apr-18 21:55
Keviniano Gayo11-Apr-18 21:55 
GeneralRe: Validate User Against Active Directory Pin
Kevin Marois12-Apr-18 5:47
professionalKevin Marois12-Apr-18 5:47 
GeneralRe: Validate User Against Active Directory Pin
Keviniano Gayo13-Apr-18 1:49
Keviniano Gayo13-Apr-18 1:49 
QuestionGetting a directory path if directory name is given Pin
NiKHiLMS11-Apr-18 3:17
NiKHiLMS11-Apr-18 3:17 
AnswerRe: Getting a directory path if directory name is given Pin
Richard MacCutchan11-Apr-18 3:32
mveRichard MacCutchan11-Apr-18 3:32 
GeneralRe: Getting a directory path if directory name is given Pin
NiKHiLMS11-Apr-18 21:38
NiKHiLMS11-Apr-18 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.