Click here to Skip to main content
13,663,987 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I am deleting this question since no help is allowed on homework


What I have tried:

I am deleting this question since no help is allowed on homework
Posted 14-Jun-18 12:58pm
Updated 14-Jun-18 21:52pm
v3
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Well, you can easily find the source of the problem if you used the debugger.

The collection exposed by .classes doesn't exist. It's null. When you called the Add method on a null object, you got that exception.

You have to examine your TravelInformation class to find out why that collection doesn't exist.
  Permalink  
Comments
Dave Kreskowiak 14-Jun-18 21:30pm
   
This is your class work, so I'm not doing your work for you.

But, the code below in your TravelInformation class declares a public property, called "classes" as one that accepts or returns a collection of type "List(Of ClassOfService)". This does NOT create an instance of a collection of that type, and that's what your TravelInformation class is missing.

See your class notes on class constructors and how to create an instance of a collection.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Oh, it's not that help isn't allowed. It's that your definition of "help" isn't helpful to you at all. No, you're not going to have your code written for you. You don't learn a damn thing that way.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Quote:
I am deleting this question since no help is allowed on homework

No, help is allowed on homework, simply help is not us doing your homework.
Here, we help you fix your code, mainly, you have to show your code and explain what is wrong. A sample input, actual output and expected output will help too.
The better the description of problem, the better the help you get.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180810.1 | Last Updated 15 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100