0% found this document useful (0 votes)
188 views49 pages

Bca Semester-II 2023-24 (1) 2

Uploaded by

kimberlyeric009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views49 pages

Bca Semester-II 2023-24 (1) 2

Uploaded by

kimberlyeric009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 49

BACHELOR OF COMPUTER

APPLICATIONS
(BCA)

(Revised Syllabus)

BCA(Revised Syllabus)/ASSIGN/SEMESTER-II

ASSIGNMENTS

(July - 2023 & January - 2024)

ECO-02, MCS-011, MCS-012, MCS-015, MCS-013, BCSL-021, BCSL-022,

SCHOOL OF COMPUTER AND INFORMATION


SCIENCES INDIRA GANDHI NATIONAL OPEN
UNIVERSITY MAIDAN GARHI, NEW DELHI – 110 068

1
CONTENTS

Course Code Assignment No. Submission-Schedule Page


No.

For July- For January-


December Session June Session

ECO-02 BCA(II)/02/Assignment/23-24 31st October, 2023 30th April, 2024 3

MCS-011 BCA(II)/011/Assignment/23-24 31st October, 2023 30th April, 2024 5

MCS-012 BCA(II)/012/Assignment/23-24 31st October, 2023 30th April, 2024 7

MCS-015 BCA(II)/015/Assignment/23-24 31st October, 2023 30th April, 2024 11

MCS-013 BCA(II)/013/Assignment/23-24 31st October, 2023 30th April, 2024 16

BCSL-021 BCA(II)/L-021/Assignment/23-24 31st October, 2023 30th April, 2024 19

BCSL-022 BCA(II)/L-022/Assignment/23-24 31st October, 2023 30th April, 2024 20

Important Notes
1. Submit your assignments to the Coordinator of your Study Centre on or before the due
date.
2. Assignment submission before due dates is compulsory to become eligible for appearing
in corresponding Term End Examinations. For further details, please refer to BCA
Programme Guide.
3. To become eligible for appearing the Term End Practical Examination for the lab
courses, it is essential to fulfill the minimum attendance requirements as well as
submission of assignments (on or before the due date). For further details, please refer to
the BCA Programme Guide.

2
Course Code : ECO-02
Course Title : Accountancy-1
Assignment Number : BCA (II)/02/Assignment/2023-24
Maximum Marks : 100
Weightage : 25%
Last Dates for Submission : 31st October, 2023 (For July Session)
: 30th April, 2024 (For January Session)

There are six questions in this assignment which carried 100 marks. Answer all the
questions. Please go through the guidelines regarding assignments given in the Program
Guide for the format of presentation.

Attempt all the questions:

Q1. Define accounting and explain its scope, objectives advantages and limitations. (20)

Q2. Write about the Bank Reconciniation Statement, what are the main causes of difference. (20)

Q3. Write notes on the following concepts: (4x5=20)

a) Going Concern Concept


b) Conservatism
c) Consistency
d) Materiality

Q4. Sohan drew on Mohan a bill for Rs. 1,500 for 3 months on June 1, 2023. The bill was endorsed to
Rohan. On July 15, Mohan approaches Sohan to renew the bill for a period of tree months and
charges Rs. As interest. Sohan agress to renew the bill. Mohan pays the amount of interest in cash
and accepts a new bill for Rs. 1,500. The bill is honoured on the due date. Record these
transactions in the books of various parties. (20)

Q5. From the following figures prepare Trading and Profit and Loss Account of Lakshmi & Co. for
the year ended December 31, 1987. (20)

Rs.
Stock on January 1, 1987 40,000
Purchases 98,000
Commission Received 650
Rent, Rates and Taxes 8,600
Salaries & Wages 12,000
Sales 1,62,100
Returns Inwards 2,400

3
Returns Outwards 3,000
Sunday Expenses 2,500
Bank Charges 50
Discount Received 750
Carriage on Purchases 2,000
Discount Allowed 530
Carriage on Sales 1,700
Lighting and Heating 2,200
Postage 300
Income from Investments 500
Commission Paid 1,000
Interest paid on a bank loan 550

The stock on December 31, 1987 was valued at Rs. 26,000.

4
Course Code : MCS-011
Course Title : Problem Solving and
Programming Assignment Number : BCA(II)/011/Assignment/2023-
24 Maximum Marks : 100
Weightage : 25%
Last Dates for Submission : 31st October, 2023 (For July Session)
30th April, 2024 (For January Session)

There are seven questions in this assignment, which carry 80 marks. Rest 20 marks are for
viva-voce. Answer all the questions. You may use illustrations and diagrams to enhance the
explanations. Please go through the guidelines regarding assignments given in the
Programme Guide for the format of presentation.

Q1. Write an algorithm, draw corresponding flow chart and write an interactive program which
prompts the user with the following options on the opening menu: (15)

1) To accept two integers and check whether they are equal or not
2) To check whether a given number is even or odd
3) To check whether a given number is a positive number or a negative number
4) Quit
Enter your choice:

Note: Use SWITCH..CASE statement.

Answer-

Algorithm:
1. Start: Display the opening menu with options 1 to 4 and "Quit."
2. Input: Prompt the user to enter their choice (1, 2, 3, or "Quit").
3. Decision: Use a switch-case statement to handle the user's choice:
o Case 1:
 Prompt the user to enter two integers.
 Compare the two integers using the equality operator (==).
 If equal, display "The numbers are equal."
 If not equal, display "The numbers are not equal."
o Case 2:
 Prompt the user to enter a number.
 Calculate the remainder after dividing the number by 2 using the modulo operator (%).
 If the remainder is 0, display "The number is even."
 If the remainder is not 0, display "The number is odd."
o Case 3:
 Prompt the user to enter a number.
 If the number is greater than 0, display "The number is positive."
 If the number is less than 0, display "The number is negative."
 Handle the special case of 0 by displaying "The number is zero." (Optional)
o Case "Quit":
 Display a farewell message (optional) and exit the program.

5
o Default Case (optional):
 Handle invalid user input by displaying an error message and prompting them to enter a
valid choice. This case can enhance robustness.
4. Repeat: Go back to step 1 to continue offering choices until the user chooses "Quit."
5. End: Exit the program.

6. Flowchart:
7. +-------------------+

8. | Start |

9. +-------------------+

10. v

11. +-------------------+

12. | Display Menu (1-4) |

13. | Quit |

14. +-------------------+

15. v

16. +-------------------+

17. | Input Choice |

18. +-------------------+

19. v

20. +-------------------+

21. | Choice = 1, 2, 3 | (Yes)

22. +-------------------+

23. v

24. +-------------------+

25. | Switch-Case |

26. +-------------------+

27. v

28. (Case 1) |

29. +-------------------+ | (No)

30. | Input Integers | -------->+-------------------+

6
31. +-------------------+ | Default Case |

32. v +-------------------+

33. +-------------------+ | (Handle invalid input)

34. | Compare Numbers | v

35. +-------------------+ +-------------------+

36. v | Choice = "Quit" |

37. (If equal) +-------------------+ (Yes)

38. +-------------------+ v

39. | Display "Equal" | +-------------------+

40. +-------------------+ | Farewell Message |

41. v +-------------------+

42. (If not equal) + v (Exit program)

43. +-------------------+ +-------------------+

44. | Display "Not Eq." |

45. +-------------------+

46. v

47. (Case 2, 3 similar)

48. +-------------------+

49. | End |

50. +-------------------+

51. Interactive Program (C++):


52. C++
53. #include <iostream>

54.

55. using namespace std;

56.

57. int main() {

58. int choice, num1, num2, number;

59.
7
60. do {

61. // Display menu

62. cout << "\nMenu:\n";

63. cout << "1. Check if two integers are equal\n";

64. cout << "2. Check if a number is even or odd\n";

65. cout << "3. Check if a number is positive, negative, or zero\n";

66. cout << "4. Quit\n";

67. cout << "Enter your choice: ";

68. cin >> choice;

69.

70. switch (choice) {

71. case 1:

72. cout << "Enter two integers: ";

73. cin >> num1 >> num2;

74. if (num1 == num2) {

75. cout << "The numbers are equal.\n";

76. } else {

77. cout << "The numbers are not equal.\n";

78. }

79. break;

80. case 2:

81. cout << "Enter a number: ";

82. cin >> number;

83. if (number % 2 == 0) {

84. cout << "The number is even.\n";

85. } else {

86. cout << "The number is odd.\n";

87. }

8
88. break;

89. case 3:

Q2. Write the functions in C for the following: (9)


(a) To find the square of any number.
Answer-
Language - C
int square(int num) {
return num * num;
}

(b) 1. Square of a Number:

Answer-
Language - C
int square(int num) {
return num * num; // Efficiently calculate the square using multiplication
}

(c) To find the absolute difference between two integers.


Answer-
Language - C
int absDiff(int num1, int num2) {
int difference;
if (num1 > num2) {
difference = num1 - num2; // Return positive difference if num1 is larger
} else {
difference = num2 - num1; // Return positive difference if num2 is larger
}
return difference;
}

(d) To convert a decimal number to its equivalent binary number.


Answer-
Language - C
void decimalToBinary(int num) {
if (num == 0) {
return; // Base case: For 0, print nothing
}
decimalToBinary(num / 2); // Recursive call for the quotient
cout << num % 2; // Print the remainder (0 or 1) in reverse order
}

9
(e) To find the largest element in a given array of n elements.
Answer-
Language - C

int findLargest(int arr[], int size) {


int largest = arr[0]; // Initialize with the first element
for (int i = 1; i < size; i++) {
if (arr[i] > largest) {
largest = arr[i];
}
}
return largest;
}

Q3. Write an interactive program using recursion for each of the following: (12)
(a) To count the digits of a given number.

#include <iostream>

using namespace std;

// Function to count digits of a number recursively


int countDigits(int num) {
if (num == 0) {
return 0; // Base case: 0 has no digits
} else {
return 1 + countDigits(num / 10); // Recursive call for remaining digits
}
}

int main() {
int num;

cout << "Enter a number: ";


cin >> num;

cout << "The number has " << countDigits(num) << " digits.\n";

return 0;
}

(b) To reverse a string

#include <iostream>
#include <string>

using namespace std;

// Function to reverse a string recursively


string reverseString(string str, int index = 0) {
10
if (index == str.length()) {
return ""; // Base case: Empty string after reaching the end
} else {
return reverseString(str, index + 1) + str[index]; // Recursive call + current character
}
}

int main() {
string str;

cout << "Enter a string: ";


cin.ignore(); // Consume newline character from previous input
getline(cin, str);

cout << "The reversed string is: " << reverseString(str) << endl;

return 0;
}

(c) To find the least-common-multiple of two numbers.

#include <iostream>

using namespace std;

// Function to find LCM recursively using Euclidean Algorithm


int lcm(int a, int b) {
if (b == 0) {
return a; // Base case: LCM of a and 0 is a
} else {
return lcm(b, a % b); // Recursive call with b and remainder (a % b)
}
}

int main() {
int num1, num2;

cout << "Enter two numbers: ";


cin >> num1 >> num2;

cout << "The LCM of " << num1 << " and " << num2 << " is: " << lcm(num1, num2) << endl;

return 0;
}

Q4. Write interactive C programs to perform the following on strings: (12)


(a) To find the length of a given string without using the string library functions.
#include <stdio.h>

int main() {
char str[100]; // Array to store the string
11
int i, length = 0;

printf("Enter a string: ");


fgets(str, 100, stdin); // Read the string with fgets to avoid buffer overflow

// Find the length (excluding the null terminator)


for (i = 0; str[i] != '\0'; i++) {
length++;
}

printf("The length of the string is: %d\n", length);

return 0;
}

(b) To compare two strings without using string library functions.

#include <stdio.h>

int main() {
char str1[100], str2[100];
int i = 0;

printf("Enter the first string: ");


fgets(str1, 100, stdin);

printf("Enter the second string: ");


fgets(str2, 100, stdin);

// Remove trailing newline (if present) from fgets


str1[strcspn(str1, "\n")] = '\0';
str2[strcspn(str2, "\n")] = '\0';

// Compare characters until null terminator or mismatch is found


while (str1[i] != '\0' && str2[i] != '\0' && str1[i] == str2[i]) {
i++;
}

if (str1[i] == '\0' && str2[i] == '\0') {


printf("The strings are equal.\n");
} else if (str1[i] == '\0' && str2[i] != '\0') {
printf("The first string is shorter.\n");
} else if (str1[i] != '\0' && str2[i] == '\0') {
printf("The second string is shorter.\n");
} else {
printf("The strings are not equal.\n");
}

return 0;
}

(c) To count the total number of vowels and consonants in a string and display the
12
counts separately.

#include <stdio.h>
#include <ctype.h> // For tolower()

int main() {
char str[100];
int i, vowels = 0, consonants = 0;

printf("Enter a string: ");


fgets(str, 100, stdin);

// Remove trailing newline (if present) from fgets


str[strcspn(str, "\n")] = '\0';

for (i = 0; str[i] != '\0'; i++) {


char ch = tolower(str[i]); // Convert character to lowercase
if (isalpha(ch)) { // Check if it's an alphabet
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
vowels++;
} else {
consonants++;
}
}
}

printf("The number of vowels: %d\n", vowels);


printf("The number of consonants: %d\n", consonants);

return 0;
}

Q5. Write an interactive C program to insert new elements in the unsorted array. (10)

#include <stdio.h>

int main() {
int arr[100], size, i, pos, new_element;

// Get array size from user


printf("Enter the size of the array (less than 100): ");
scanf("%d", &size);

// Check for valid size


if (size > 100) {
printf("Error: Array size cannot exceed 100.\n");
return 1;
}

// Get array elements from user


printf("Enter %d elements for the array:\n", size);
for (i = 0; i < size; i++) {

13
scanf("%d", &arr[i]);
}

// Get position and new element for insertion


printf("Enter the position (index) to insert (0 to %d): ", size - 1);
scanf("%d", &pos);
printf("Enter the new element to insert: ");
scanf("%d", &new_element);

// Check for valid position


if (pos < 0 || pos > size) {
printf("Error: Invalid position. Please enter a position between 0 and %d.\n", size - 1);
return 1;
}

// Shift elements to the right to make space


for (i = size - 1; i >= pos; i--) {
arr[i + 1] = arr[i];
}

// Insert the new element at the specified position


arr[pos] = new_element;

// Update array size


size++;

// Print the modified array


printf("The array after insertion is:\n");
for (i = 0; i < size; i++) {
printf("%d ", arr[i]);
}
printf("\n");

return 0;
}

Explanation:
1. Header and Variables:
o #include <stdio.h>: Includes standard input/output functions.
o int arr[100], size, i, pos, new_element;: Declares an integer array arr to hold
the elements, variables for size (array size), i (loop counter), pos (insertion
position), and new_element (the element to insert).
2. Get Array Size:
o printf("Enter the size of the array (less than 100): ");: Prompts the user for the
array size.
o scanf("%d", &size);: Reads the size entered by the user and stores it in size.
o Error Checking: The program checks if the entered size is greater than 100
and exits with an error message if so.
3. Get Array Elements:
o printf("Enter %d elements for the array:\n", size);: Prompts the user to enter
the elements for the array.
o for (i = 0; i < size; i++) { scanf("%d", &arr[i]); }: Uses a loop to
read size elements from the user and store them in the arr array.
4. Get Insertion Information:
14
o printf("Enter the position (index) to insert (0 to %d): ", size - 1);: Prompts the
user to enter the position where the new element should be inserted. The valid
range is displayed (0 to size - 1).
o scanf("%d", &pos);: Reads the position entered by the user and stores it
in pos.
o printf("Enter the new element to insert: ");: Prompts the user to enter the new
element.
o scanf("%d", &new_element);: Reads the new element entered by the user and
stores it in new_element.
o Error Checking: The program checks if the entered pos is within the valid
range (0 to size - 1) and exits with an error message if not.
5. Shifting Elements:
o for (i = size - 1; i >= pos; i--) { arr[i + 1] = arr[i]; }: This loop iterates from
the end of the array (size - 1) down to the pos where the insertion needs to
happen. In each iteration:
 arr[i + 1] = arr[i];: It shifts the current element one position to the

Q6. Using Structures in C, write an interactive program to display the mark-sheet and grade card
for 10 students for a MOOC course. (10)
Note: Assumptions can be made wherever necessary and mention them.

#include <stdio.h>
#include <string.h>

#define MAX_STUDENTS 10

struct Student {
char name[50];
int assignment[5]; // Array to store marks for 5 assignments
int exam; // Mark for the final exam
double total; // Total marks (calculated)
char grade; // Grade (calculated)
};

int main() {
struct Student students[MAX_STUDENTS];
int num_students, i, j;

// Get the number of students (up to 10)


printf("Enter the number of students (maximum 10): ");
scanf("%d", &num_students);

if (num_students > MAX_STUDENTS) {


printf("Error: Maximum number of students is 10.\n");
return 1;
}

// Input student details


for (i = 0; i < num_students; i++) {
printf("\nEnter details for student %d:\n", i + 1);
printf("Name: ");
scanf(" %[^\n]", students[i].name); // Read name with spaces using scanf with %[^\n]
printf("Marks for 5 assignments (out of 100):\n");
for (j = 0; j < 5; j++) {
15
printf("Assignment %d: ", j + 1);
scanf("%d", &students[i].assignment[j]);
}
printf("Marks for final exam (out of 100): ");
scanf("%d", &students[i].exam);
}

// Calculate total marks and grades


for (i = 0; i < num_students; i++) {
students[i].total = 0;
for (j = 0; j < 5; j++) {
students[i].total += students[i].assignment[j];
}
students[i].total += students[i].exam;

// Calculate grade based on total marks (assuming grading scale)


if (students[i].total >= 90) {
students[i].grade = 'A';
} else if (students[i].total >= 80) {
students[i].grade = 'B';
} else if (students[i].total >= 70) {
students[i].grade = 'C';
} else if (students[i].total >= 60) {
students[i].grade = 'D';
} else {
students[i].grade = 'F';
}
}

// Display Mark Sheet


printf("\nMark Sheet:\n");
printf(" Name\t | Assignment 1 | Assignment 2 | ... | Assignment 5 | Exam | Total | Grade\
n");
printf("---------|----------------|----------------|-----|----------------|-------|-------|-------\n");
for (i = 0; i < num_students; i++) {
printf("%-20s |", students[i].name);
for (j = 0; j < 5; j++) {
printf(" %d |", students[i].assignment[j]);
}
printf(" %d | %.1f | %c\n", students[i].exam, students[i].total, students[i].grade);
}

return 0;
}

Explanation:

1. Headers:
o #include <stdio.h>: For input/output functions.
o #include <string.h>: For scanf format specifier %[^\n] to read names with
spaces.
2. MAX_STUDENTS: Defines the maximum number of students as 10.
3. Student Structure:
o char name[50]: Stores the student's name.
o int assignment[5]: Array to store marks for 5 assignments.
o int exam: Stores the mark for the final exam.
o double total: Stores the calculated total marks.
16
o char grade: Stores the calculated grade.
4. main Function:
o struct Student students[MAX_STUDENTS];:

17
Q7. Using File Handling concept in C programming, write the C programs for the following: (12)

(a) To find the number of lines in a text file.

#include <stdio.h>

int main() {
FILE *fp;
char ch;
int line_count = 0;

char filename[100]; // Buffer to store the filename

printf("Enter the name of the text file: ");


scanf("%s", filename); // Read the filename from user

// Open the file in read mode


fp = fopen(filename, "r");

if (fp == NULL) {
printf("Error: Could not open file '%s'.\n", filename);
return 1;
}

// Count lines until EOF (End-Of-File) is reached


while ((ch = fgetc(fp)) != EOF) {
if (ch == '\n') {
line_count++;
}
}

// Close the file


fclose(fp);

printf("The number of lines in the file '%s' is: %d\n", filename, line_count);

return 0;
}

(b) To delete specific line from a text file.

#include <stdio.h>
#include <string.h> // For strcpy

int main() {
FILE *fptr1, *fptr2;
char filename[100], ch;
int line_to_delete, line_count = 1;

printf("Enter the name of the text file: ");


scanf("%s", filename);
18
printf("Enter the line number to delete (starting from 1): ");
scanf("%d", &line_to_delete);

// Open the file in read mode


fptr1 = fopen(filename, "r");

if (fptr1 == NULL) {
printf("Error: Could not open file '%s' for reading.\n", filename);
return 1;
}

// Open a temporary file in write mode


fptr2 = fopen("temp.txt", "w");

if (fptr2 == NULL) {
printf("Error: Could not create temporary file.\n");
fclose(fptr1); // Close the original file if temporary file creation fails
return 1;
}

// Read characters from the original file


while ((ch = fgetc(fptr1)) != EOF) {
if (ch == '\n') {
line_count++; // Increment line count for each newline
}

// Copy the line to the temporary file if it's not the line to delete
if (line_count != line_to_delete) {
fputc(ch, fptr2);
}
}

// Close both files


fclose(fptr1);
fclose(fptr2);

// Remove the original file


remove(filename);

// Rename the temporary file to the original filename


rename("temp.txt", filename);

printf("Line %d deleted successfully from the file '%s'.\n", line_to_delete, filename);

return 0;
}

(c) To copy a file to another folder with a different file-name.

#include <stdio.h>
19
#include <stdlib.h> // For exit()

int main() {
FILE *fptr_src, *fptr_dest;
char source_file[100], dest_folder[100], dest_filename[100];
char ch;

printf("Enter the source file name: ");


scanf("%s", source_file);

printf("Enter the destination folder path: ");


scanf("%s", dest_folder);

printf("Enter the desired filename for the copy: ");


scanf("%s", dest_filename);

// Construct the complete destination file path


char destination_path[200];
snprintf(destination_path, sizeof(destination_path), "%s/%s", dest_folder, dest_filename);

// Open the source file in read mode


fptr_src = fopen(source_file, "rb"); // Open in binary mode for various file types

if (fptr_src == NULL) {
printf("Error: Could not open source file '%s' for reading.\n", source_file);
exit(1); // Exit the program on error
}

// Open the destination file in write mode (will create a new file)
fptr_dest = fopen(destination_path, "wb");

if (fptr_dest == NULL) {
printf("Error: Could not create destination file '%s'.\n", destination_path);
fclose(fptr_src); // Close the source file even on destination error
exit(1);
}

// Copy characters from source to destination


while ((ch = fgetc(fptr_src)) != EOF) {
fputc(ch, fptr_dest);
}

printf("File '%s' copied successfully to '%s'\n", source_file, destination_path);

// Close both files


fclose(fptr_src);
fclose(fptr_dest);

return 0;
}

20
Course Code : MCS-012
Course Title : Computer Organization and
Assembly Language Programming
Assignment Number : BCA(II)/012/Assignment/2023-24
Maximum Marks : 100
Weightage : 25%
Last Dates for Submission : 31st October, 2023 (For July Session)
30th April, 2024 (For January Session)

There are four questions in this assignment, which carries 80 marks. Rest 20 marks are for
viva voce. You may use illustrations and diagrams to enhance the explanations. Please go
through the guidelines regarding assignments given in the Programme Guide for the
format of the presentation. The answer to each part of the question should be confined to
about 300 words. Make suitable assumptions, if any.

Q1. (a) Please refer to Figure 4 of Unit 1 of Block 1 on page 11 of the Instruction execution example.
Assuming a similar machine is to be used for the execution of the following three consecutive
instructions:

LODA A ; Load the content of Memory location A into the Accumulator Register.
ADD B ; Add the content of memory location B from Accumulator Register.
STOR C ; Stores the content of Accumulator register to memory location C.
However, this machine is different from the example of Figure 4 in the following ways:

 Each memory word of this new machine is of 16 bits in length.


 Each instruction is of length 32 bits with 16 bits for operation code (opcode) and 16 bits for
specifying one direct operand.
 The Main Memory of the machine would be of size 216 words.
 The three consecutive instructions are placed starting from memory location (11FE) h ;
operand A is at location (1FFF)h and contains a value (4321)h, Operand B is at location
(2000)h and contains a value (1FFE)h and operand C is at location (2001)h and contains
a value (0000)h.
 The AC, PC, MAR and MBR registers are of size 16 bits, whereas IR register is of size
32 bits. The initial content of the PC register is (11FE)h.

Draw the diagrams showing the following information:

(i) Initial State of the machine with the addresses and content of memory locations in
hexadecimal. Show only those address locations of the memory that store the instruction and
data. Also show content of all the stated registers. (2)

(ii) Draw three more diagrams, each showing the state of machine after execution of every
instruction viz. LOAD, ADD and STOR. Show the changes in the values of Registers and
memory locations, if any, due to execution of instruction. Show all the addresses and values
in hexadecimal notations. (3)

21
(b) Perform the following conversion of numbers: (2)
i)
Decimal (345654398)10 to binary and hexadecimal
ii)
Hexadecimal (FFEEDDCBA)h into Octal.
iii)
String “Computer Organisation” into UTF 8
iv)
Octal (6754632)O into Decimal
(c) Simplify the following function using K-map: F(A, B, C, D) = Σ (1, 3, 4, 7, 11, 13)
Draw the circuit for the resultant function using NAND gates. (2)
(d) Consider the Adder-Subtractor circuit as shown in Figure 3.15 page 76 of Block 1. Explain how
this circuit will perform subtraction (A-B), if the value of A is 1011 and B is 0011. You must list
all the bit values including Cin and Cout and overflow, if any. (1)

(e) Explain the functioning of a 3 × 8 decoder with the help of logic diagram and example input. (2)

(f) Assume that a source data value 1011 was received at a destination as 1010. Show how
Hamming's Error-Correcting code bits will be appended to source data to identified and correct
the error of one bit at the destination. You may assume that transmission error occurs only in the
source data and not the source parity bits. (2)

(g) Explain the functioning of the D flip-flop and the T flip-flop with the help of a logic diagram and
characteristic table. Also, explain the excitation table of this flip-flop. (2)

(h) Explain the functioning of the edge-triggered flip-flop with the help of a diagram. (2)

(i) Represent (-121.25)10 and (0.0625)10 in IEEE 754 single precision and double precision formats. (2)

Q2. (a) Refer to the Figure 2(b) on page 8 in Unit 1 of Block 2. Draw the Internal organisation of an
8×8 RAM. Explain all the Input and Output of this organisation. Also answer the following:

(2)

(i) How many data input and data output lines does this RAM needs? Explain your answer.
(ii) How many address lines are needed for this RAM? Give reason in support of your answer.
(b) A computer has 64 K Word RAM with each memory word of 16 bits. It has cache memory
having 32 blocks having a size of 32 bits (2 memory words). Show how the main memory
address (1AFC)h will be mapped to the cache address, if (3)
(i) Direct cache mapping is used
(ii) Associative cache mapping is used
(iii) Two way set associative cache mapping is used.
You should show the size of tag, index, main memory block address and offset in your answer.

(c) What is an Interrupt? Why are interrupts used in a computer? Explain different kinds of
interrupts. Also, explain the process of interrupt processing. (3)

(d) What is an I/O processor? Explain the selector channel structure in the context of the I/O
processor. How is an I/O processor different from DMA? (2)

22
(e) Assume that a disk has 32 tracks, with each track having 16 sectors and each sector is of size
512 Kilobytes. The cluster size in this system can be assumed to be as 2 sectors. A file having
the name mcs012.txt is of size 16 MB. Assume that it is a new disk, and the first 8 clusters are
occupied by the Operating System. Rest all the clusters are free. How can this file be allotted
space on this disk? Also, show the content of FAT after the space allocation to this file. You
may make suitable assumptions. (4)

(f) Explain the following, giving their uses and advantages/disadvantages, if needed. (6)
(Word limit for answer of each part is 50 words ONLY)
(i) Rotational Latency in disks
(ii) Programmed I/O
(iii) Resolution of Display and Printer
(iv) Zip Drive
(v) Power Supply
(vi) Keyboard and Mouse

Q3. (a) A single-core uniprocessor system has 8 General purpose registers. The machine has RAM of
size 64K memory words. The size of every general-purpose register and memory word is 16
bits. The computer uses fixed-length instructions of size 32 bits each. An instruction of the
machine can have two operands. One of these operands is a direct memory operand and the
other is a register operand. An instruction of a machine consists of bits for operation code, bits
for memory operand and bits of register operand. The machine has about 128 different
operation codes. The special purpose registers, which are other than general purpose registers,
are - Program Counter (PC), Memory Address Register (MAR), Data Register (DR) and Flag
registers (FR). The first register among the general-purpose registers can be used as
Accumulator Register. The size of Integer operands on the machine may be assumed to be
equal to the size of the accumulator register. To execute instructions, the machine has another
special register called Instruction Register (IR) of size 32 bits, as each instruction is of this
size. Perform the following tasks for the machine. (Make and state suitable assumptions, if
any.)

(i) Design suitable instruction formats for the machine. Specify the size of different fields that are
needed in the instruction format. Also, indicate how many bits of the instructions are unused for
this machine. Explain your design of the instruction format. Also, indicate the size of each
register. (3)

(ii) Demonstrate two valid instructions of the machine; put some valid data values in registers and
memory locations and show these two instructions. (2)

(iii) Assuming that the instructions are first fetched to the Instruction Register (IR), the memory
operand is brought to the DR register and the result of an operation is stored in the Accumulator
register; write and explain the sequence of micro-operations that are required to fetch and
execute an addition instruction that adds the contents of the memory and register operands of
the instruction. The result is stored in the accumulator register. Make and state suitable
assumptions, if any. (5)

23
(b) Assume that you have a machine, as shown in section 3.2.2 of Block 3 having the micro-
operations given in Figure 10 on page 62 of Block 3. Consider that R1 and R2 both are 8-bit
registers and contain 11100111 and 00111100 respectively. What will be the values of select
inputs, carry-in input, and the result of the operation (including carry-out bit) if the following
micro-operations are performed? (For each micro-operation you may assume the initial value
of R1 and R2 as given above) (2)
(i) Decrement R1
(ii) Add R1 and R2 with Carry
(iii) Exclusive OR of the registers R1 and R2
(iv) Shift right R1

(c) Consider that an instruction pipeline has three stages namely instruction fetch and decode (FD),
Operand Fetch (OF) and Instruction Execute and store results (ES). Draw an instruction
pipeline diagram showing the execution of five sequential instructions using this pipeline. What
are the problems with this instruction pipelining? (3)

(d) Explain the functioning of the Wilkes Control Unit. Also, explain the format of the control
memory with the help of a diagram. (2)

(e) Explain the characteristics of RISC? Also, explain the RISC pipelining. (3)

Q4. (a) Write a program using 8086 assembly Language (with proper comments) that accepts three
different digits as input from the keyboard. Each digit is first converted to a binary equivalent.
The binary values of these three digits are compared and the middle value is put in the AL
register. This AL register is multiplied with each value of a byte array of size 6, which is stored
in the memory. The result of the multiplication is stored in the same memory location. You may
assume the byte array has the values 02h, 06h, 08h, 03h, 01h, 05h. Make suitable assumptions,
if any. (7)

(b) Write a NEAR subroutine using 8086 assembly Language (with proper comments) that returns
the average value of the values stored in a byte array of length 3. All three values of the byte
array are passed to the subroutine in the stack. You should write both the calling program and
subroutine. (7)

(c) Explain the following in the context of 8086 Microprocessor with the help of an example or a
diagram: (6)
(i) Use of code segment and stack segment registers for computing the respective 20-bit
addresses.
(ii) Any 4 flags of the flag register of 8086 micro-processor
(iii) Any four shift instructions of 8086 micro-processor

24
Course Code : MCS-015
Course Title : Communication Skills
Assignment Number : BCA(II)/015/Assignment/2023-24
Maximum Marks : 100
Weightage : 25%
Last date of submission : 31st October, 2023 (For July Session)
30th April, 2024 (For January Session)

This assignment has seven questions. Answer all questions. You may use illustrations and
diagrams to enhance the explanations. Please go through the guidelines regarding
assignments given in the Programme Guide for the format of presentation.

Q1. Read the following passage carefully.

Nobody actually wants to cause offence but, as business becomes ever more international, it is
increasingly easy to get it wrong. There may be a single European market but it does not mean
that managers behave the same in Greece as they do in Denmark.
In many European countries handshaking is an automatic gesture. In France good manners
require that on arrival at a business meeting a manager shakes hands with everyone present. This
can be a demanding task and, in a crowded room, may require gymnastic ability if the farthest
hand is to be reached.
Handshaking is almost as popular in other countries—including Germany, Belgium and Italy.
But Northern Europeans, such as the British and Scandinavians, are not quite so fond of physical
demonstrations of friendliness.
In Europe the most common challenge is not the content of the food, but the way you behave as
you eat. Some things are just not done. In France it is not good manners to raise tricky questions
of business over the main course. Business has its place after the cheese course. Unless you are
prepared to eat in silence you have to talk about something —something, that is, other than the
business deal which you are continually chewing over in your head.
Italians give similar importance to the whole process of business entertaining. In fact, in Italy the
biggest fear, as course after course appears, is that you entirely forget you are there on business.
If you have the energy, you can always do the polite thing when the meal finally ends, and offer
to pay. Then, after a lively discussions, you must remember the next polite thing to do—let your
host pick up the bill.
In Germany, as you walk sadly back to your hotel room, you may wonder why your apparently
friendly hosts have not invited you out for the evening. Don’t worry, it is probably nothing
personal. Germans do not entertain business people with quite the same enthusiasm as some of
their European counterparts.
The Germans are also notable for the amount of formality they bring to business. As an outsider,
it is often difficult to know whether colleagues have been working together for 30 years or have
just met in the lift. If you are used to calling people by their first names this can be a little
strange. To the Germans, titles are important. Forgetting that someone should be called Herr

25
Doktor or Frau Direktorin might cause serious offence. It is equally offensive to call them by a
title they do not possess.

In Italy the question of title is further confused by the fact that everyone with a university degree
can be called Dottore-and engineers, lawyers and architects may also expect to be called by their
professional titles.

These cultural challenges exist side by side with the problems of doing business in a foreign
language. Language, of course, is full of difficulties — disaster may be only a syllable away.
But the more you know of the culture of the country you are dealing with, the less likely you are
to get into difficulties. It is worth the effort. It might be rather hard to explain that the reason you
lost the contract was not the product or the price, but the fact that you offended your hosts in a
light-hearted comment over an aperitif. Good manners are admired: they can also make or break
the deal.
i. Discuss the importance of culture in doing business in the light of the following statement
from the text:

“-------as business becomes ever more international, it is increasingly easy to get it wrong.”

The statement "as business becomes ever more international, it is increasingly easy to get
it wrong" emphasizes the critical role of culture in international business success. Here's why
understanding culture is so important in today's globalized world:

Increased Risk of Cultural Clashes:

 Greater Diversity: With businesses operating across more countries, the potential for encountering
vastly different cultural norms and expectations has grown. What might be considered standard practice
in your home country could be a major misstep elsewhere.

 Subtle Nuances: Cultural differences often lie in subtle nuances beyond just language. Gestures,
greetings, communication styles, and even business etiquette can vary significantly. These seemingly
minor details can have a significant impact on how your message is perceived.

The passage exemplifies this point by highlighting variations in handshakes. A firm handshake
expected in some cultures might be seen as aggressive in others. Similarly, business meals in
France have specific protocols for conversation topics, unlike other cultures where business
might be discussed throughout the meal.

Consequences of Cultural Missteps:

 Offended Partners: Unawareness of cultural norms can easily lead to offense, jeopardizing potential
partnerships. Building trust and rapport becomes difficult if your actions are perceived as disrespectful
or insensitive.

 Wasted Resources: Cultural blunders can waste valuable time and resources. Misunderstandings can
lead to delays, inefficiencies, and even lost deals.

 Damaged Reputation: A negative cultural encounter can damage your company's reputation in the
international market. This can make it harder to secure future partnerships and establish trust with new
clients.

Benefits of Cultural Awareness:


26
 Smooth Business Interactions: Understanding cultural norms fosters smoother business interactions,
leading to better communication and collaboration.

 Competitive Advantage: In a globalized market, cultural sensitivity sets your company apart. It
demonstrates a genuine interest in working with international partners and positions you as a more
trustworthy and adaptable business.

 Building Stronger Relationships: Cultural awareness allows you to build stronger relationships with
business partners from different backgrounds. This fosters trust, respect, and a more positive working
environment.

In conclusion, the increasing internationalization of business makes cultural understanding


more crucial than ever before. By being aware of cultural differences, you can avoid pitfalls,
navigate potential clashes, and build stronger relationships with international partners. This
ultimately leads to a more successful and positive experience in the global marketplace.

Q2. Use the phrasal verbs given in the box to complete the sentences given below: (10)

is over call back cut off get through give up

hang up hold on look up pick up put through

The phone’s ringing. Why don’t you pick up the receiver?


ii. I’m afraid she isn’t available at the moment. Can you call back later?
iii. Can you look up their number in the directory, please?
iv. I’m afraid she’s with a client, shall I put you through to her secretary?
v. Hello? Are you still there? I think we were cut off for a moment.
vi. Mr. Green never seems to be in his office. I’ve been trying to get through to him all morning.
vii. Could you hold on for a moment? I’ll just find out for you.
viii. If the telephonist says ‘Thanks you so much for calling’ and plays me that awful electronic music again, I’ll
give up.
ix. If you get a wrong number, it’s polite to say ‘I’m sorry, I’ve dialed the wrong number’ before you hang up.
x. If an American telephonist asks ‘Are you through?’, she wants to know if your call is over.

Q3. Put the verbs in brackets into the passive form in the following sentences. (10)

i. You’ll hardly recognize our office. It (redecorate) since your last visit.
You’ll hardly recognize our office. It has been redecorated since your last visit.

ii. Two players (send) off the field during last Saturday’s match.

Two players were sent off the field during last Saturday’s match.
iii. The hotel, which (complete) only last year (equip) with a business center and a gym.

The hotel, which was completed only last year, has been equipped with a business
center and a gym.
iv. Application (invite) for the post of Senior Lecturer in the Department of Architecture.
Preference (give) to applicants with teaching experience.

27
Applications are invited for the post of Senior Lecturer in the Department of
Architecture. Preference is given to applicants with teaching experience.

v. As my car (repair) last Friday, I (give) a lift to work by a colleague.

As my car was being repaired last Friday, I was given a lift to work by a colleague.
vi. As soon as your order (receive), it (process) and an acknowledgment sent.

vi. As soon as your order is received, it will be processed and an acknowledgment will be
sent.

Q4. Write down what you would say in each of these situations. (10)
i. Your flight to Delhi is delayed. Find out the reason.

"Excuse me, Delhi flight delayed. Why?"

ii. You’re booked on flight AI 879 on May 16. You want to postpone this to ZZ 857 on May
17.

Change flight please. AI 879 (May 16th) to ZZ 857 (May 17th).

iii. Flight RA 372 doesn’t leave till 5pm but you’ve arrived at the check-in desk at 12 noon.

Early for RA 372 (5pm). Can I check in now?

iv You don’t understand how to get a boarding-pass from an automatic machine. Ask a passer-
by for help.

Hi, can you help with the boarding pass machine?


-

v. Someone asks you how to get to the Terminal-3(Delhi Airport) –tell him or her that it’s two
blocks down and then left.

Terminal 3? Two blocks down, then left."

vi. You have arrived late because your flights’ delay. Apologize to your host or hostess.

So sorry, flight delayed. Apologies for being late.

28
vii. You don’t understand some of the dishes on the menu. Ask your companion for help.

Sorry, confused about some dishes. Can you recommend something?"

viii. You want to order a plain dosa, which is not on the menu.

Plain dosa please, even if not on the menu.


-

ix. Ask your companion to recommend a local dish.

What local dish would you recommend?" -

x. At the end of the meal you want to pay the bill, but the waiter has given it to your companion.

Excuse me, I'd like to pay the bill, please. -

Q5. (a) What are the four phases in a negotiation process? Discuss. (5)

(b) Every New Year XYZ multinational company gives its customers gifts ranging from diaries
and calendars to silver items. The financial manager of that MNC says it’s too expensive and
wants to stop the practice. The sales manager disagrees. Write a dialogue between the two.

our Phases of Negotiation Process:


The negotiation process can be broken down into four key phases:

1. Preparation: This is the groundwork stage where both parties gather information, define their
goals (desired outcomes, BATNA - Best Alternative To a Negotiated Agreement, and WATNA -
Worst Alternative To a Negotiated Agreement), and identify potential concessions.

Financial Manager: Research cost of previous year's gifts, gather data on customer
response/appreciation of gifts. Explore alternative marketing strategies.
Sales Manager: Research customer feedback on gifts, analyze impact on customer loyalty and sales
figures.
2. Clarification and Justification: This stage involves openly exchanging information and explaining
perspectives.

Dialogue:

Financial Manager: "We spend a significant amount on New Year's gifts every year. Given the
current economic climate, I believe this expense is no longer justifiable."
Sales Manager: "Absolutely understand the cost concerns. However, customer surveys consistently
show these gifts enhance brand loyalty and generate goodwill. We've also seen a positive correlation
between gift recipients and repeat business."
3. Bargaining and Problem-Solving: This is the core stage where parties discuss proposals, make
concessions, and brainstorm solutions that meet both their needs.

Dialogue (Continued):
29
Financial Manager: "Convincing points. Perhaps we can explore more cost-effective options? Maybe
smaller gifts or focusing on high-value clients?"
Sales Manager: "Interesting ideas. We could also consider a tiered system based on purchase history
or a shift to more experience-based gifts like promotional events."
4. Closing and Implementation: This stage finalizes the agreement, outlines next steps, and sets a
timeline for follow-up.

Dialogue (Continued):

Financial Manager: "Let's brainstorm some specific cost-effective options and their potential impact.
Once we have a plan, we can present it to the management team."
Sales Manager: "Agreed. Together, we can find a solution that balances cost concerns with
maintaining positive customer relationships."
Key Points:

Each phase builds on the previous one.


Effective communication, active listening, and a willingness to compromise are crucial.
The goal is to reach a win-win outcome that satisfies both parties.

Q6. You are the General Manager –HR of the company. You want to talk about the effective ways
of making good presentations to the Sales staff. Use the following points to make your
presentation. (15)
 How good presentations can benefit your company.
 How speakers should prepare before giving presentations
 The qualities of a good speaker
 How a speaker can keep the attention of the audience
 The effective use of visual aids in presentations

1. Benefits of Good Presentations for the Company:


 Improved communication: Clear and impactful presentations enhance understanding and
alignment within the sales team and with clients.
 Increased sales effectiveness: Engaging presentations can influence customer decisions and
lead to higher sales conversions.
 Professional image: Well-prepared presentations reflect positively on the company's
professionalism and credibility.
2. Preparation for Speakers:
 Understand the audience: Tailor the content and tone of the presentation to the Sales staff's
needs and preferences.
 Research and organize content: Gather relevant data, examples, and visuals to support key
points and create a structured flow.
 Practice delivery: Rehearse the presentation multiple times to ensure fluency, confidence, and
time management.
3. Qualities of a Good Speaker:
 Confidence: Projecting confidence and enthusiasm about the topic enhances audience
engagement and trust.
 Clarity: Articulate clearly, use simple language, and avoid jargon to ensure understanding.
 Engagement: Interact with the audience through questions, stories, and examples to maintain
interest and involvement.
4. Keeping Audience Attention:
30
 Start strong: Begin with a compelling hook or relevant story to grab attention from the start.
 Use visuals: Incorporate engaging visuals like charts, graphs, videos, and infographics to
support key points and break monotony.
 Interactive elements: Include interactive activities, polls, or Q&A sessions to involve the
audience and keep them engaged.
5. Effective Use of Visual Aids:
 Relevance: Ensure visual aids directly support and enhance the message without overwhelming
or distracting the audience.
 Simplicity: Use clear, concise visuals with minimal text to convey information effectively.
 Consistency: Maintain a consistent visual theme, color scheme, and formatting for a
professional and cohesive presentation.
By addressing these points, we can equip our Sales staff with the knowledge and skills to deliver impactful
presentations that drive business success and enhance client relationships.

Q7. Imagine that your General Manager has asked you to find out the precautions and preparations
needed to arrange for the disaster management provisions in your company. (20)

These are the notes you’ve made. Draft a report of about 300 words to your General Manager
by expanding the notes into paragraphs.

Identified Dangers

i. Fire— particularly in areas where a lot of paper is stored


ii. Earthquake —cracks due to previous earthquake
iii. Lightening —inadequate safety measures

31
Proposals

i. Fire frightening equipment to be maintained regularly


ii. Fire fighting training to the support staff
iii. Display of safety regulations
iv. Hooters to be installed —signal warning
v. Exit outlets to be highlighted
vi. Important telephone numbers —Hospital, Fire-Brigade, Doctors, senior
officials of the company
vii. Action committee to be formed

Disaster Management Provisions: Addressing Specific Threats and Recommendations


Introduction:

This report outlines key precautions and preparations needed to address specific disaster threats identified
within our company, along with proposed measures for your review. Following your request, I have compiled
information on fire safety, earthquake preparedness, and lightning protection.

Identified Dangers:

Fire: Given the presence of paper storage areas, fire poses a significant risk. We must prioritize fire safety
measures in these locations.
Earthquake: Cracks in the building due to a previous earthquake raise concerns about structural integrity. A
thorough inspection and potential repairs are crucial.
Lightning: The lack of adequate lightning safety measures exposes employees and equipment to potential
harm. Implementing preventive measures is essential.
Proposed Measures:

Fire Safety:

Equipment Maintenance: Regularly maintain fire-fighting equipment like extinguishers and sprinkler systems
to ensure their functionality during an emergency.
Staff Training: Conduct fire-fighting training for designated support staff members. This training should focus
on safe extinguisher use and initial fire response procedures.
Safety Awareness: Clearly display fire safety regulations throughout the building, including proper use of
flammables and evacuation procedures.
Early Warning System: Install audible alarms or hooters to signal fire emergencies and initiate evacuation
protocols.
Clearly Marked Exits: Ensure all exit routes are well-lit, clearly marked, and unobstructed to facilitate safe
evacuation.
Emergency Contact List: Create and display a comprehensive list of emergency contact information, including
hospitals, fire brigade, doctors, and key company officials.
Earthquake Preparedness:

Structural Assessment: Arrange for a comprehensive structural inspection of the building to assess the extent
of existing cracks and determine necessary repairs to ensure earthquake resilience.
Evacuation Drills: Conduct regular earthquake drills to familiarize employees with safe evacuation routes and

32
procedures.
Emergency Supplies: Stock designated areas with emergency supplies like first-aid kits, bottled water, and
non-perishable food, readily accessible in case of an earthquake.
Lightning Protection:

Surge Protection: Install surge protectors on electrical equipment to safeguard against lightning strikes.
Lightning Awareness: Educate employees on lightning safety measures, such as avoiding open spaces,
electronic devices, and metal objects during storms. Consider signage reminding employees of these
precautions.
Action Committee:

Forming a dedicated action committee is recommended to oversee the implementation of these measures
and develop a comprehensive disaster management plan. This plan can encompass communication protocols,
business continuity procedures, and the establishment of a well-trained response team.

Conclusion:

By implementing these proposed measures, we can significantly improve our company's disaster preparedness
for fire, earthquakes, and lightning. This will enhance employee safety, protect equipment and operations, and
ensure a quicker recovery in the event of an emergency.

Next Steps:

Further discussions with relevant departments and potentially disaster management experts would be
beneficial to develop a robust plan incorporating the proposed measures and addressing additional areas like
communication and response protocols.

Course Code : MCS-013


Course Title : Discrete Mathematics
Assignment Number : BCA (II)/013/Assignment/2023-24
Maximum Marks : 100
Last Date of Submission : 31st October, 2023 (for July Session)
30th April, 2024 (for January Session)

There are eight questions in this assignment, which carries 80 marks. Rest 20 marks are for
viva-voce. Answer all the questions. You may use illustrations and diagrams to enhance the
explanations. Please go through the guidelines regarding assignments given in the
Programme Guide for the format of presentation.

Q1. (a) What is Set? Explain use of Set with examples (3)

(b) Make truth table for followings. (4)


i) p→(~r  q)  (~p  r)

(a) Sets

33
A set is a collection of distinct objects. These objects can be anything like numbers, letters,
or even other sets. There are no duplicates allowed, and the order doesn't matter.

Example: The set of primary colors: {red, yellow, blue}

(b) Truth Table

Here's the truth table for the statement:

p r q ~r ~r Ù q ~p ~p Ú r p → (~r Ù q) Ù (~p Ú r)

T T T F T F T T

T T F F F F T T

T F T T T F T T

T F F T T F T T

F T T F T T F T

F T F F F T F T

F F T T T T F F

F F F T T T F F

drive_spreadsheetExport to Sheets

This table shows the logic value (True/False) for the statement based on all possible
combinations of truth values for p, r, and q.

ii) p→ (~r  ~ q)  (p  ~ r)

) Set:

 A collection of distinct objects.


 No duplicates allowed.
 Order doesn't matter.

Example: Set of odd numbers less than 10: {1, 3, 5, 7, 9}


34
b) Truth Table (ii):

p r q ~r ~q ~r Ú ~q p Ù ~r p → (~r Ú ~ q) Ú (p Ù ~ r)

T T T F F F F T

T T F F T T F T

T F T T F T T T

T F F T T T T T

F T T F F F F T

F T F F T T F T

F F T T F T F T

T
F F F T T T F
pen_spark

(c) Give geometric representation for followings: (3)

i) {5, -3) x ( -2, -2)

ii) {-1, 3) x ( -2, 3)

Q2. (a) Draw Venn diagram to represent followings: (3)


i) (A  B  C)  (A  B  C)
(d) In this case, the expression is redundant as it is the same as (A ∩ B ∩ C). Thus, the Venn diagram
represents the set (A ∩ B ∩ C) as a single overlapping region of A, B, and C:

-------
A | |
| ∩ |
B | |
| ∩ |
C | |
-------
i) (A  B  C)  (B  C)

35
(e) In this case, we need to represent both the intersection and union of A, B, and C. The Venn diagram
would look like this:

-------
A | |
| ∩ |
B |∪ |
| ∩ |
C | |
-------

i) (A  B  C)
(f) -------
A | |
| ∩ |
B | |
| ∪ |
C | |
-------

(b) Write down suitable mathematical statement that can be represented by the following symbolic
properties. (4)

i) (  x) (  y) (  z)P
 This statement can be read as "There exist values for x, y and z such that the property P is true."
iii)  (z) (  y) (  z)Q
 This statement can be read as "There exist values for z and y such that for all values of z, the property Q is
true."

(c) Show whether √7 is rational or irrational. (3)

To determine whether √7 is rational or irrational, we can use a proof by contradiction.

Assume that √7 is rational, meaning it can be expressed as a fraction in the form p/q, where p and q are
integers with no common factors other than 1 and q ≠ 0.

We have:
√7 = p/q

Squaring both sides:


7 = (p/q)^2

Rearranging the equation:


7q^2 = p^2

This implies that p^2 is divisible by 7, so p must also be divisible by 7. Let's say p = 7k, where k is
some integer.

Substituting back into the equation:


7q^2 = (7k)^2
36
7q^2 = 49k^2

Dividing both sides by 7:


q^2 = 7k^2

This shows that q^2 is divisible by 7, which means q must also be divisible by 7.

We now have both p and q divisible by 7, which contradicts our assumption that p and q have no
common factors other than 1. Therefore, our assumption that √7 is rational cannot be true.

Hence, we can conclude that √7 is irrational.

Q3. (a) Explain use of inclusion-exclusion principle with example. (2)

(b) Make logic circuit for the following Boolean expressions: (4)

To explain the inclusion-exclusion principle, let's consider an example. Suppose we have a set of numbers {1, 2, 3, 4,
5, 6} and we want to find out how many numbers are divisible by either 2 or 3.

We start by counting the numbers divisible by 2, which are 2, 4, and 6. So, there are three numbers divisible by 2.

Next, we count the numbers divisible by 3, which are 3 and 6. So, there are two numbers divisible by 3.

However, if we simply add the counts from each category (3 + 2 = 5), we will be counting the number 6 twice
because it is divisible by both 2 and 3.

To correct this, we apply the inclusion-exclusion principle. We subtract the count of numbers divisible by both 2 and
3, which is just 1 (the number 6). So, by subtracting 1 from the sum of 3 and 2, we get 4.

Therefore, there are 4 numbers in the set that are divisible by either 2 or 3.

Now let's move on to creating logic circuits for the given Boolean expressions:

i) (xyz) + (xyz)' + (xz'y)


i) (xyz) + (xyz)' + (xz'y)
This expression has three terms: (xyz), (xyz)', and (xz'y).
To create a logic circuit for this expression, we can use three AND gates to handle each term
individually. Then, we combine the outputs of these AND gates using OR gates.

Here's the logic circuit diagram for the given expression:

x -----\
AND \
y -----/ OR ---- Output

z -----/
ii) ( x'yz) (xyz') (xy'z)
ii) (x'yz) (xyz') (xy'z)
This expression also has three terms: (x'yz), (xyz'), and (xy'z).

37
Again, we can use three AND gates to handle each term and combine the outputs using AND
gates this time.

Here's the logic circuit diagram for the given expression:

x ------\
AND -----\
y ------/ AND -----\
AND ---- Output
z ------/

(b) What is a tautology? If P and Q are statements, show whether the statement (4)

(𝑃 → 𝑄) ∨ ( →~ 𝑃) is a tautology or not.

A tautology is a compound statement in logic that is always true, regardless of the truth
values of its individual component statements. In other words, a tautology is a statement that
is true under every possible combination of truth values assigned to its variables.

To determine whether the statement (𝑃 → 𝑄) ∨ ( →~ 𝑃) is a tautology or not, we can


construct a truth table and evaluate the various truth value combinations of P and Q.

First, let's break down the given statement:


(𝑃 → 𝑄) ∨ ( →~ 𝑃)

The material implication (→) can be read as "if P, then Q." So, (𝑃 → 𝑄) translates to "if P is
true, then Q is true." On the other hand, (~P) represents the negation of P, which means "not
P."

Now, let's construct a truth table to determine the truth value of the entire statement for all
possible truth value combinations of P and Q:

| P | Q | ~P | 𝑃 → 𝑄 | →~𝑃 | (𝑃 → 𝑄) ∨ (→~𝑃) |
||---|----|-------|------|-------------------|
|T|T| F| T | F | T |
|T|F| F| F | F | F |
|F|T| T| T | T | T |
|F|F| T| T | T | T |

By examining the last column of the truth table, we can see that the statement (𝑃 → 𝑄) ∨
(→~ 𝑃) evaluates to true (T) for all possible combinations of truth values for P and Q.

Therefore, since the statement is true for every possible combination of truth values, it is a
tautology.

Q4. (a) How many words can be formed using letter of “EXCELLENT” using each letter at most
once? (2)
38
To determine the number of words that can be formed using the letters of "EXCELLENT" with each letter used at
most once, we need to consider two scenarios:

If each letter must be used,

In this case, we have to arrange all the letters in the word. The word "EXCELLENT" consists of 9
letters, but the letter "E" appears three times. To find the number of distinct arrangements, we
divide the total number of arrangements by the factorial of the repeated letters.

The total number of arrangements for "EXCELLENT" is 9!, which is 362,880. However, since
the letter "E" appears three times, we divide the total number of arrangements by 3!. Thus, the
number of distinct words that can be formed is 9! / 3! = 362,880 / 6 = 60,480.

i) If some or all the letters may be omitted.

In this case, we have the option to omit one or more letters from the word "EXCELLENT". To find
number of possible words, we need to consider all possible subsets of the letters.

The word "EXCELLENT" has 9 letters. Each letter can either be included or omitted, giving us 2
options for each letter. Considering that each letter can have 2 possibilities, we have a total of
2^9 = 512 possible subsets.

However, we need to subtract 1 from this total because we cannot include the empty set (which
corresponds to omitting all the letters). So, the final number of possible words is 512 - 1 = 511.

Therefore, if each letter must be used, there are 60,480 words that can be formed. If some or all the
letters may be omitted, there are 511 words that can be formed.

(b) What is a relation? What are different types of relation? Explain equivalence relation with the
help of example. (3)

(c) Prove that 12 +22+32+ …+ n2 = n(n+1)(2n+1)/6 ;  n ∈ N (3)


(d) What is counterexample? Explain its use with the help of an example. (2)

Q5. (a) How many different professionals committees of 8 people can be formed, each containing at
least 2 Doctors, at least 2 Public Servants and 1 IT Expert from list of 7 Doctors, 6 Public
Servants and 6 IT Experts? (4)

To determine the number of different professional committees that can be formed with specific requirements, we can
use the concept of combinations and counting principles.

First, we need to ensure that each committee contains at least 2 Doctors, 2 Public Servants, and 1 IT Expert.

Let's break down the problem into steps:

1) Selecting the required professionals:


39
We need to select 2 Doctors, 2 Public Servants, and 1 IT Expert to fulfill the minimum requirements of each
committee.

The number of ways to select 2 Doctors out of 7 is given by the combination formula: C(7, 2) = 21.
Similarly, the number of ways to select 2 Public Servants out of 6 is C(6, 2) = 15.
And the number of ways to select 1 IT Expert out of 6 is C(6, 1) = 6.

2) Selecting the remaining committee members:


After selecting the required professionals, we need to select the remaining members from the remaining pool of
candidates. The remaining members can be Doctors, Public Servants, or IT Experts.

For the Doctors, we have 7 - 2 = 5 remaining candidates.


For the Public Servants, we have 6 - 2 = 4 remaining candidates.
For the IT Experts, we have 6 - 1 = 5 remaining candidates.

Since there are no restrictions on the number of remaining members from each profession, we can choose any
combination as long as it doesn't violate the minimum requirements.

To find the total number of committee options, we multiply the number of options from step 1 with the number of
options from step 2 for each profession: 21 * 15 * 6 * C(5, remaining) * C(4, remaining) * C(5, remaining).

Now, we need to consider all possible values for the "remaining," which can range from 1 to 3 (since a total of 8
members must be selected for each committee).

So, the total number of different professional committees can be calculated as follows:

Total = 21 * 15 * 6 * (C(5, 1) * C(4, 3) * C(5, 4) + C(5, 2) * C4, 2) * C(5, 3) + C(5, 3) * C(4, 1) * C(5, 2))

By calculating the values in parentheses and multiplying the results with the values outside the parentheses, you will
obtain the total number of different professional committees.

(b) A and B are mutually exclusive events such that P(A) = 1/2 and P(B) = 1/3 and P (AU B) = 1/4.
What is the probability of P(A Ո B)? (2)
Since events A and B are mutually exclusive, they cannot occur simultaneously. This means that the intersection of A
and B (denoted by A ∩ B) is an empty set, and therefore has a probability of 0.

The formula for the union of two mutually exclusive events is as follows:
P(A ∪ B) = P(A) + P(B)

Given that P(A) = 1/2 and P) = 13, we can substitute these values into the formula:
P(A ∪ B) = 1/2 + 1/3 = 5/6

But we are given that P(A ∪ B) = 1/4.

Since these two probabilities don't match, we can conclude that the information provided is inconsistent. It is not
possible for the union of A and B to have a probability of 1/4 while also being mutually exclusive with P(A) = 1/2
and P(B) = 1/3.

Therefore, we cannot determine the exact probability of P(A ∩ B) based on the given information.

(c) Find how many 3 digit numbers are odd? (2)


To find how many 3-digit numbers are odd, we need to consider the possible values for the
40
hundreds digit (first digit) and the units digit (last digit).

For the hundreds digit, we have 9 options: 1, 2, 3, 4, 5, 6, 7, 8, and 9. We cannot have 0 as the
hundreds digit, as that would make it a 2-digit number.

For the units digit, we have 5 options: 1, 3, 5, 7, and 9. These are the only odd digits.

Now, for the tens digit (second digit), it can be any digit from 0 to 9, as there is no restriction on
it being odd or even.

Since we have 9 options for the hundreds digit, 10 options for the tens digit, and 5 options for the
units digit, we can use the multiplication principle to find the total number of 3-digit odd
numbers:

Total = 9 * 10 * 5 = 450

Therefore, there are 450 three-digit numbers that are odd.

(d) Explain whether the function f(x) = x + 1 is one-one or not. (2)

To determine whether the function f(x) = x + 1 is one-to-one or not, we need verify if every element from the domain
(input values) is mapped to a distinct element in the range (output values).

Let's consider two arbitrary elements, a and b, from the domain such that f(a) = f(b).

Using the given function, we have:


f(a) = a + 1
f(b) = b + 1

If f(a) = f(b), then a + 1 = b + 1.

By subtracting 1 from sides of the equation, we have:


a=b

This result shows that if two elements from the domain are mapped to the same output value, then the elements
themselves must be the same.

In other words, the function f(x) = x + 1 is indeed a one-to-one function because for any two distinct input values, a
and b, their corresponding outputs, f(a) and f(b), will also be distinct.

(e) Q6. (a)

How many ways are there to distribute 21 district items into 6 distinct boxes with: (3)

41
i) At least two empty box.
Total Arrangements (Ignoring Restrictions):

We can treat the 21 items and 6 boxes as 27 distinct objects.


The number of ways to arrange these objects is:
Total arrangements = 27!
Arrangements with No Empty Boxes:

We need to subtract the arrangements where all boxes are filled.


In this case, we have 6 boxes and 21 items to put in them (no empty boxes).
Arrangements with no empty boxes = 21!
Arrangements with at Least Two Empty Boxes:

Total arrangements - Arrangements with no empty boxes


At least two empty boxes = 27! - 21!
Calculating the exact value of these factorials becomes very large for 21 and 27. However, for
the exam, you might not need the exact number. You can explain the approach and mention
that the number of arrangements with at least two empty boxes is the difference between the
total arrangements and arrangements with no empty boxes.
ii) No empty box.
e treat all 21 items and 6 boxes as distinct objects.
Number of arrangements:
Total arrangements with no empty box = 21!
Explanation:

In this case, all boxes must be filled, so we consider all 21 items and 6 boxes as 27 distinct
objects to arrange.

(b) Explain principle of multiplication with an example. (3)

(c) Three Sets A, B and C are: A = {1, 2,3,4,5, 8,9,12,15,17}, B = { 1,2, 3 ,4,8,9, 10 } and C
{1,2,7, 9, 10, 11, 13}. Find A  B  C ; A  ~B  C; A  B  C and (A  ~C).

The principle of multiplication states that if an event A can occur in x different ways and
another event B can occur in y different ways, then there are x * y ways for both events A
and B to occur simultaneously. This principle can be extended to more than two events as
well.
Example:
Imagine you're picking out an outfit. You have 3 different shirts and 5 different pairs of
pants. The principle of multiplication tells us that you have 3 * 5 = 15 possible outfit
combinations (assuming you can't wear multiple shirts or pants at once).
Applying the Principle (Set Operations)
Now, let's use the principle of multiplication to find the number of elements in the sets you
provided:
Sets:
 A = {1, 2, 3, 4, 5, 8, 9, 12, 15, 17}
 B = {1, 2, 3, 4, 8, 9, 10}
 C = {1, 2, 7, 9, 10, 11, 13}
a) A ∩ B ∩ C (Intersection):
This represents the elements that are present in ALL THREE sets (A, B, and C).
 Count the number of elements that appear in all sets: There are 2 elements (1 and 9).
42
b) A ∪ ~B ∩ C (Union and Complement Intersection):
 A ∪ ~B: This includes elements in A that are NOT in B. Count the elements in A but not in B.
There are 3 elements (5, 12, 17).
 Now, find the intersection of this result with set C. Among the 3 elements from step 1,
only 1 element (12) is also in set C.
c) A ∩ B ∩ C (Intersection): (Already solved in part a)
d) A ∪ ~C (Union and Complement):
 A ∪ ~C: This includes elements in A that are NOT in C. Count the elements in A but not in C.
There are 8 elements (3, 4, 5, 8, 12, 15, 17).

Q7. (a) Explain addition theorem in probability.


a) Addition Theorem in Probability:
The addition theorem in probability helps us calculate the probability of at least one
event happening from a set of events. Here's the formula:
P(A ∪ B) = P(A) + P(B) - P(A ∩ B)
 P(A ∪ B): Probability of event A or event B (or both) happening.
 P(A): Probability of event A happening.
 P(B): Probability of event B happening.
 P(A ∩ B): Probability of both events A and B happening (intersection).
This formula accounts for counting the intersection (A ∩ B) twice (once for each
individual event) and subtracts it to get the actual probability of at least one event
happening.

(b) Make Pascal's triangle up to n = 6. (2)


b) Pascal's Triangle (up to n = 6):
Pascal's triangle is a triangular arrangement of numbers where each number is the sum
of the two numbers directly above it. Here's Pascal's triangle up to n = 6:
1
11
121
1331
14641
1 5 10 10 5 1

(c) What is a function? Explain different types of functions with example. (3)
c) Functions:
A function is a mathematical relationship between two sets, called the domain (input
values) and the range (output values). Each input value maps to a unique output value
in the function. There are different types of functions:
1. One-to-One (Injective): Every input has a unique output, and every output has a
unique input (e.g., f(x) = x + 1).
43
2. Many-to-One (Surjective): One output can have multiple inputs, but each input
still has a unique output (e.g., f(x) = x^2).
3. One-to-Many (Not a function): One input can have multiple outputs, violating
the definition of a function (e.g., f(x) = if x is even, then 1; else, 2).

(d) Write the following statements in symbolic form:


(e) Here's how to write the statements in symbolic form:

(i) Mr. X is poor but happy.


(i) Mr. X is poor but happy.
 Let P: Mr. X is poor
 Let H: Mr. X is happy
Symbolic form: P ∧ H (read as "P and H")

(ii) Either eat healthy food or be ready for poor health.


 Let E: Eat healthy food
 Let H: Poor health

d) Symbolic Statements:
Symbolic form: ~E ∨ H (read as "not E or H")

Q8. (a) Find inverse of the following functions (3)


x3  2
f(x) = x3
x
3

44
To find the inverse of the function f(x = (x^3 + 2) / (x - 3), where x ≠ 3, we can follow these steps:

Step 1: Replace f(x) with y: y = (x^3 + 2) / (x - 3)

Step 2: Interchange x and y: x = (y^3 + 2) / (y - 3)

Step 3: Solve the resulting equation for y (the new expression of x): Multiply both sides of the equation by
(y - 3) to eliminate the denominator.
x(y - 3) = y^3 + 2

Step 4: Expand and rearrange the equation:


xy - 3x = y^3 + 2

Step 5: Move all terms involving y to one side:


xy - y^3 = 3x + 2

Step 6: Factor out y from the left side:


y(x - y^2) = 3x + 2

Step 7: Solve for y by dividing both sides by (x - y^2):


y = (3x + 2) / (x - y^2)

Step 8: Replace y with f^(-1)(x) to obtain the inverse function:


f^(-1)(x) = (3x + 2) / (x - (f^(-1)(x))^2)

Therefore, the inverse of the function f(x) = (x^3 + 2) / (x - 3), where x ≠ 3, is f^(-1)(x) = (3x + 2) / (x - (f^(-
1)(x))^2).
(b) Find dual of Boolean Expression for the output ( Y) of the following logic circuit. (3)

Analyzing the Circuit:

Based on the image, the logic circuit consists of three NAND gates arranged in a cascade. Here's the
signal flow:

Inputs A and B are fed into the first NAND gate.


The output of the first NAND gate (X) goes into the second NAND gate, along with another input C.
The output of the second NAND gate goes into the third NAND gate with input D.
45
The final output of the third NAND gate is the circuit's output (Y).
NAND Gate and Duality:

A NAND gate implements the NAND operation, which is logically equivalent to (A ⋅ B). The dual of a
NAND gate is a NOR gate, which implements the NOR operation, equivalent to(A ∨ B)`.

Deriving the Original Boolean Expression:

Since each gate performs a NAND operation, let's represent the output of each gate with a variable:

X = NAND(A, B)
Y = NAND(X, C) = NAND(NAND(A, B), C)
Applying Duality Rules:

To find the dual expression, we replace NAND with NOR and vice versa:

Y' = NOR(NOR(A, B), C')


Dual Expression:

Therefore, the dual Boolean expression for the output (Y) of the circuit is:

Y' = NOR(NOR(A, B), C')

Dual Logic Gates:

The corresponding logic circuit implementing the dual expression would use three NOR gates in
cascade. The first NOR gate would take inputs A and B, the second would take the output of the first
NOR gate and input C' (complement of C), and the third would take the output of the second NOR
gate and input D.

(c) What is a proper subset ? Write the number of proper subsets of the Set

{a, b, c, d, e, f}. (2)

A proper subset is a subset of a set that meets two conditions:


1. Contains Elements of the Original Set: It contains some, but not all, elements of the original set.
2. Not Equal to the Original Set: It is not identical to the original set.
Here's an example:
 Original Set: {a, b, c}
 Proper Subset: {a, b} (Contains elements a and b, but not c, and is not the same as the original
set)
Number of Proper Subsets for {a, b, c, d, e, f}
To find the number of proper subsets for a set with n elements, we can use the following
formula:
Number of proper subsets = 2^n - 1
where n is the number of elements in the set.
In this case, n = 6 (a, b, c, d, e, f).
Therefore, the number of proper subsets:
Number of proper subsets = 2^6 - 1 = 64 - 1 = 63
There are 63 proper subsets for the set {a, b, c, d, e, f}.

46
(d) “If it rains, then you will play”. Write inverse and contrapositive for this sentence. (2)

The original statement is: "If it rains, then you will play." (This is a conditional statement with
"rains" as the hypothesis (if-part) and "you will play" as the conclusion (then-part).)

Here's how to find the inverse and contrapositive:

Inverse:

The inverse swaps the hypothesis and conclusion but reverses the logical relationship (i.e.,
from implication to contrapositive).

Inverse: "If you will play, then it rains."

Contrapositive:

The contrapositive reverses both the hypothesis and conclusion and negates them both.

Contrapositive: "If it does not rain, then you will not play."

Explanation:

 The original statement implies that rain is a necessary condition for you to play.
 The inverse doesn't hold true in general. Just because you play doesn't necessarily
mean it's raining (there could be other reasons to play).
 The contrapositive, however, is logically equivalent to the original statement. If it's not
raining, then you definitely won't be playing because of the rain.
pen_spark
tuneshare
more_vert

47
Course Code : BCSL-021
Course Title : C Language Programming
Assignment Number : BCA(II)/L-021/Assignment/2023-24
Maximum Marks : 50
Weightage : 25%
Last date of Submission : 31st October, 2023 (for July Session)
30th April, 2024 (for January Session)

This assignment has only one question. Answer the question. This question carries 40
marks. Rest 10 marks are for viva voce. You may use illustrations and diagrams to enhance
the explanation. Please go through the guidelines regarding the assignments given in the
programme guide for the format of presentation.

Q1. Write an interactive C program which prompts the user with the following options on the opening
menu: (40)

1) General Information of the Learner Support Centre(LSC)


2) Programmes activated in the study centre
3) Scheduling of theory/practical sessions for BCA-MCA programmes
4) Academic Councillor’s Details
5) Schedules for Assignment submissions for various programmes
6) Quit

Enter your choice:

If an “1” is entered, prompt the user to enter the study centre code and know the genearl details
about the study like name of the learner support centre(LSC), name of the regional centre, name of
the study centre coordinator, programme in-charge details etc. If “2” is entered, it should give the
details of all the programmes those are activated in the LSC. If “3” is entered, it should give the
schedules for the theory and practical counselling sessions for BCA and MCA programmes for the
current session. If “4” is entered it should display the details of the academic councillors’
associated with respective programmes. If “5” is entered it should display the assignments
submission schedules for various programmes for the current session activated in that LSC. If the
user enters any letters or numbers other than the choice, redisplay the prompt. All output should go
to the terminal and all input should come from the keyboard.

Note: You must execute the program and submit the program logic, sample input and output
along with the necessary documentation for this practical question. Assumptions can be made
wherever necessary.

48
Course Code : BCSL-022
Course Title : Assembly Language Programming
Lab Assignment Number : BCA(II)/L-022/Assignment/2023-24
Maximum Marks : 50
Weightage : 25%
Last Dates for Submission : 31st October, 2023 (For July Session)
30th April, 2024 (For January Session)

Note : This assignment has two questions of total of 40 marks. Rest 10 marks are for viva
voce. Please go through the guidelines regarding assignments given in the programme
guide for the format of presentation.

Q1. Design a two bit counter circuit that count from the state 00 to 10 only. The state 11 is ignored.
The states of the counter, thus, may be 00, 01, 10, 00, 01, 10… Use J-K flip flop to design the
circuit. You must design them using state transition diagram and Karnaugh's map. (10)

Q2. Perform the following using 8086 assembly language. (3×10 = 30)

(a) Write and run a program using 8086 assembly language that increments a byte value stored in a
memory location by a value 2. The result should be stored in the same memory location. For
example, if a memory location contains 0101 0001, then the program will add 2 to this value and
store the result 0101 0011 (after adding 2) in the same location. 20

(b) Write and run a program using 8086 assembly language which finds the highest of four byte
values stored in memory. The highest value should be left in AL register.

(c) Write and run a program using 8086 assembly language that compares the values. of AL and BL
registers. In case AL is more than BL, then program clears BL register otherwise it clears AL
register. You can move value '1100 1010' in AL, register and '1100 1000' in BL register, initially.

49

You might also like