Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 25th, 2005, 11:13 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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]

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ console app barrytn Visual C++ 2005 2 July 11th, 2008 03:11 AM
Schedule a console app hamilton General .NET 1 January 5th, 2007 10:50 AM
calling webservice in console app error msrnivas General .NET 1 October 25th, 2006 10:38 PM
invisible console app asmotritsky Visual C++ 1 November 25th, 2004 03:27 PM



All times are GMT -4. The time now is 07:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.