Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2005, 11:13 AM
Registered User
 
Join Date: Jan 2005
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]






Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ console app barrytn Visual C++ 2005 2 July 11th, 2008 02: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 09:38 PM
invisible console app asmotritsky Visual C++ 1 November 25th, 2004 03:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.