Hello!
I'm currently working on a program for class and I'm stuck. Here's the directions:
1.) Read one integer, n, from file: data.dat (the number "21" is in this file)
2.) The program (4 methods) will loop n times, using indexes 1 to n.
3.) Each time through the loop:
If the loop index is divisible by 3:
Call a function, three, that prints that number on a line
along with three "*" characters.
Pass the number to be printed as a pass-by-value parameter.
Else If the loop index is divisible by 5:
Call a function, five, that prints that number on a line with 5 "#" characters.
Pass the number to be printed as a pass-by-value parameter.
Else If the loop index is divisible by 3 AND by 5:
Call a function, both, that prints that number on a line n times.
Pass the number to be printed as a pass-by-value parameter.
Otherwise:
Print the number on the line.
Here's an example output:
1
2
3 ***
4
5 #####
6 ***
7
8
9 ***
10 #####
11
12 ***
13
14
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
16
Here's what i have so far:
using System;
using System.IO;
class FIZZ
{
static void Main()
{
int n;
StreamReader reader;
reader = new StreamReader("data.dat");
n = Convert.ToInt32(reader.ReadLine());
}
I'm lost as to how to create/call methods...I'm just completely lost in general. All help will be appreciated!