Shipping Cost calculator

I'm new to this form, and I seem to like it so far. Anyways, I have this Project that i'm nearly done with but in the sub-class I'm getting 0.0 as an output instead of the actual calculation. Below is the project and the code:

You are requested to design the class Package with instance variables representing package number, weight, and shipping method. The shipping method is a character: A for Air, T for Truck, and M for Mail. The class contains a constructor that requires arguments for weight and shipping method. The constructor should create automatic unique package numbers. The class defines a calculateCost()method that determines the shipping cost of a package based on the following:

The package class also contains a method display()that displays the values of a package object.

Create a subclass InsuredPackage that adds an insurance cost to the shipping cost based on the following:

Shipping cost before insurance (in $)-----Additional cost

10.00 to 100.00 --------------------------15.00
10.001 to 300.00--------------------------25.50
301.00 to over --------------------------34.00

Create a class Owner that represents the owner of a package. The class should contain an array reference that references the packages belonging to the owner, in addition to the name, mailing address, and owner ID (created automatically and uniquely by the constructor).

Write a test program that interacts with the user to create a number of owners and packages belonging to them. The program must allow the user to request a report showing information about owners and their packages.

Well, Right now, i will explain you for your problem. This is very simple problem. You have already known Shipping cost must calculate based on user input weight. So, you request this from user. So, Shipping cost is appeared correctly because you inserted the weight value in Shipping cost calculation. Howerver, However, However........ Why didn't you insert the resulting shipping cost into the obj ' ip ' of InsuredPackage. You also know Insurance cost must calculate based on the resulting shipping cost. But you miss to insert it into ' ip '. Why ?!!!!!! You should write as the following .......

I only changed to be correct for Air. See and Read my changed coding and also try for Truck and Mail yourself.And Then, if i have to tell the truth, your program is loosely constructed. You declared so many member functions. However, you didn't use the most of your declared function. And then, i think you are confusing about If-else and return statements. You should do to be sure. These are basic of programming.

*** Searching Error is one of the ability of programmers. When you see unexpected results from your program, don't depress. Trace the program and Search the errors. This tracing and Searching will help you to be better programmer ****

I spent two days trying to figure out whats the problem of the Insuredpackage class and I didn't notice its that simple and its in the if-else statement, thinking it was right, so I should take a better look next time.

Second, to honest I didn't know a clue about the ip.setCost(pf.getCost()); and didn't know I could do that or at least didn't cross my mind.

So... I assumed your problem is successfully passed over. I also feel pleasure when someone releases from troubles because of me. So, The word "Thank you" is not needed between our relationship. That is because we are programmers... Java Programmers. The thing we need between programmers is just knowledge sharing and helping. And then, I encourage you to be a great programmer. Because your country is better place than our country(Myanmar). The salary of a programmer in my country is only 50 dollars for a month. So, you are living in a nice place and you should do better. I do really believe you are also trying hard.

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...