Hi guys I am suppose to write a program that asks for the weight of the package and the distance it is to be shipped and then displays the charges. I pretty much got every down except i dont know how to make the program terminate after line 12 if the weight isnt in the right range, terminate after line 17 if the distance isnt in the right range. For example if the weight is 21, I want it to just say "We only accept packages between 1 to 20 kg." and the program stops without going any further. Please help!

Code:
#include<iostream>
#include<iomanip>
using namespace std;
                
int main()
{
        float weight, distance, rate, shipcharge;
                        
        cout << "Enter the weight of the package(in kg):";  
        cin >> weight;
        if (weight < 0 || weight > 20)
                cout << "We only accept packages between 1 to 20 kg.";
        else
                cout << "Enter the distance to be shipped(in miles):";
        cin >> distance;
        if (distance < 10 || distance > 3000) 
                cout << "We only ship between 10 to 3000 miles.";
        if (weight <= 2)
        {
                if (distance < 501)
                        shipcharge = 1.10 * 1;
                else if (distance >= 501 && distance < 1001)
                        shipcharge = 1.10 * 2;
                else if (distance >= 1001 && distance < 1501)
                        shipcharge = 1.10 * 3;
                else if (distance >= 1501 && distance < 2001)
                        shipcharge = 1.10 * 4;
                else if (distance >= 2001 && distance < 2501)
                        shipcharge = 1.10 * 5;
                else if (distance >= 2501 && distance <= 3000)
                        shipcharge = 1.10 * 6;
        }       
        else if (weight > 2 && weight <= 6)
        {
                if (distance < 501)
                        shipcharge = 2.20 * 1;
                else if (distance >= 501 && distance < 1001)
                        shipcharge = 2.20 * 2;
                else if (distance >= 1001 && distance < 1501)
                        shipcharge = 2.20 * 3;
                else if (distance >= 1501 && distance < 2001)
                        shipcharge = 2.20 * 4;
                else if (distance >= 2001 && distance < 2501)
                        shipcharge = 2.20 * 5;
                else if (distance >= 2501 && distance <= 3000)   
                        shipcharge = 2.20 * 6;
        }
        else if (weight > 6 && weight <= 10)
        {
                if (distance < 501)
                        shipcharge = 3.70 * 1;
                else if (distance >= 501 && distance < 1001) 
                        shipcharge = 3.70 * 2;
                else if (distance >= 1001 && distance < 1501)
                        shipcharge = 3.70 * 3;
                else if (distance >= 1501 && distance < 2001)
                        shipcharge = 3.70 * 4;
                else if (distance >= 2001 && distance < 2501) 
                        shipcharge = 3.70 * 5;
                else if (distance >= 2501 && distance <= 3000)
                        shipcharge = 3.70 * 6;
        }
        else if (weight > 10 && weight <= 20)
        {
                if (distance < 501)
                        shipcharge = 4.80 * 1;
                else if (distance >= 501 && distance < 1001) 
                        shipcharge = 4.80 * 2;
                else if (distance >= 1001 && distance < 1501)
                        shipcharge = 4.80 * 3;
                else if (distance >= 1501 && distance < 2001)
                        shipcharge = 4.80 * 4;
                else if (distance >= 2001 && distance < 2501) 
                        shipcharge = 4.80 * 5;
                else if (distance >= 2501 && distance <= 3000)
                        shipcharge = 4.80 * 6;
        }
        cout << showpoint << setprecision(2) << fixed;
        cout << "The shipping charge is:" << shipcharge << endl;
        return 0;
}