rideronix's Profile
Reputation: 1
Apprentice
- Group:
- Members
- Active Posts:
- 25 (0.14 per day)
- Joined:
- 24-November 12
- Profile Views:
- 76
- Last Active:
Dec 14 2012 04:14 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Average function Error
Posted 14 Dec 2012
Oh thank you so much !
Placed the c = c +1; behind the array and it works fine now ! -
In Topic: Average function Error
Posted 14 Dec 2012
I've modified it
static int Fonc_question(int n) // Pose un nombre n de question { int[] questions = new int[n]; int q = n; // to make the moy (average) int r = n; // to make the sum int c = 0; // Will get (c = n) numbers int som = 0; // sum int moy = 0; // average int rec =0; while (n > 0) { c = c + 1; rec +=1; Console.WriteLine("Nombre " + (c) + ":"); questions[c] = Convert.ToInt32(Console.ReadLine()); n=n-1; } if (n <= 0) { while (r > 0) { r = r -1; som += questions[r]; } moy = som / q; Console.WriteLine(moy); } Console.ReadLine(); return n; } static void Main(string[] args) { int nombre; Console.WriteLine("Combien de nombres ?"); nombre = Convert.ToInt32(Console.ReadLine()); Fonc_question(nombre); } }
The code works fine until this line
questions[c] = Convert.ToInt32(Console.ReadLine());
But sadly it seems to work a bit aswell so I don't get it.
Example:
I enter 3 (so i need to enter 3 times a number)
It will prompt me 3 times and once the 3rd number is entered it shows me an error underlining this statement.
Saying: "Index was outside the bounds of the array." -
In Topic: Uncomplete function - Simple Mistake
Posted 13 Dec 2012
Oh thanks ! Stupid error... -
In Topic: C# Console Application for ROT13 (encryption)
Posted 2 Dec 2012
Thanks all done. Now I've ran into another problem but I'll make a new post since it's not really related. -
In Topic: C# Console Application for ROT13 (encryption)
Posted 2 Dec 2012
Problem solved.
lettre = (char)rot13; Console.Write(lettre);
Works perfectly. However it display each new string one under another, how can I manage not to do this ? I wrote "Console.Write()" and not "Console.WriteLine()" but doesn't seem to change anything...
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Click here to e-mail me
Friends
rideronix hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
rideronix has no profile comments yet. Why not say hello?