Wednesday, December 2, 2020

Take 10 integer inputs from user and store them in an array. Again ask user to give a number. Now, tell user whether that number is present in array or not with Eaglesoft

 


#include<iostream>
using namespace std;
int main()
{
    int _input[10],c=0,n,i=0,f=0;
    
    // Take input from user
    while(c<10)
    {
        cout<<"Enter your Number "<<c+1<<" : "<<endl;
        cin>>_input[c];
        c++;
    }
    // Take test of programmer
    cout<<"Hello Programmer we are going to take a test of your knowledge"<<endl;
    cout<<"Enter a value to guess that are present in array input or not"<<endl;
    cin>>n;
    while(i<10)
    {
        if(n==_input[i])
        f=1;
        i++;
    }
    if(f==1)
    cout<<"Great you are smart programmer"<<endl;
    else
    {
        cout<<"Sorry programmer try again after drinking a cup of tea"<<endl;
    }
    // Show output that are store in an array 
    // int k=0;
    // while(k<10)
    // {
    //     cout<<"Your entered "<<k+1<<"number is: "<<_input[k]<<endl;
    //     k++;
    // }
    cout<<"*********This is Eaglesoft programmer*********"<<endl;
    return 0;
}

Tuesday, December 1, 2020

Find IP address of any website by using python with Eaglesoft


import socket as s
my_hostname=s.gethostname()
print("Your host name is:" + my_hostname)
my_ip=s.gethostbyname(my_hostname)
print("Your ip adress is: "+ my_ip)
webhost="google.com"
web_ip=s.gethostbyname(webhost)
print("IP adress of "+webhost+ " is :"+web_ip) 

Friday, November 27, 2020

Find prime number from 0 to 100

 #include<iostream>

#include<cmath>
using namespace std;
int main()
{

    for(int i=2;i<100;i++)
    {
        int s=1;
       for(int j=2;j<sqrt(i);j++)
       {
           if(i%j==0)
           {
               s=0;
              break;
           }
         }
    if(s==1)
    cout<<" "<<i;
    }
cout<<endl<<"This is Eaglesoft Programmer";
return 0;
}

Monday, November 23, 2020

Assignment of CS201

 #include<iostream>

using namespace std;
int main()
{
    int no_emplyes=10,sal_level_a=125000,sal_level_b=80000,sal_level_c=45000;
    int tax_level_a,tax_level_b,tax_level_c,total_tax_level_a,total_tax_level_b,total_tax_level_c;
    int net_sal_level_a,net_sal_level_b,net_sal_level_c,total_pay;
    int anual_sal_level_a,anual_sal_level_b,anual_sal_level_c;
    int wal_fund=600,total_tax;
    int total_walfare=no_emplyes*wal_fund;
    int opt;
    
    anual_sal_level_a=sal_level_a*12;
    anual_sal_level_b=sal_level_b*12;
    anual_sal_level_c=sal_level_c*12;

    if(anual_sal_level_a>600000){
        tax_level_a=sal_level_a*1/100;
    }
    else
    {
        tax_level_a=0;
    }
    total_tax_level_a=tax_level_a*2;

    if(anual_sal_level_b>600000){
        tax_level_b=sal_level_b*1/100;
    }
    else
    {
        tax_level_b=0;
    }
    total_tax_level_b=tax_level_b*3;

    if(anual_sal_level_c>600000){
        tax_level_c=sal_level_c*1/100;
    }
    else
    {
        tax_level_c=0;
    }
    total_tax_level_c=tax_level_c*5;

    total_tax=total_tax_level_a+total_tax_level_b+total_tax_level_c;

    net_sal_level_a=sal_level_a-tax_level_a-wal_fund;
    net_sal_level_b=sal_level_b-tax_level_b-wal_fund;
    net_sal_level_c=sal_level_c-tax_level_c-wal_fund;
    total_pay=net_sal_level_a+net_sal_level_b+net_sal_level_c;

    //Output
    cout<<"The amout of tax that detect for all employess: "<<total_tax<<endl;
    cout<<"Total amount of welfare fund collected each month from all employees: "<<total_walfare<<endl;
    cout<<"Net monthly salary of lavel A employess: "<<net_sal_level_a<<endl;
    cout<<"Net monthly salary of lavel B employess: "<<net_sal_level_b<<endl;
    cout<<"Net monthly salary of lavel C employess: "<<net_sal_level_c<<endl;
    cout<<"Total amount which organization pays to its employees each month: "<<total_pay<<endl;

    //Menu
    cout<<"Enter 1 to know the tax collect of level A employess"<<endl;
    cout<<"Enter 2 to know the tax collect of level B employess"<<endl;
    cout<<"Enter 3 to know the tax collect of level C employess"<<endl;
    cin>>opt;

    if(opt==1){
        cout<<"Tax collect of level A employess is: "<<total_tax_level_a<<endl;
    }
    else if(opt==2){
        cout<<"Tax collect of level B employess is: "<<total_tax_level_b<<endl;
    }
    else if(opt==3){
        cout<<"Tax collect of level C employess is: "<<total_tax_level_c<<endl;
    }
    else
    {
        cout<<"Invaild input"<<endl;
    }
    
    




 
    return 0;
}

Thursday, November 19, 2020

c++ course source code

 #include <iostream>

//using namespace std;

int main(){

std::cout<<"welcome to eaglesoft";

cout<<"it will not come ";

return 0;

}

Wednesday, November 18, 2020

Collect Email from text full source code in python.

import re
txt="Muhammad Ashfaq is the Programmer of of this code his email
 is yahooashfaq@gmail.com and he write this code for
 eaglesoft.pk@gmail.com with the help of Ansir ali 
ansar.eaglesoft@gmail.com and Saif Ali Khan saif.eaglesoft@gmail.com"
# print(txt)
findEmail=re.findall(r'[\w\.-]+@[\w\.-]+',txt)
#print Email in list
print(findEmail)
#print email
for l in findEmail:
    print(l)