need help with shipping cost program

I am doing a C++ program for class it has to list shipper, receiver, add insurance and shipping cost. It works fine in Raptor flow chart. I have modified it after conversion. The problem is when running you are only able to input the shipper info then it runs everything with no other input and gives you crazy numbers. What am I missing???!!!! driving me crazy.

Thanks for the help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include <string>


using namespace std;

int main()
{
   string raptor_prompt_variable_zzyz;
   double shipper;
   double ins;
   double recipient;
   double pkgwght;
   double total;

   cout << "\n\nEnter name of the shipper. ";
  
   cin >> shipper;
   cout << "\n\nEnter name of the recipient. ";
   
   cin >> recipient;
   cout << "\n\nEnter the weight of your package. ";
   
   cin >> pkgwght;
   cout << "\n\nEnter the value of your package for insurance cost. ";
   
   cin >> ins;
   if (ins < 500)
   
      ins = 3.99;
   
   else
   
      if (ins >= 501 && ins <= 2000)
      
         ins = 5.99;
      
      else
      
         ins = 10.99;
      
   
   if (pkgwght < 2)
   
      pkgwght = 1.1;
   
   else
   
      if (pkgwght >= 2 && pkgwght <= 6)
      
         pkgwght = 2.2;
      
      else
      
         if (pkgwght >= 6 && pkgwght <= 10)
         
            pkgwght = 3.7;
         
         else
         
            pkgwght = 3.8;
         
      
   
   cout << "\n\nThe Shipper is. " << shipper << endl;
   cout << "\n\nThe Recipient is. " << recipient << endl;
   total = pkgwght + ins;
   cout << "\n\nThe price to ship your package is." << total << endl;
"\n\n\n\n\n\n";
   system("pause");
   return 0;
}
Last edited on
Why are the receiver and sender's names doubles? Shouldn't they be strings?
Topic archived. No new replies allowed.