Sunday, March 22, 2015

Artificial intelligence module I and Module 2 :

 Module 1 Contains following chapters:
  1.  Problem spaces, Production rules and Control Strategies  click to view/download
  2. Problem space and search techniques                               Click to download/view

 NOTE: SOME TOPICS FROM 1ST CHAPTER ARE NOT COVERED. PROBLEM REDUCTION ALGORITHM, AO* ALGORITHM AND MEAN END ANALYSIS  TO BE REFEREED FROM CLASS NOTES.




Module 2 contains following chapters:

  1. knowledge representation issues
  2. predicate logic                              download/view presentation
  3. weak slot and filler structures       click to download
  4. strong slot and filler structures
  5. reasoning under uncertainty
  6. statistical reasoning

 

Friday, July 27, 2012

CODE FOR SIMPLE CALCULATOR PROGRAM USING STRUCTURES IN C FOR SE IT STUDENTS


#include <stdio.h>
#include <stdlib.h>

struct calc
{
   int val1;
   int val2;
   int sum,sub;
   float multi;    
};

void add(struct calc *cptr,int p,int q)
{
     cptr->val1=p;
   
     cptr->val2=q;
   
     cptr->sum=(cptr->val1)+(cptr->val2);
     printf("THE SUM OF %d and %d IS:\t %d",p,q,(cptr->sum));
   
 }

 void mul(struct calc *cptr,int p,int q)
{
     cptr->val1=p;
     cptr->val2=q;
     float p1=(float)cptr->val1;
     float p2=(float)cptr->val2;
   
     float multi=p1*p2;
     printf("THE PRODUCT OF %d and %d IS:\t %f",p,q,multi);
   
 }

 void sub(struct calc *cptr,int p,int q)
{
     cptr->val1=p;
     cptr->val2=q;
   
     int sub=(cptr->val1)-(cptr->val2);
     printf("THE SUBTRACTION OF %d and %d IS:\t %d",p,q,sub);
   
 }


void main()
{
    int ch,v1,v2;
    struct calc c;
    void add(struct calc*,int,int);
    void mul(struct calc*,int,int);
    void sub(struct calc*,int,int);
    while(1)
    {
            printf("\n\nPLEASE SELECT ONE OF THE OPTIONS:\n");
            printf("1.ADDITION\n");
            printf("2.MULTIPLICATION\n");
            printf("3.SUBTRACTION\n");
            printf("4.EXIT\n\n");
         
            scanf("%d",&ch);
         
            switch(ch)
            {
                      case 1:
                           printf("ADDITION:\t PLEASE ENTER THE TWO VALUES TO BE ADDED\n\t");
                           scanf("%d %d",&v1,&v2);
                           add(&c,v1,v2);
                           break;
                      case 2:
                           printf("MULTIPLICATION:\t PLEASE ENTER THE TWO VALUES TO BE MULTIPLIED\n\t");
                           scanf("%d %d",&v1,&v2);
                           mul(&c,v1,v2);
                           break;
                      case 3:
                           printf("SUBTRACTION:\t PLEASE ENTER THE TWO VALUES TO BE SUBTRACTED\n\t");
                       
                       
                           scanf("%d %d",&v1,&v2);
                           sub(&c,v1,v2);
                           break;
                      case 4:
                           exit(1);
                      default:
                              printf("PLEASE ENTER VALID VALUES ONLE (1 TO 4)\n\t");
                           
                         
            }
         
}

}