A Case Study Project : System Analysis and Design

Category: MCA Solved Syllabus    |       |    Add a Comment

A Student BCA final semester submits his project proposal to SOCIS, IGNOU, New Delhi. In a month’s time, he will receive communication from SOCIS about its approval. In case it is disapproved, student will be informed about the reason for its disapproval. In case it is approved, the student will be communicated about the same. After the student receives approval letter, he can submit project report to SR&E, IGNOU, New Delhi, which will inform the student about the schedule of project viva to the student in due course. Then, the student attends for project viva and waits for the Grade Card from IGNOU, which contains the result of his/her Project Work.

Students are required to study this problem and suggest the appropriate mechanism for computerizing the operation. The computerization should be in such a way that IGNOU can attend to the queries of the student regarding the receipt of project proposal, Approval/Disapproval of Project proposal, Receipt of Project Report and Schedule of Project Viva.

You should do the project as indicated below:

i) Design several levels of DFDs.
ii) Suggest appropriate data structures, tables for each module.
iii) Identify the number of modules for computerization.
iv) Write the process logic for each module nearer to any programming language.
v) Suggest various input screens and validation checks for various types of input.
vi) Produce complete analysis and design document.

Share/Save/Bookmark

  • No Related Post

 

MCA Shell Programming

Category: MCA Solved Syllabus    |       |    Add a Comment

Question 2:  Write shell program for the following

a)      To remove from an ordered array all numbers that occurs more than  once.

b)      To check whether a string is palindrome or not.

c)      To sort the given list of numbers using bubble sort.

Ans :

Shell Programs to Remove duplicate members of a sorted/ordered array

# Shell Programs to Remove duplicate members of a sorted/ordered array

echo “Enter Total Numbers in the Array”

read tot

i=1

while [ $i  –le $tot ]

do

echo “Enter the Sorted ordered array number – $i”

read num$i

i=`expr $i + 1`

done

i=1

y=${num$i}

echo $y

i=2

flag=0

while [ $i  –le $tot ]

do

z=${num$i}

if [ $y –ne $z ]

then

flag=`expr $flag + 1`

sort$flag=$z

y=$z

fi

i= ‘expr $i + 1`

done

i=1

echo “Unique set of numbers”

while [ $i –le $flag ]

do

echo ${sort$i}

i=`expr $i + 1`

done

 

Shell Program for strings for Checking of Palindrome

# Shell Program for strings for Checking of Palindrome

echo “Enter a String to check for Palindrome “

read str

i=1

y=`expr  $str  |  wc  –c`

y=`expr  $y  –  1’

z=$y

echo “The Length of String $str = $y”

while  [ $y  –ne  0 ]

do

z=`expr  $str  |  cut  –c $i`

w=`expr $str | cut –c $y`

if [“$z” != “$w”]

then

echo “ The Given String  $str is not Palindrome”

y=0

else

i=`expr $i + 1’

y=`expr $y – 1`

fi

done

if [ “$z” ==”$w”]

then

echo “The Given String  $str is a Palindrome”

fi

Shell Programming – Bubble Sort

#  Shell Programming – Bubble Sort

echo “Enter Total Numbers to be sorted ”

read tot

i=1

while [ $i  – le  $tot ]

do

echo “Enter the Number $i   =  ”

read  nm$i

i=`expr $i  +  1`

done

m=1

while [ $m  –le  $tot ]

do

n= `expr  $m  +  i`

while [  $n  –le  $tot  ]

do

if  [  ${nm$m}  –gt  ${nm$n} ]

then

a=${nm$m}

nm$m=${nm$n}

nm$n=$a

fi

n=`expr $n + 1`

done

m=`expr $m + 1`

done

echo “ Listing of Sorted Array “

k=1

while [ $k  –le  $tot ]

do

echo “The sorted number $k is ${nm$k}”

k=`expr  $k  +  1`

done

Share/Save/Bookmark

  • No Related Post

 

Regular Expression

Category: MCA Solved Syllabus    |       |    Add a Comment

Question 1:  Write regular expressions for

·        A Set of strings including { d, abd, cd, abcd}

·        A Set of Strings of x’s, y’s and z’s

For example {xxx, xxy, xxz……….zzz}

Ans :   The regular expression for Set of strings including {d, abd, cd, abcd}can be written in two ways.

i)                     d | abd | cd | abcd

ii)                    (c | ab | abc )d | d

 

The required  regular expression for Set of  strings of x’s, y’s and z’s can also be written in two ways.

iii)                  [xyz][xyz][xyz] or [x-z][x-z][x-z]

iv)                  (x|y|z) (x|y|z) (x|y|z)

Share/Save/Bookmark

  • No Related Post

 

Addition of two very large floating numbers

Category: MCA Solved Syllabus    |       |    Add a Comment

Question 1:  Write a program in ‘C’ language to add very large floating-point numbers. The floating point numbers may be equal to maximum floating point number that is possible on your machine.

Ans :  Floats (Floating point numbers) are numbers with fractional parts i.e, with decimal or float point. The floats are typically represented as follows

            float bank_amt= 1.2345E7

The Mantissa is 1.2345 and Characteristic also called Exponent is 7.

Floats are stored in four bytes and are accurate to about seven significant digits and their exponentials range extends over the interval [E-37 to E+38].

Some times scientific or astronomical computation often requires a far greater range and accuracy than provided by single precision floats. The double precision floats (8 bytes) which are held accurately up to 15 figures and have range [E-307 to E+308].

ANSI C has another Float type called  long double  and are accurate to about 19 significant digits and their exponentials range extends over the interval [E-4931 to E+4932].

The  above program to add very large floating point can be written in following manner if the two inputs (in  floats) and their sum (in double) do not exceeds the limits mentioned  just before this para.

# include <stdio.h>

main()

{ float num1,num2;

double sum;

printf (“Enter Two Very large Floats in the permissible range\n”);

printf (“Enter first Float \n”);

scanf(‘%e”, &num1);

printf (“Enter Second Float \n”);

scanf(‘%e”, &num2);

sum = num1+num2;

printf (“The sum of  %e + %e = %le “, num1,num2,sum);

return 0;

}

General case Program : when the floats are really very large, even more than what is permissible by long double. That is when the exponents are greater than +4932 (the max allowed by long double) and are required to be added. The following C programs does it. It adds such numbers.

Salient Points of the program  :

·        The program takes the two very large floats as  string input  with 80 digits max permissible for each input.

·        It separates the Mantissa and exponents and stores separately in different strings for each number.

·        It normalises the mantissa of first number wrt to second number and adds the two mantissa separately.

·        The combined/added mantissa with the exponent of the second number is displayed as the required sum.

The Listing with adequate comments is in the box.

/* Program for Addition of two very large floating numbers. The Numbers may be larger than the permissible float/double numbers */

 #include<stdio.h>

# include<math.h>

# include <string.h>

# include <iostream.h>

# include <stdlib.h>

main ()

            {

            int len1=0,len2=0;

int len_mant_1=0,len_mant_2=0,len_mant=0;

/* 80 digits max  */

            char num1[80] =”";

            char num2[80] =”";

            char *num3=”eE”;

            char key, *mants1,*exp1,*mants2,*exp2;

   double mant;

/* Mantissa and Exponents are separated and stored separately in strings variables

mants1, exp1, mants2, exp2 respectively for the two numbers */

   printf(“\n\n\n”);

   printf(“| ————————————————————————–|\n”);

   printf(“| Enter Two very large Floating Point Numbers of 80 digits with exponentials |\n”);

   printf(“|   such as 1.23456788888E1234567 or 1.23444444444E+300001111     |\n”);

   printf(“| ————————————————————————–|\n”);

   printf(“\n\n”);

   printf(“Enter First Number  : “);

               gets(num1);

               printf(“Enter Second Number : “);

               gets(num2);

     mants1 = strtok(num1,num3);

             exp1 = strtok(NULL,num3);

             mants2 = strtok(num2,num3);

             exp2 = strtok(NULL,num3);

             printf (“\nAs per this program Your’s \n”);

             printf (“Number 1 -> mantissa  = %s….exponential = %s\n”,mants1,exp1 );

             printf (“Nember 2 -> mantissa  = %s….exponential = %s\n”,mants2,exp2 );

     printf (“\n\n\n”);

     printf (“—————Results——————-\n\n”);

            len_mant_1 = strlen(mants1);

            len_mant_2 = strlen(mants2);

/* len_mant is the number of required digits of mantissa and which shall be

equal to the largest value of both the mantissa, so minimum value is fixed

as per the input of user’s

*/

            if (len_mant_1 > len_mant_2)

                        len_mant = len_mant_1;

            else 

                        len_mant = len_mant_2;

/* Check for the validity of the Mantisaa and exponents.

            They should not be equal to zero . If so terminate the program. */

            if(atof(mants1) == 0 )

                        {

                        printf (“** Mantissa Part for First number is invalid **\n”);

                        printf (“** Program Terminated Re-run the program  **\n”);

                        goto stop;

                        }

            else if(atof(mants2) == 0 )

            {

                        printf (“** Mantissa Part for Second number is invalid **\n”);

                        printf (“** Program Terminated Re-run the program  **\n”);

                        goto stop;

            }

            /* Check whether the Exponential is zero */

                        else if(atol(exp1) == 0 )

            {

                        printf (“** Exponential Part for First number is invalid.**\n”);

                        printf (“** Program Terminated Re-run the program  **\n”);

                        goto stop;

            }

                        else if(atol(exp2) == 0 )

                        {

                        printf (“** Exponential Part for Second number is invalid.**\n”);

                        printf (“** Program Terminated Re-run the program  **\n”);

                        goto stop;

                        }

                        else;

 /* Normalise the exponentials with respect to exp2 i.e, the output will be

 Written with the eponential of second Number

 */

 {

            mant = atof(mants2)+atof(mants1)*(pow(10,(atol(exp1)-atol(exp2))));

          gcvt( mant, len_mant, mants1 );

 printf( “    Addition= number 1 + number 2  =  %sE%s \n”,mants1,exp2);

    printf (“\n\n\n”);

   printf( “< To quit type ‘q’ or ‘Q’ or to add more number press Any Other Key >”);

   key = getchar();

   if (key ==’q’ || key== ‘Q’)

               goto stop;

   else

               main ();

}stop:

            return 0;

            }

 

The following is the sum of the runouts of the programs.

 

Typical Out Put :

 | ———————————————————————————————-|| Enter Two very large Floating Point Numbers of 80 digits with exponentials   |

|       such as 1.23456788888E1234567 or 1.23444444444E+300001111            |

| ——————————————————————————————    -|

 Enter First Number      : 2.3333333E200001

 Enter Second Number :  1.1111111E200002

 As per this program Your’s

Number 1 -> mantissa  = 2.3333333  exponential = 200001

Number 1 -> mantissa  = 1.1111111  exponential = 200002

  —————Results——————-

    Addition= number 1 + number 2  =  1.3444444E200002

 < To quit type ‘q’ or ‘Q’ or to add more number press Any Other Key >Enter 

 ————————————————————————————————–

| ———————————————————————————————-|

| Enter Two very large Floating Point Numbers of 80 digits with exponentials   |

|       such as 1.23456788888E1234567 or 1.23444444444E+300001111            |

| ——————————————————————————————    -|

 Enter First Number      : 1.11E1234567890        

 Enter Second Number :  3.33E1234567890

 As per this program Your’s

Number 1 -> mantissa  =  1.11 exponential = 1234567890

Number 1 -> mantissa  = 3.33  exponential = 1234567890

  —————Results——————-

    Addition= number 1 + number 2  =  4.44E123456789

 < To quit type ‘q’ or ‘Q’ or to add more number press Any Other Key > Q 

Share/Save/Bookmark

  • No Related Post