Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 05:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Problem in Lesson 4 of Infamouse C# Tut

Discussion on Problem in Lesson 4 of Infamouse C# Tut within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2007
Posts: 327
Received Thanks: 54
Problem in Lesson 4 of Infamouse C# Tut

When i always Test what he says in Lesson for like this


Code:
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            double debt = double.Parse(input);
            debt = debt * 1.5;
            Console.WriteLine(debt);
        }
Or

This


Code:
        static void Main(string[] args)
        {
            double balance = double.Parse(Console.ReadLine());
            balance = balance + (balance * 0.07);
            Console.WriteLine(balance); // first month
            balance = balance + 250.00;
            balance = balance + (balance * 0.07);
            Console.WriteLine(balance); // second month
        }

I Get Warning Message


Does this Tut like other tutorials in all sites?
Or that Tut for Coding Conquer stuff only?
If it's like the other tutorials other sites then i have one for my language
elmo3zeb is offline  
Old 01/12/2011, 17:58   #2
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Please tell us what warning message you're getting. If your console is just closing, it's caused by you're not waiting for an user input (this is if you're running with debugging enabled (try Ctrl+F5 instead of just F5).
_Emme_ is offline  
Old 01/12/2011, 18:19   #3


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
The warning is probably about:

foo = foo + bar;

Which of course can be optimized to:

foo += bar;

And similar.
Korvacs is offline  
Old 01/12/2011, 19:07   #4
 
elite*gold: 0
Join Date: Aug 2007
Posts: 327
Received Thanks: 54
This is the Image of testing it

elmo3zeb is offline  
Old 01/12/2011, 19:29   #5
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
static void Main(string[] args)
{
string input = Console.ReadLine();
double debt;
bool debtParsed = double.TryParse(input, out debt);
if (debtParsed)
{
debt = debt * 1.5;
Console.WriteLine(debt);
}
else
Console.WriteLine("Failed to parse value.");
Console.ReadKey();
}
It's because you didn't input a value, using TryParse will check to see if it can or cannot parse the value.
Ian* is offline  
Thanks
1 User
Old 01/12/2011, 21:46   #6
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Just so you know, if you ever run into an error later on and want to troubleshoot it at any forum, what you need to include is the error message and the code where it occurs in, in this case your message is "Input string was not in a correct format", and the row where it is yellow.
_Emme_ is offline  
Reply


Similar Threads Similar Threads
Storm hack with .send | .send lesson Part 1
08/21/2010 - Kal Online - 30 Replies
This is lesson 1 of what useful things .send can do =P later i'll post some more nice things I know that kocp dont allow kalhackit... but u can have some fun with it on servers without kocp or if you smart enough you can do it on servers without kalhackit or even on int if you even smarter :P First of all you need KalHackIt that works on private server with sniffing (Download attached... thx to syntex for the snif.ini add)
Quest "The Lesson"
08/21/2008 - General Gaming Discussion - 0 Replies
Shim-morality Sam-humanity Woo-love Lee-chivalry Jong-loyalty Jule-virtue
PLz Lesson :D <MoonBot>
01/06/2008 - Dekaron - 6 Replies
hey. i wonder if some1 here can learn me how to use the moonbot <or any other cheat :> i really want to up lvl fast <AK 61 Adrboon> thX If you can to make a video lesson :D because i dont have soo good englise SOO :X:confused:
Lesson
05/05/2006 - Conquer Online 2 - 27 Replies
As many people have noticed, there is a huge lack of new programs being developed. So, I'm thinking about having an online (most likely chat room), multi-part lesson where I would lead some people through making a true proxy program that could possibly used for different CO programs. The lesson would most likely be in C# (easily adaptable to VB.NET) and would only be for those who were serious and signed up for it. Students would have to have working knowledge of C++, C#, VB.NET or a similar...
MakeUp Lesson
01/01/2006 - Off Topic - 15 Replies
http://www.koji-honpo.co.jp/makeup/movie/e...e_tal k_300.html ich zitiere hier mal jemanden: Beim Durchstöbern von http://mai.twoday.net/ traute ich fast meinen Augen nicht. Da gibt es doch tatsächlich Klebstoff, um sich die Augen in Form zu kleben. Ich weiß nicht, dabei haben Asiatinnen doch so schöne Mandelaugen. Das arme Mädel kann danach doch fast nicht mehr blinzeln. Jedes weibliche Wesen weiß, wie es ist, wenn man mit Wimperntusche einschläft und am Morgen die Augenlieder...



All times are GMT +1. The time now is 05:09.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.