Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: Apllication that will copy files Pin
new2pgrmg25-Dec-07 21:35
new2pgrmg25-Dec-07 21:35 
GeneralRe: Apllication that will copy files Pin
mav.northwind25-Dec-07 23:56
mav.northwind25-Dec-07 23:56 
GeneralRe: Apllication that will copy files Pin
Waleed Eissa26-Dec-07 6:15
Waleed Eissa26-Dec-07 6:15 
QuestionHow to apply patches...? Pin
Pankaj - Joshi25-Dec-07 16:51
Pankaj - Joshi25-Dec-07 16:51 
AnswerRe: How to apply patches...? Pin
Jeeva Jose25-Dec-07 22:20
Jeeva Jose25-Dec-07 22:20 
Generalclass design Pin
netJP12L25-Dec-07 10:56
netJP12L25-Dec-07 10:56 
GeneralRe: class design Pin
KaptinKrunch26-Dec-07 9:26
KaptinKrunch26-Dec-07 9:26 
QuestionHow to validate the inputs Pin
Kefaleas Stavros25-Dec-07 10:26
Kefaleas Stavros25-Dec-07 10:26 
How can I alter this code

<br />
using System;<br />
<br />
public class Analysis<br />
{<br />
   public void ProcessExamResults()<br />
   {<br />
      // initializing variables in declarations<br />
      int passes = 0; // number of passes<br />
      int failures = 0; // number of failures<br />
      int studentCounter = 1; // student counter<br />
      int result; // one exam result from user<br />
<br />
      // process 10 students using counter-controlled repetition<br />
      while ( studentCounter <= 10 )<br />
      {<br />
         // prompt user for input and obtain value from user<br />
         Console.Write( "Enter result (1 = pass, 2 = fail): " );<br />
         result = Convert.ToInt32( Console.ReadLine() );<br />
<br />
         // if...else nested in while <br />
         if ( result == 1 ) // if result 1,<br />
            passes = passes + 1; // increment passes           <br />
         else // else result is not 1, so<br />
            failures = failures + 1; // increment failures<br />
<br />
         // increment studentCounter so loop eventually terminates<br />
         studentCounter = studentCounter + 1;<br />
      } // end while<br />
<br />
      // termination phase; prepare and display results<br />
      Console.WriteLine( "Passed: {0}\nFailed: {1}", passes, failures );<br />
<br />
      // determine whether more than 8 students passed<br />
      if ( passes > 8 )<br />
         Console.WriteLine( "Raise Tuition" );<br />
   } // end method ProcessExamResults<br />
} // end class Analysis<br />


so that it can validate its inputs.I want the app to keep looping until the user enters a correct value.
Thnx!
AnswerRe: How to validate the inputs Pin
Ed.Poore25-Dec-07 14:48
Ed.Poore25-Dec-07 14:48 
AnswerRe: How to validate the inputs Pin
KaptinKrunch26-Dec-07 8:06
KaptinKrunch26-Dec-07 8:06 
GeneralEffective Security Access Check Pin
Jeffrey Walton25-Dec-07 7:42
Jeffrey Walton25-Dec-07 7:42 
GeneralRe: Effective Security Access Check Pin
Jeffrey Walton25-Dec-07 8:05
Jeffrey Walton25-Dec-07 8:05 
GeneralRe: Effective Security Access Check Pin
martin_hughes26-Dec-07 2:11
martin_hughes26-Dec-07 2:11 
GeneralRe: Effective Security Access Check Pin
Jeffrey Walton28-Dec-07 8:08
Jeffrey Walton28-Dec-07 8:08 
GeneralRe: Effective Security Access Check [modified] Pin
martin_hughes28-Dec-07 9:28
martin_hughes28-Dec-07 9:28 
GeneralI ate too much... and another nice C# 3.0 feature Pin
martin_hughes25-Dec-07 6:17
martin_hughes25-Dec-07 6:17 
GeneralRe: I ate too much... and another nice C# 3.0 feature Pin
Jeffrey Walton25-Dec-07 7:39
Jeffrey Walton25-Dec-07 7:39 
GeneralRe: I ate too much... and another nice C# 3.0 feature Pin
martin_hughes25-Dec-07 7:50
martin_hughes25-Dec-07 7:50 
GeneralRe: I ate too much... and another nice C# 3.0 feature Pin
Waleed Eissa25-Dec-07 17:09
Waleed Eissa25-Dec-07 17:09 
GeneralRe: I ate too much... and another nice C# 3.0 feature Pin
martin_hughes26-Dec-07 2:28
martin_hughes26-Dec-07 2:28 
GeneralExercise Solution Pin
Kefaleas Stavros24-Dec-07 23:52
Kefaleas Stavros24-Dec-07 23:52 
GeneralRe: Exercise Solution Pin
Luc Pattyn25-Dec-07 0:58
sitebuilderLuc Pattyn25-Dec-07 0:58 
GeneralA simple paint program-C# Pin
Ali Rahimei24-Dec-07 22:48
Ali Rahimei24-Dec-07 22:48 
GeneralRe: A simple paint program-C# Pin
Luc Pattyn25-Dec-07 1:00
sitebuilderLuc Pattyn25-Dec-07 1:00 
GeneralRe: A simple paint program-C# Pin
Paul Conrad25-Dec-07 10:33
professionalPaul Conrad25-Dec-07 10:33 

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.