রবিবার, ১৬ আগস্ট, ২০১৫

C programming project on caontact management system

C programming project on caontact management system

//a project on cantact management system

#include<stdio.h>

void view(void);
void input(void);
void help(void);

struct input
{
    char name[15];
    char phone[15];
    char email[15];
}
people[100];
int i;

main()
{
    system("cls");
    system("color f9");
    int n,j;

    printf("\n\n");
    printf("Welcome to hallo world");
   //Ripon das
    printf("Welcome to Contact Management system..\n");
    printf("----------------------------------------------------\n");
    printf("\nPlease enter 1 for add contact.\n");
    printf("Please enter 2 for view contact.\n");
    printf("Please enter 3 for HELP\n");
    printf("Please enter 4 for exit\n");
    printf("----------------------------------------------------\n");
    scanf("%d",&n);

    while(n!=4)
    {
        switch(n)
        {
        case 1:
            input();
            break;
        case 2:
           view();
            break;
        case 3:
            help();
            break;

        default:
            printf("You enter wrong number. Please try again......");
            getch();
            main();

        }
    }
}
//Prepared by: Ripon das, CSE, University of Barisal

void input(void)
{
    system("cls");
    int n,i;
    FILE *f1;
    f1=fopen("Record file.txt","a");
    printf("How many data do you want?");
    scanf("%d",&n);
    printf("Please enter the data of %d people:",n);
    for(i=0;i<n;i++)

    {
       printf("\nEnter name %d (should one word):",i+1);

       scanf("%s",people[i].name);
       printf("\nEnter Mobile Number:");
       scanf("%s",people[i].phone);
       printf("\nEnter E-mail:");
       scanf("%s",people[i].email);
       fprintf(f1,"\n Name %d is: %s",i+1,people[i].name);
    fprintf(f1,"\nPhone Number is: %s",people[i].phone);
    fprintf(f1,"\n E-mail is: %s",people[i].email);
    }
    fclose(f1);
   main();
}

void view(void)
{
    system("cls");
    char c;

    FILE *f1;

    f1=fopen("Record file.txt","r");
    while((c=getc(f1))!=EOF)
        printf("%c",c);

    fclose(f1);
    printf("\nEnter any key to continue.........");
    getch();
    main();

}


void help(void)
{
    char ch;

    FILE *f2;
    f2=fopen("help.txt","r");
    while((ch=getc(f2))!=EOF)
    printf("%c",ch);
    fclose(f2);
    printf("\n\n\nEnter any key to continue.....");
    getch();
    main();
}

বুধবার, ৫ আগস্ট, ২০১৫

C Programming Project of General calculator with extra features

C Programming Project of General calculator with extra features

//A program for using malti purpose that general calculating,interesr calculating, age calculating;

/*The program has three part 1.General Calcultion
2.Age Calculation
3.Interest Calculation*/

/*Program Authority:
    Ripon Chandra das
    Dept of Computer Science and Engineering
    University of Barisal.
Spervised by:
    Rahat Hossain Foysal
    Lecturer
    Dept of Computer Science and Engineering
    University of Barisal.*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
//gencal is a subfunction used for general calculator
//agecal is a subfunction used for age calculation
//incal is a subfunction used for interest calculating
void gencal(void);
void agecal(void);
void incal(void);
int main()
{
    char n;//n for while statement
  system("color 2f");
  system("cls"); //24 symbol of green background and red letter
  //character type declaretion for switch atatement
  char ch;
   printf(".................WELCOME TO THE RIPON CHANDRA DAS'S HALLO WORLD.................\n");
    printf("                                 ******************\n");
    printf("                                  *              *\n");
    printf("                    ****************  MULTI-CAL ****************\n");
    printf("                                  *              *\n");
    printf("                                 ******************\n");
   //do...while statement use for continuing the program rpeatly
  do
 //switch statement use for the purpose of multi funct
  {
      system("color 2f");
 printf("\n\nPlease enter your choice\n");
 printf("\nEnter 1 for General Calculator\n");
 printf("Enter 2 for Age Calculator\n");
 printf("Enter 3 for Interest Calculator");
 ch=getche();
 switch(ch)
 {
    case '1':
        gencal(); //gencal () is used for general calculator
        break;
    case '2':
        agecal(); //agecal is used for age calculation
        break;
    case '3':
        incal();  //incal is used for interest calculator
        break;
    default:
        printf("\nYou enter a wrong number.\n Please try again.\n");
        break;
 }
    printf("\nPlease enter a value except 0 to run the program again.");
 n=getche();
  }

  while(n!=0);
  getch();
}
void add(void);
void sub(void);
void mul(void);
void div(void);
void sq(void);
void gencal(void)
{
 system("color 3f");
 system("cls");//30 for aqua light white
 char i;
    char p; //i for while statement and p for switch statement
    printf("\n This is General Calculator\n");
    do
    {
    printf("\nPlease enter 1 for Addition\n");
    printf("Please enter 2 for Subtraction\n");
    printf("Please enter 3 for Multiplication\n");
    printf("Please enter 4 for Divition\n");
    printf("Please enter 5 for Square Root");
    printf("\nEnter 6 for main menu");
    p=getche();
    //switch statement use for the purpose of multi function calling
    switch(p)
    {
    case '1':
        add();//called a function for addition
        break;
    case '2':
        sub();//called a function for subtraction
        break;
    case '3':
        mul();//called a function for multiplication
        break;
    case '4':
        div();//called a function for divition
        break;
    case '5'://called a square root sub function
        sq();
        break;
    case '6':
        main();
        break;
    default:
        printf("\nYou enter a wrong number.");
        break;
    }
    printf("\n Enter 0 to run General Calculator again.");
    i=getche();
    }
    while(i=0);
}
void add(void)
{
    system("color 81");//81 for gray blue
     system("cls");
    double a,b,sum;
        printf("Welcome to the addition calculating:\n");
        printf("Please enter a number:");
        scanf("%lf",&a);
        printf("Enter another number:");
        scanf("%lf",&b);
        sum=a+b;
          printf("The summation is:%lf\n\n",sum);
}
void sub(void)
{
    system("color 5b"); //5b stands for purple light aqua
     system("cls");
    double a,b,sum;
        printf("  Welcome to the subtraction calculating:\n");
        printf("Please enter a number:");
        scanf("%lf",&a);
        printf("Enter another number:");
        scanf("%lf",&b);
        sum=a-b;
          printf("The subtraction is:%lf\n\n",sum);
}
void mul(void)
{
    system("color 71");//71 for white blue
     system("cls");
    double a,b,sum;
        printf("  Welcome to the multiplication calculating:\n");
        printf("Please enter a number:");
        scanf("%lf",&a);
        printf("Enter another number:");
        scanf("%lf",&b);
        sum=a*b;
        printf("The multiplication is:%lf\n\n",sum);
}
void div(void)
{
    system("color 34");//34 for aqua red
     system("cls");
    double a,b,sum;
        printf("  Welcome to the divition calculating:\n");
        printf("Please enter a number:");
        scanf("%lf",&a);
        printf("Enter another number:");
        scanf("%lf",&b);
        sum=a/b;
        printf("The divition is:%lf\n\n",sum);
}
void sq(void)
{
    system("color 3a");//3a for aqua light green
     system("cls");
    int i;
    float j;
    printf("\n\nSquare Root Calculation:");
    printf("\nEnter a number:");
    scanf("%d",&i);
    j=sqrt(i);
    printf("\nSquare Root is:%f",j);
}
void agecal(void)
{
    system("color c7");//c7 for light red white
     system("cls");
printf("\nAge Identifier:\n");
    int day,month,year,day1,month1,year1,day2,month2,year2;
    printf("\nPlease enter value of birth day:");
    scanf("%d",&day);
    printf("Please enter value of birth month:\n");
    scanf("%d",&month);
    printf("Please enter value of birth year:\n");
    scanf("%d",&year);
    printf("Please enter value of present date(day):\n");
    scanf("%d",&day1);
    printf("Please enter value of present month:\n");
    scanf("%d",&month1);
    printf("Please enter value of present year:\n");
    scanf("%d",&year1);
    if(day<day1){
        day2=day1-day;
    }
    else{
        day2=(day1+30)-day;
        month=month+1;

    }
    if(month<month1){
        month2=month1-month;
    }
    else{
        month2=(month1+12)-month;
        year=year+1;
    }
    year2=year1-year;
    printf("Age is:%d year %d month %d day\n\n",year2,month2,day2);
}
void incal(void)
{
    system("color e1");//e1 for light yellow blue
     system("cls");
int  amount,year,month,i;
    double interest,m,y,t_am;
    printf("\n This is  Interest Calculator\n");
    printf("If interest is inturms of month press 1.\nIf interest is inturms of year press 2.");
    scanf("%d",&i);
    //here uses if else cnditional statement for display two another purpos
    if(i==1){
        printf("Enter the amount:");
        scanf("%d",&amount);
        printf("Enter the value of percentage of monthly interest:");
        scanf("%lf",&interest);
        printf("Enter the month:");
        scanf("%d",&month);
        printf("Enter the year:");
        scanf("%d",&year);
        m=(amount*interest*month)/100;
        printf("Monthly total interest=%lf\n",m);
        y=(12*year*interest*amount)/100;
        printf("Yearly total interest=%lf\n",y);
        t_am=amount+m+y;
        printf("Total amount=%lf\n\n",t_am);
    }
    else if(i==2){
         printf("Enter the amount:");
        scanf("%d",&amount);
        printf("Enter the value of percentage of yearly interest:");
        scanf("%lf",&interest);
        printf("Enter the month:");
        scanf("%d",&month);
        printf("Enter the year:");
        scanf("%d",&year);
        m=(amount*(interest/12)*month)/100;
        printf("Monthly total interest=%lf\n",m);
        y=(amount*year*interest)/100;
        printf("Yearly total interest=%lf\n",y);
        t_am=amount+m+y;
        printf("Total amount=%lf\n\n",t_am);
    }
}

প্রোগ্রামিং এ হাতেখরি

প্রোগ্রামিং একটা রোমান্টীক জগত। তাই যারা এর অনুভুতি ফিল করতে পারে তারাই প্রোগ্রামার হতে পারে। প্রোগ্রামিং এ বিরক্তি অনিহা থাকলে কখনই প্রোগ্রামার হওয়া যায় না। আই সি টির প্রসারের সাথে সাথে প্রোগ্রামিং ও খুব চ্যালেঞ্জিং হয়ে গেছে। তাই এই যুগে ভাল প্রগ্রামার হতে হলে বাস্তবমুখি পদক্ষেপ নেয়ার কোন বিকল্প নেই। চ্যালেঞ্জে টিকে থাকতে হলে আমাদেরই উদ্যোগ নিতে হবে। প্রোগ্রামিং পরীক্ষাও তাই কঠিন হয়ে যাচ্ছে। কালকের পরীক্ষা শেষে অনেকের সরি ফিগার যা বলে তাতে প্রগ্রামিং এ ততটা বাস্তবমুখি নই আমরা যতটা প্রশ্ন বাস্তবমুখি ছিল। প্রগ্রামিং এর সবচেয়ে কমন প্রক্রিয়া প্রোগ্রামিং কনটেস্ট বেশি বেশি আয়োজন করার মাধ্যমেই এই সমস্যা থেকে উত্তোরন করা সম্ভব। https://www.facebook.com/cse.barisaluniv.edu