Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6500 POINTS TO COMPLETE WRITE THIS PROGRAM! Can someone create a program for me.

ID: 3560339 • Letter: 6

Question

6500 POINTS TO COMPLETE WRITE THIS PROGRAM!

Can someone create a program for me.

What I want:

A program that can store data of my comic book collection.

It has to be in GUI and I can add a comic book or remove a comic book.

Whenever I run the program I want to be able to see the comics that are saved on there.

When I add comic book I want to be able to input these data:

year, name,volume #, issue #, rarity (maybe a radio button? displaying - common, uncommon, rare, variant), and grade (basically the condition of the comic - please use a radio button or dropdown box **search google to find the rarity** it should be like Poor, FIne, very fine, mine, near mint, etc), and price.

I also want to be able to remove the comic if i sell it or something...

And If you can add a search button or something that would be cool (if i can search by year, issue number, or wahtever)

What else would be nice if i run the program I dont just see all the hundreds of comics I added. I can click a drop down box and it will display the type of comic and I can click on it and view that type.

So like Batman would be one or spiderman, superman, action comics, thor, etccc.

I will give you all of my 6500 points for this program. PLEASE MAKE IT LOOK NICE!

Explanation / Answer

If ref1 or ref2 or ref3 is null, then you'll get a NullReferenceException. If you want to solve the problem, then find out which one is null:

You can step through your code with the debugger to see which is null, or just let it run, and the exception message will tell you which of those lines is the culprit.

Specifically, in HttpContext.Current.User.Identity.Name, the HttpContext.Current could be null, or the User property could be null, or the Identity property could be null.

Simple

Indirect

The same applies to nested object initializers:

While the new keyword is used, it only creates a new instance of Book, but not a new instance of Person, so the Author the property is still null.

Array

Array Elements

Jagged Arrays

Collection/List/Dictionary

Range Variable (Indirect/Deferred)

Bad Naming Conventions:

If you named fields differently from locals, you might have realized that you never initialized the field. Suggestion:

ASP.NET Page Life cycle:

ASP.NET Session Values

ASP.NET MVC empty view models

Ways to Avoid

Explicitly check for null, and ignore null values.

Explicitly check for null, and provide a default value.

Explicitly check for null, and throw a more meaningful exception.

Use Debug.Assert if a value should never be null, to catch the problem earlier.

Use GetValueOrDefault() for nullable objects to provide a default value when null is encountered.

Use the null coalescing operator: [C#] or If() [VB].