15,924,367 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by fatand50 (Top 17 by date)
fatand50
18-Apr-13 17:13pm
View
I now understand, thank you Sir. I can count the number of lines by printing the count but do not know how to validate :(
fatand50
18-Apr-13 17:03pm
View
Sorry Sir, What is a over-kill?
fatand50
18-Apr-13 16:42pm
View
Okay let me try. Thank you.
fatand50
18-Apr-13 16:30pm
View
Yes but how? That is the part I don't know or that I've never encountered. I really need to know how to do this.
fatand50
18-Apr-13 16:28pm
View
It's on top before the code. But here it is:
Write a static method, Display() that accepts a string representing the name of the file. The method should read and display only the first the five lines of the file's contents. If the file contains less than 5 lines, it should display the file's entire contents.
fatand50
20-Feb-13 15:42pm
View
Oh yes Sir, that is why I also accepted the Solution. Thank you a lot.
fatand50
20-Feb-13 15:41pm
View
Thank you Jibesh, this is just way to advanced for me. I will refer back to this one day. For now we are just introduced to basic concepts and we are also not allowed to use an built-in array methods for calculations. Stay blessed.
fatand50
20-Feb-13 15:38pm
View
Thank you Matt and yes I understand your point about the exception handling, for now we are told to only consider using the the conversion and then the try anc catch blocks. Otherwise you are so right. Thank you a lot. Stay blessed.
fatand50
19-Feb-13 15:43pm
View
When I add that statement I see a difference, at least now the invalid values are somehow discarded within the calculation of lowest value, however there are still some minor adjustments I have to do with my code. Thank you a lot all of you guys. Stay blessed.
fatand50
19-Feb-13 15:21pm
View
Here are the ten values:
2; 12; r; 45; hello; 874.54; 200; g; K; 23
Note that these values: r;hello;g and K are regarded as invalidEntries. So my problem is instead of lowest to be =2, it becomes 0 because of one of the invalid entries.
fatand50
19-Feb-13 15:16pm
View
Here are the ten values:
2; 12; r; 45; hello; 874.54; 200; g; K; 23
fatand50
19-Feb-13 15:06pm
View
Okay I think I'm the one to blame, I did not explain what are the invalid values. Well invalid values are when a user can enter a string or char, a user is required to enter only numbers. So my problem is everytime a user enters an invalid value, the
variable lowest
is always 0. For example if amounts are as follows: 3; 56; 123; 7 instead of the lowest to be 3, it always becomes 0 if there is an invalid value entered.
fatand50
19-Feb-13 14:59pm
View
Okay let me rather explain what I mean, invalid values are counted and then stored to invalidEntries variable, a value is invalid if a user can enter a wrong format. For example a user is required to enter only numbers. But if the user enters let's say 'K' Visual C# regards that as 0 and I don't know why, I want to find a way to make Visual C# discard that 0. Because even if there's 5 as a lowest value, but a user entered 'Z' or "Hello" lowest always becomes 0.
fatand50
18-Feb-13 16:20pm
View
Well I hear your suggestion but at the moment I am only required to deal with Functions and Exception Handling on a book called Begining Visual C# 2010 (Chapter 6 & 7 only), and also the question is very strict that I must use out parameters. Thank you for your suggestion, I will refer back to it as we do advanced techniques.
fatand50
18-Feb-13 16:00pm
View
Thanx, Griff gave me a solution. And I kind of now understand the whole concept.
fatand50
18-Feb-13 15:53pm
View
Thank you a lot, now it makes sense, I now understand that when the 10 values are entered they will be stored directly to amounts and then (out) to the Main. I dont know if you get what I mean.
fatand50
18-Feb-13 15:40pm
View
Thank you for your response, Well the thing is I want that method parameter to have values of an array that comes inside the GetSalesData method,hence I used the [ ] to indicate that the values are from only valid entries, hence on top there is an empty list that will store only valid values.
Show More