Psyguy's Profile User Rating: -----

Reputation: 81 Whiz
Group:
Authors
Active Posts:
346 (0.2 per day)
Joined:
12-January 11
Profile Views:
11,797
Last Active:
User is offline Jul 22 2015 04:52 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
250

Latest Visitors

Icon   Psyguy I reject your reality and replace it with my own...

Posts I've Made

  1. In Topic: Problem with Parallel Arrays

    Posted 11 May 2015

    You might just need to put in a line inside the if statement to force the console window to stay open, instead of just closing.

          for(int i= 0; i < days.length; i++)
          {
          
             if (days[i] == user)
                {
                   System.out.print("There are "+ days[i] +"days in "+month[i]);
                   //put a line here to keep the console open...i don't recall what it is in Java, but in C# i just use "Console.Readkey();"
                }
          }
    
    
  2. In Topic: Function Not Returning Given Value

    Posted 7 May 2015

    First, where is "letterGrade" declared? I dont see anywhere where you are setting that value.

    Second, your "Grading" function takes three parameters and you are only passing it one (i.e. Grading(letterGrade)). Furthermore, you aren't doing anything with the returned value. Is there something I'm missing?

    Lastly, I would use Double.TryParse to parse out the doubles. That function will give you error checking for if the text can actually be interpreted as a double (doesn't throw an error if not, it returns "false"). Use it like this (forgive my syntax if it is slightly off, I haven't done VB.NET for a couple years):

    Private Function ConvertToDouble(myString as String) as Double
         Dim d As Double
    
         If Double.TryParse(myString, d) Then
              Return d
         End If
    
         Return 0.0 'Or something else you deem appropriate
    End Function
    
    
  3. In Topic: Help writing tests for Book class

    Posted 1 May 2015

    The first thing I would do is change the price property on your book class to be a double. There is no reason why a price, which in any country in the world is a double (or int), should be a string. It also prevents you from having to convert it from a string to a double every time you want to sum prices and storing those prices in yet another array.

    public class Booktest 
    {
        public static void main(String[] args) 
        {  
             Book[] difbooks = new Book[4];
             double totalPrice = 0.00;
    
             difbooks[0] =new Book("CS", "0874478539", "SAM KL", 11.82);
             difbooks[1] =new Book("SAT Prep Black Book: The Most Effective SAT Strategies Ever Published ", "0615780849", " Mike Barrett ", 17.97);
             difbooks[2] =new Book("Cracking the SAT with 5 Practice Tests, 2015 Edition (College Test Preparation)", "0804124655", "Princeton Review", 13.89);
             difbooks[3] =new Book("The Critical Reader", "1479224715", "Erica L. Meltzer", 31.00);
    
             for (int i=0;i<difbooks.length;i++) {
                totalPrice = totalPrice + difbooks[i].price;
                System.out.println("The total price is now " + totalPrice);            
             }
        } 
    }
    
    
  4. In Topic: Entity framework select

    Posted 30 Apr 2015

    There are two possibilities:
    1. comboBox1Test is null
    2. comboBox1Test.Items is null

    Try making sure both are not null before adding any items to the list.

    using (var context = new NLHEntities())
    {
        var blog = context.ChambresPrives.Where(b => b.Status == "Libre").Select(b => b.NumChambre).ToList();
        foreach (var item in blog)
        {
            //check that both comboBox1Test and comboBox1Test.Items is not null here...
            comboBox1Test.Items.Add(item);
        }
    }
    
    
  5. In Topic: Saving/Loading a checkledlistbox to XML

    Posted 24 Apr 2015

    Try adding an initialization of a new instance of "itm.ItemColors". That is likely the issue. Just saying that the "ItemColors" is a list of string is not enough, you must (likely in the constructor) instanciate a new one to get it working:

    Private _itmColors As List(Of String) = New List(Of String)
    
    

My Information

Member Title:
D.I.C Regular
Age:
37 years old
Birthday:
October 14, 1977
Gender:
Location:
Eugene, OR
Full Name:
Joel M. Priddy
Years Programming:
3
Programming Languages:
VB.NET, C#, ASP/ADO.NET, C++, Java, XML, SQL

Contact Information

E-mail:
Click here to e-mail me
LinkedIn:
http://www.linkedin.com/pub/joel-priddy/12/49/7b5/
Twitter:
joel_priddy

Friends

Comments

Psyguy has no profile comments yet. Why not say hello?