MBIO: PRACTICAL FILE
-
NAME:- JAGJIT KUMAR
-
M.sc Biotechnology 1 SEMESTER,
-
MBIO-104: Computer Applications
-
PU PIN 36964
Q1. Create an invitation card using different types of formatting options in MS-WORD
Q2. Write the steps to perform mail-merge in MS-WORD.
What are mail merges?
Mail merges are one of the quickest ways to customize documents like emails, newsletters, and other personalized messages. A mail merge lets you create personalized documents that automatically vary on a recipient-by-recipient basis. This spares you the trouble of manually personalizing each document yourself!
Mail merges work by pairing up one file (e.g., an Excel spreadsheet) that contains individual data such as names, email addresses, and other facts about your audience or customers with a second file (such as a Word document) with a formatted message that includes placeholders for the personalized data from the spreadsheet.
Step 1: Open Microsoft Word, and go to the mailings options on the top bar.
Step 2: Click on Start Mail merge option on the top bar.
Step 3: Then, click on step by step mail merge option, and choose the document you want to merge or send from the navigation bar on the right of your screen.
Step 4: Then click on Starting document option on the downright end of your screen.
Step 5: Choose the document you want to merge or send and click on next: Set recipients on the down bottom of your screen.
Step 6: Now choose the recipients list to whom you want to send either by choosing an already existing list by browsing the names and addresses or you can create a new list from the option Type the new list and choose to create.
Step 7: If you are creating a list then enter the name and their address in the table.
Step 8: Now click on the Write your letter option on the downright end.
Step 9: Now write the letter and instead of typing the names, go to more items on side Bar and choose.
Step 10: Now go to preview your letter option and click on Complete the merge option.
1. Choose your document type – Within the mailings, tab click the start mail merge button and a drop-down will appear. You can choose from labels, envelopes, emails, letters, or a directory.
2. Select your recipients – Here you can choose to “type a new list” where you enter the recipients into a database one by one, “Use an existing list” such as a spreadsheet to import the data, or “select from your Outlook contacts“. You can then edit the recipient data should you wish.
3. Write & insert fields – Now that your document is linked to your recipient data you can add the individual personalization fields. This includes address fields (use the “address block” button) and greeting line (e.g. dear Sir or Madam, recipient’s first name, etc).
4. Preview results – Check that the fields you’ve inserted are pulling the correct data through (e.g. the town field isn’t pulling through the county information) and positioned correctly on your document.
5. Finish & merge – Now that you’re happy with your content, and the correct data fields are being imported, you can finish and merge the document and your data to create the final product. There are three options here:
- Edit individual documents – Creates a single new document with separate pages for each recipient.
- Print documents – This sends multiple letters directly to your printer.
- Send email messages – This sends your document as emails rather than hard copies (you must have email details in your data file to do this).
Q3. Enter the following data and save it in Grade.xls.
Ans:- A Report card is an individual summary of each student’s academic performance. In other words, it is the assessment report of each student that depicts his overall performance in any particular assessment exam.
Click here to Exel file Jagjit_Kumar_36964.xlsx
Compute the grades based on the following criteria
-
- If percentage>=90 then grade=A
- If percentage >=80 and <90 then grade=B
- If percentage >=70 and <80 then grade=C
- If percentage >=60 and <70 then grade=D
- If percentage < 60 then grade=E
- Generate the relevant chart to compare the performance of students.
Generate the relevant chart to compare the performance of students.
Q4. Use MS-PowerPoint to create a presentation on any relevant topic of your choice and apply the following:
Ans:- MS-PowerPoint File Attached to this pdf or check click link below …….
Q5. WAP to demonstrate the nested if-else statement.
There are three forms of if...else
statements in C++.
if
statementif...else
statementif...else if...else
statement
the nested if-else statement Output
Q6, WAP to create an arithmetic calculator using the switch-case statement
C program to create a menu-driven calculator (add, subtract, multiply and divide) using switch case and functions. The calculator should input two numbers and an operator from the user.
<number 1> <operator> <number 2>
- Input two numbers and a character from the user in the given format. Store them in some variable say num1, op, and num2.
- Switch the value of op i.e.
switch(op)
. - There are four possible values of op i.e. ‘+’, ‘-‘, ‘*’, and ‘/’.
- For
case '+'
perform addition and store result in some variable i.e.result = num1 + num2
. - Similarly for
case '-'
perform subtraction and store result in some variable i.e.result = num1 - num2
. - Repeat the process for multiplication and division.
- Finally, print the value of the result.
Calculator Code by Jagjit Kumar 36964
/**
* WAP to create an arithmetic calculator using the switch-case statement Jagjit Kumar Pu pin 36964
*/
#include <stdio.h>
/**
* Function declarations for calculator
*/
float add(float num1, float num2);
float sub(float num1, float num2);
float mult(float num1, float num2);
float div(float num1, float num2);
int main()
{
char op;
float num1, num2, result=0.0f;
/* Print welcome message */
printf("JAGJIT KUMAR PU PIN 36964\n");
printf("----------------------------\n");
printf("Enter [number 1] [+ - * /] [number 2]\n");
/* Input two number and operator from user */
scanf("%f %c %f", &num1, &op, &num2);
switch(op)
{
case '+':
result = add(num1, num2);
break;
case '-':
result = sub(num1, num2);
break;
case '*':
result = mult(num1, num2);
break;
case '/':
result = div(num1, num2);
break;
default:
printf("Invalid operator");
}
/* Print the result */
printf("%.2f %c %.2f = %.2f", num1, op, num2, result);
return 0;
}
/**
* Function to add two numbers
*/
float add(float num1, float num2)
{
return num1 + num2;
}
/**
* Function to subtract two numbers
*/
float sub(float num1, float num2)
{
return num1 - num2;
}
/**
* Function to multiply two numbers
*/
float mult(float num1, float num2)
{
return num1 * num2;
}
/**
* Function to divide two numbers
*/
float div(float num1, float num2)
{
return num1 / num2;
}
Out Put Calculator
Q7. WAP to print Fibonacci series (up to 100): 0, 1, 1, 2, 3, 5, 8, 13, 21,….
Ans
Code By Jagjit Kumar 36964
#include<stdio.h> #include<conio.h> void main () { int i, n, x=0, y=1, z; clrscr(); printf("enter the number of terms:"); scanf("%d", &n); printf("Fibonacci series; \n"); for(i=1; i<=n; i++) { printf("%d,",x); z=x*y; x=y; y=z; } getch(); }
print Fibonacci series (up to 100): 0, 1, 1, 2, 3, 5, 8, 13, 21,…. Output
Q8. WAP to create an array of n elements, take input from the user and print the elements on the screen.
Ans
In C++, an array is a variable that can store multiple values of the same type. For example,
Suppose a class has 27 students, and we need to store the grades of all of them. Instead of creating 27 separate variables, we can simply create an array:
In C++, each element in an array is associated with a number. The number is known as an array index. We can access elements of an array by using those indices.
- Arrays have 0 as the first index, not 1. In this example, mark[0] is the first element.
- If the size of an array is n, to access the last element, the
n-1
index is used. In this example, mark[4] - Suppose the starting address of
mark[0]
is 2120d. Then, the address of themark[1]
will be 2124d. Similarly, the address ofmark[2]
will be 2128d and so on.
This is because the size of afloat
is 4 bytes.
#include <stdio.h> int main() { int a[1000],i,n; printf("Enter size of array: "); scanf("%d",&n); printf("Enter %d elements in the array : ", n); for(i=0;i<n;i++) { scanf("%d", &a[i]); } printf("\nElements in array are: "); for(i=0;i<n;i++) { printf("%d ", a[i]); } return 0; }
Q9. WAP to perform addition of two matrices (take input from the user)
Algorithm to add two matrices
- Input matrix 1 and matrix 2.
- If the number of rows and number of columns of matrix 1 and matrix 2 is equal,
- for i=1 to rows[matrix 1]
- for j=1 to columns [matrix 1]
- Input matrix 1 [i,j]
- Input matrix 2 [i,j]
- matrix 3 [i,j]= matrix 1 [i,j]+ matrix 2 [i,j];
- Display matrix 3 [i,j];
Perform addition of two matrices (take input from the user) Output
Q10. WAP to demonstrate bubble sort.
Ans
Bubble sort is also known as sinking sort. This algorithm compares each pair of adjacent items and swaps them if they are in the wrong order, and this same process goes on until no swaps are needed. In the following program, we are implementing bubble sort in C language. In this program, the user would be asked to enter the number of elements along with the element values and then the program would sort them in ascending order by using bubble sorting algorithm logic.
Bubble sort algorithm
- Start at index zero, compare the element with the next one (a[0] & a[1] (a is the name of the array)), and swap if a[0] > a[1]. Now compare a[1] & a[2] and swap if a[1] > a[2]. Repeat this process until the end of the array. After doing this, the largest element is present at the end. This whole thing is known as a pass. In the first pass, we process array elements from [0,n-1].
- Repeat step one but process array elements [0, n-2] because the last one, i.e., a[n-1], is present at its correct position. After this step, the largest two elements are present at the end.
- Repeat this process n-1 times.
Bubble sort Optput
Q11, WAP to create a file and perform write and read operations.
Ans:-
file management functions available in ‘C,’
function | purpose |
fopen () | Creating a file or opening an existing file |
fclose () | Closing a file |
fprintf () | Writing a block of data to a file |
fscanf () | Reading a block of data from a file |
getc () | Reads a single character from a file |
putc () | Writes a single character to a file |
getw () | Reads an integer from a file |
putw () | Writing an integer to a file |
fseek () | Sets the position of a file pointer to a specified location |
ftell () | Returns the current position of a file pointer |
rewind () | Sets the file pointer at the beginning of a file |
Create a file in a ‘C’ program
FILE *fp; fp = fopen ("file_name", "mode");
The type file Mode in ‘C’ program
File Mode | Description |
r | Open a file for reading. If a file is in reading mode, then no data is deleted if a file is already present on a system. |
w | Open a file for writing. If a file is in writing mode, then a new file is created if a file doesn’t exist at all. If a file is already present on a system, then all the data inside the file is truncated, and it is opened for writing purposes. |
a | Open a file in append mode. If a file is in append mode, then the file is opened. The content within the file doesn’t change. |
r+ | open for reading and writing from the beginning |
w+ | open for reading and writing, overwriting a file |
a+ | open for reading and writing, appending to file |
To create file
#include <stdio.h> int main() { FILE *fp; fp = fopen ("c://cscfile.txt", "w"); }
Write and read operations
#include <stdio.h> int main() { FILE * fp; char c; printf("File Handling\n"); //open a file fp = fopen("cscfile.txt", "w"); //writing operation while ((c = getchar()) != EOF) { putc(c, fp); } //close file fclose(fp); printf("Data Entered:\n"); //reading fp = fopen("cscfile.txt", "r"); while ((c = getc(fp)) != EOF) { printf("%c", c); } fclose(fp); return 0; }
Types of Files
When dealing with files, there are two types of files you should know about:
1. Text files
2. Binary files
For read and writing to a text file, we use the functions fprintf() and fscanf(). They are just the file versions of printf() and scanf(). The only difference is that fprint() and fscanf() expect a pointer to the structure FILE.
Note– Mam This Is My Website Thank You