Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
10 kB
1
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

int main(){
    int opt;
    double Listening,Reading,Writing,Speaking,avg,inavg;
    cout<<"1. Academic\n2. General Training"<<endl;
    cout<<"Select a option: ";
    cin>>opt;
    cout<<endl;

    //Academic Score
    if(opt==1){
        cout<<"Welcome to Academic IELTS Band Calculator"<<endl;
        cout<<"1.Band Score based \n2.Score based"<<endl;
        cout<<"Select an option: ";
        cin>>opt;
        cout<<endl;

        //Band Score Based
        if(opt==1){
            cout<<"\tBand Score Based Calculator"<<endl;
            cout<<"Listening: ";
            cin>>Listening;
            cout<<"Reading: ";
            cin>>Reading;
            cout<<"Writing: ";
            cin>>Writing;
            cout<<"Speaking: ";
            cin>>Speaking;
            avg=(Listening+Reading+Writing+Speaking)/4;
            
            if(avg>int(avg)){
                inavg=avg-int(avg);
                if(inavg<=0.2499){
                    avg=avg-inavg;
                }
                else if(inavg>=0.25 && inavg<=0.4999){
                    avg=int(avg)+0.50;
                }
                else if(inavg>=0.51 && inavg<=0.999){
                    avg=int(avg)+1;
                }
                cout<<"Overall Band: "<<avg<<endl;
            }
        }

        //Score Based(1-40)
        if(opt==2){
            cout<<"\tScore Based Calculator"<<endl;
            cout<<"Listening: ";
            cin>>Listening;
            cout<<"Reading: ";
            cin>>Reading;
            cout<<"Writing: ";
            cin>>Writing;
            cout<<"Speaking: ";
            cin>>Speaking;

            if(Listening>=4 && Listening<=5 ){
                Listening=2.5;
            }
            else if(Listening>=6 && Listening<=7 ){
                Listening=3;
            }
            else if(Listening>=8 && Listening<=9 ){
                Listening=3.5;
            }
            else if(Listening>=10 && Listening<=12 ){
                Listening=4;
            }
            else if(Listening>=13 && Listening<=14 ){
                Listening=4.5;
            }
            else if(Listening>=15 && Listening<=18 ){
                Listening=5;
            }
            else if(Listening>=19 && Listening<=22 ){
                Listening=5.5;
            }
            else if(Listening>=23 && Listening<=26 ){
                Listening=6;
            }
            else if(Listening>=27 && Listening<=29 ){
                Listening=6.5;
            }
            else if(Listening>=30 && Listening<=32 ){
                Listening=7;
            }
            else if(Listening>=33 && Listening<=34 ){
                Listening=7.5;
            }
            else if(Listening>=35 && Listening<=36 ){
                Listening=8;
            }
            else if(Listening>=37 && Listening<=38 ){
                Listening=8.5;
            }
            else if(Listening>=39 && Listening<=40 ){
                Listening=9;
            }
            //for Reading module
            if(Reading>=4 && Reading<=5 ){
                Reading=2.5;
            }
            else if(Reading>=6 && Reading<=7 ){
                Reading=3;
            }
            else if(Reading>=8 && Reading<=9 ){
                Reading=3.5;
            }
            else if(Reading>=10 && Reading<=12 ){
                Reading=4;
            }
            else if(Reading>=13 && Reading<=14 ){
                Reading=4.5;
            }
            else if(Reading>=15 && Reading<=18 ){
                Reading=5;
            }
            else if(Reading>=19 && Reading<=22 ){
                Reading=5.5;
            }
            else if(Reading>=23 && Reading<=26 ){
                Reading=6;
            }
            else if(Reading>=27 && Reading<=29 ){
                Reading=6.5;
            }
            else if(Reading>=30 && Reading<=32 ){
                Reading=7;
            }
            else if(Reading>=33 && Reading<=34 ){
                Reading=7.5;
            }
            else if(Reading>=35 && Reading<=36 ){
                Reading=8;
            }
            else if(Reading>=37 && Reading<=38 ){
                Reading=8.5;
            }
            else if(Reading>=39 && Reading<=40 ){
                Reading=9;
            }

            avg=(Listening+Reading+Writing+Speaking)/4;
            
            if(avg>int(avg)){
                inavg=avg-int(avg);
                if(inavg<=0.2499){
                    avg=avg-inavg;
                }
                else if(inavg>=0.25 && inavg<=0.4999){
                    avg=int(avg)+0.50;
                }
                else if(inavg>=0.51 && inavg<=0.999){
                    avg=int(avg)+1;
                }
                cout<<"Overall Band: "<<avg<<endl;
            }
            
        }
        if(!"1"|| !"2"){
            cout<<"Please select a correct option"<<endl;
        }

        cout<<endl;
    }

    //General Training
    else if(opt==2){

        cout<<"Welcome to General Training IELTS Band Calculator"<<endl;
        cout<<"1.Band Score based \n2.Score based"<<endl;
        cout<<"Select an option: ";
        cin>>opt;
        cout<<endl;

        //Band Score Based
        if(opt==1){

            cout<<"\tBand Score Based Calculator"<<endl;
            cout<<"Listening: ";
            cin>>Listening;
            cout<<"Reading: ";
            cin>>Reading;
            cout<<"Writing: ";
            cin>>Writing;
            cout<<"Speaking: ";
            cin>>Speaking;
            avg=(Listening+Reading+Writing+Speaking)/4;
            
            if(avg>int(avg)){
                inavg=avg-int(avg);
                if(inavg<=0.2499){
                    avg=avg-inavg;
                }
                else if(inavg>=0.25 && inavg<=0.4999){
                    avg=int(avg)+0.50;
                }
                else if(inavg>=0.51 && inavg<=0.999){
                    avg=int(avg)+1;
                }
                cout<<"Overall Band: "<<avg<<endl;
            }
        }

        //Score Based(1-40)
        if(opt==2){

            cout<<"\tScore Based Calculator"<<endl;
            cout<<"Listening: ";
            cin>>Listening;
            cout<<"Reading: ";
            cin>>Reading;
            cout<<"Writing: ";
            cin>>Writing;
            cout<<"Speaking: ";
            cin>>Speaking;

            if(Listening>=4 && Listening<=5 ){
                Listening=2.5;
            }
            else if(Listening>=6 && Listening<=7 ){
                Listening=3;
            }
            else if(Listening>=8 && Listening<=9 ){
                Listening=3.5;
            }
            else if(Listening>=10 && Listening<=12 ){
                Listening=4;
            }
            else if(Listening>=13 && Listening<=14 ){
                Listening=4.5;
            }
            else if(Listening>=15 && Listening<=18 ){
                Listening=5;
            }
            else if(Listening>=19 && Listening<=22 ){
                Listening=5.5;
            }
            else if(Listening>=23 && Listening<=26 ){
                Listening=6;
            }
            else if(Listening>=27 && Listening<=29 ){
                Listening=6.5;
            }
            else if(Listening>=30 && Listening<=32 ){
                Listening=7;
            }
            else if(Listening>=33 && Listening<=34 ){
                Listening=7.5;
            }
            else if(Listening>=35 && Listening<=36 ){
                Listening=8;
            }
            else if(Listening>=37 && Listening<=38 ){
                Listening=8.5;
            }
            else if(Listening>=39 && Listening<=40 ){
                Listening=9;
            }
            //for Reading module
            if(Reading>=4 && Reading<=5 ){
                Reading=2.5;
            }
            else if(Reading>=6 && Reading<=7 ){
                Reading=3;
            }
            else if(Reading>=8 && Reading<=9 ){
                Reading=3.5;
            }
            else if(Reading>=10 && Reading<=12 ){
                Reading=4;
            }
            else if(Reading>=13 && Reading<=14 ){
                Reading=4.5;
            }
            else if(Reading>=15 && Reading<=18 ){
                Reading=5;
            }
            else if(Reading>=19 && Reading<=22 ){
                Reading=5.5;
            }
            else if(Reading>=23 && Reading<=26 ){
                Reading=6;
            }
            else if(Reading>=27 && Reading<=29 ){
                Reading=6.5;
            }
            else if(Reading>=30 && Reading<=32 ){
                Reading=7;
            }
            else if(Reading>=33 && Reading<=34 ){
                Reading=7.5;
            }
            else if(Reading>=35 && Reading<=36 ){
                Reading=8;
            }
            else if(Reading>=37 && Reading<=38 ){
                Reading=8.5;
            }
            else if(Reading>=39 && Reading<=40 ){
                Reading=9;
            }

            avg=(Listening+Reading+Writing+Speaking)/4;
            
            if(avg>int(avg)){
                inavg=avg-int(avg);
                if(inavg<=0.2499){
                    avg=avg-inavg;
                }
                else if(inavg>=0.25 && inavg<=0.4999){
                    avg=int(avg)+0.50;
                }
                else if(inavg>=0.51 && inavg<=0.999){
                    avg=int(avg)+1;
                }
                cout<<"Overall Band: "<<avg<<endl;
            }
        }
        else{
            cout<<"Please select a correct option"<<endl;

        }
        cout<<endl;
    }

    //Final option
    else{
        cout<<"Please select a valid option"<<endl;
        cout<<"\tTry again...."<<endl;
    }

    cout<<"Developed by @debanjan_dibya"<<endl;
    return 0;
}
Leave a Comment