Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Updated 14-Jun-18 21:52pm
v3

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.
 
Share this answer
 
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.
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.
 
Share this answer
 
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900