is making console app using C# a waste
PLease go thru the below function and give me the reason why the first read works and the next two dont!!!!
public void getData()
{
Student stud=new Student();
System.Console.WriteLine("\n Enter the number of students(<11) ");
num=(int)System.Console.Read();// Statement gets executed
System.Console.WriteLine("Enter the Rollnumber,Name and Percentages");
stud.Rollnumber=(int)System.Console.Read();//statement never got executed in the console
stud.Name=System.Console.ReadLine();// statement never got executed in the console
stud.percentage=(float)System.Console.Read();
if(stud.percentage>80)
stud.Grade=grade.A;
else if(stud.percentage<40)
stud.Grade=grade.F;
if(stud.percentage>50 && stud.percentage<60)
stud.Grade=grade.D;
if(stud.percentage>70 && stud.percentage<80)
stud.Grade=grade.B;
if(stud.percentage>60 && stud.percentage<70)
stud.Grade=grade.C;
students[i].Name=stud.Name;
students[i].Rollnumber=stud.Rollnumber;
students[i].percentage=stud.percentage;
students[i].Grade=stud.Grade;
}<div align="left"></div id="left">[/left]
|