Categories
Uncategorised

Chemistry Qualitative Salt Analysis Cheatsheet

Download the Chemistry Qualitative Salt Analysis Cheatsheet

The Short Story:
Here’s a cheatsheet for qualitative salt analysis with all the common ions and tests included. I left out the ones which are generally not done at school, but in case you feel that I should include something, change any content, etc your suggestions are welcome.

The Long Story:
It’s a known fact that I don’t attend far too many classes at school; and I’m constantly in need of notes and such stuff from others. Having done this for quite a few years, I’ve got into a habit of creating ‘cheatsheets’ for referring to before exams, because I hardly remember anything any day. Take for example the chemistry practicals, almost all of which I didn’t attend last year (and only one of organic this year).

Thus, for today’s chemistry practical (which went sorta fine except I’m not sure of my cation), I made a reference sheet for qualitative salt analysis. I wouldn’t have done it, but the Web doesn’t seem to have any good stuff on this. The upshot was that I was working till 1.42 am typing out stuff that I dozed off at the computer table itself. I’d though it was a nice idea to do it, it’d help me remember the things too, but argh, those bloody subscript and superscript almost killed me.

This stuff is really useful for CBSE class 11 and 12 students, for the qualitative salt analysis practicals; and I guess for other folks interested in chemistry too. Feedback and suggestions for improvement are welcome.

Update 1: I made a cellphone version of the salt analysis cheatsheet too.
Update 2: The cheatsheet has been updated. It’s now been condensed to a four-page affair, and some useless footnotes have been removed. A few tips have been added towards the end. In case you’re (still) interested in the old one, download version 1 of salt analysis cheatsheet.

Update 3: Kartik Mankad has informed me of some possible discrepancies in the cheatsheet. I’ll repeat them from everyone’s benefit here – but I haven’t checked this out in a lab. There might be a few things I skipped because our teachers told us not to bother with them. Kartik’s given some nice tips though. Thanks!

  1. Sulphite, nitrite, and sulphide are not in CBSE course.
  2. As mentioned right under the heading of ‘cations’ it says, “When phosphate is detected cations of group 3 and later are absent”. This rule is violated for many salts, for example nickel phosphate.
  3. The procedure for ring test is mentioned wrong. Our teacher specifically said NOT to add HNO3 and use only H2So4.
  4. Under flame test you may also add Pb salts, which give a bluish white flame.
  5. Deliquescence (the ability to absorb moisture) is a great tool in determining the salt/group. Example, Mg salts are HIGHLY deliquescent. MgCl2 makes the filter paper (on which it is kept) wet in minutes.
Categories
Uncategorised

Binary Files – Book Database

/* Copyright (C) 2007 Ankur Banerjee. This program is free software: you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GNU General Public License see http://www.gnu.org/licenses/gpl.html /

/ Binary Files – Book Database Management. Give user option to create, append, read, edit, insert, delete, search, and count total number of records. /

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

class book
{
int bookid, noofpages;
char name[21];
public:
void getdata()
{
cout<<endl<<“Enter book ID : “;
cin>>bookid;
cout<<“Enter book name : “;
gets(name);
cout<<“Enter number of pages in book : “;
cin>>noofpages;
}
void disp()
{
cout<<endl<<“Displaying data for book”
<<endl<<“Book ID : “<<bookid
<<endl<<“Book name : “<<name
<<“\nNumber of pages : “<<noofpages<<endl;
}
char
retname()
{
return name;
}
int retid()
{
return bookid;
}
} obj1, obj2;

char ans;
fstream file, temp;
int ch, flag, r, rec;

void create()
{
file.open(“data”,
ios::out | ios::binary);
do
{
obj1.getdata();
file.write((char)&obj1, sizeof(obj1));
cout<<“Do you wish to enter another record? (y/n): “;
cin>>ans;
} while (ans == ‘y’ || ans == ‘Y’);
file.close();
}

void append()
{
file.open(“data”, ios::app);
do
{
obj1.getdata();
file.write((char
)&obj1, sizeof(obj1));
cout<<“Do you wish to enter another record? (y/n): “;
cin>>ans;
} while (ans == ‘y’ || ans == ‘Y’);
file.close();
}

void showfile()
{
file.open(“data”, ios::in);
while (file.read((char)&obj1, sizeof(obj1)))
obj1.disp();
file.close();
}

void rewrite()
{
temp.open(“new”, ios::in);
file.open(“data”, ios::out);
temp.seekg(0);
while (temp.read((char
)&obj2, sizeof(obj2)))
file.write((char)&obj2, sizeof(obj2));
file.close();
temp.close();
remove(“new”);
}

void editrec()
{
file.open(“data”, ios::in);
temp.open(“new”, ios::out);
r = 0;
cout<<endl<<“Enter record number to edit : “;
cin>>rec;
file.seekg(0);
while (file.read((char
)&obj2, sizeof(obj2)))
{
r++;
if (r == rec)
{
cout<<endl<<“Enter new details”;
obj1.getdata();
temp.write((char)&obj1, sizeof(obj1));
}
else temp.write((char
)&obj2, sizeof(obj2));
}
file.close();
temp.close();
rewrite();
cout<<“\nRecord you wanted to edit has been edited\n”;
}

void delrec()
{
file.open(“data”, ios::in);
temp.open(“new”, ios::out);
r = 1;
cout<<endl<<“Enter record number to delete : “;
cin>>rec;
file.seekg(0);
while (file.read((char)&obj2, sizeof(obj2)))
{
if (r != rec)
temp.write((char
)&obj2, sizeof(obj2));
++r;
}
file.close();
temp.close();
rewrite();
cout<<“\nRecord you requested to be removed has been deleted\n”;
}

void insrec()
{
file.open(“data”,
ios::in);
temp.open(“new”,
ios::out);
r = 0;
cout<<endl<<“Enter position at which you want to insert new record : “;
cin>>rec;
file.seekg(0);
while (file.read((char)&obj2,
sizeof(obj2)))
{
r++;
if (r == rec)
{
cout<<endl<<“Enter details of new record :”;
obj1.getdata();
temp.write((char
)&obj1, sizeof(obj1));
temp.write((char)&obj2, sizeof(obj2));
}
else temp.write((char
)&obj2, sizeof(obj2));
}
file.close();
temp.close();
rewrite();
cout<<“\nRecord has been inserted\n”;
}

void insafterid()
{
file.open(“data”, ios::in);
temp.open(“new”, ios::out);
cout<<“\nEnter book ID after which you want to insert new record : “;
cin>>rec;
file.seekg(0);
while (file.read((char)&obj2, sizeof(obj2)))
{
if (obj2.retid() != rec)
temp.write((char
)&obj2, sizeof(obj2));
else
{
cout<<endl<<“Enter details for new record :”;
obj1.getdata();
temp.write((char)&obj2, sizeof(obj2));
temp.write((char
)&obj1, sizeof(obj1));
}
}
file.close();
temp.close();
rewrite();
cout<<“\nRecord has been inserted\n”;
}

void search()
{
file.open(“data”, ios::in);
cout<<endl<<“Search according to”
<<endl<<“\t1. ID”
<<endl<<“\t2. Name”
<<endl<<“Enter your choice : “;
cin>>ch;
switch(ch)
{
case 1 : int id;
flag = 0;
cout<<endl<<“Enter ID to search for : “;
cin>>id;
while (file.read((char)&obj1, sizeof(obj1)))
{
if (obj1.retid() == id)
{
obj1.disp();
flag = 1;
}
}
file.close();
if (flag == 0)
cout<<“\nID you entered does not exist\n”;
break;
case 2 : char nm[21];
flag = 0;
cout<<endl<<“Enter name to search for : “;
gets(nm);
while (file.read((char
)&obj1, sizeof(obj1)))
{
if (strcmp(obj1.retname(),nm)
== 0)
{
obj1.disp();
flag = 1;
}
}
file.close();
if (flag == 0)
cout<<“\nName you entered does not exist\n”;
break;
default : cout<<endl<<“You entered an incorrect choice”<<endl;
}
}

void countrec()
{
r = 0;
file.open(“data”, ios::in);
while (file.read((char)&obj1, sizeof(obj1)))
++r;
file.close();
cout<<endl<<“Number of records is “<<r<<endl;
}

void main()
{
clrscr();
do
{
cout<<endl<<“Book Data Management Program”
<<endl<<“1. Create file”
<<endl<<“2. Append file”
<<endl<<“3. Read file”
<<endl<<“4. Edit nth record”
<<endl<<“5. Delete nth record”
<<endl<<“6. Insert record at nth position”
<<endl<<“7. Insert record after a book ID”
<<endl<<“8. Search for a book”
<<endl<<“9. Count total number of records”
<<endl<<“Enter your choice : “;
cin>>ch;
switch(ch)
{
case 1 : create();
break;
case 2 : append();
break;
case 3 : showfile();
break;
case 4 : editrec();
break;
case 5 : delrec();
break;
case 6 : insrec();
break;
case 7 : insafterid();
break;
case 8 : search();
break;
case 9 : countrec();
break;
default : cout<<endl<<“You entered an incorrect choice”;
}
cout<<“\nDo you want the menu to be shown again? (y/n): “;
cin>>ans;
} while (ans == ‘y’ || ans == ‘Y’
);
getch();
}

/ Output /

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 1

Enter book ID : 1
Enter book name : Physics
Enter number of pages in book : 145
Do you wish to enter another record? (y / n): y

Enter book ID : 2
Enter book name : Chemistry
Enter number of pages in book : 214
Do you wish to enter another record? (y / n): n

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 2
Book name : Chemistry
Number of pages : 214

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 4

Enter record number to edit : 2

Enter new details
Enter book ID : 2
Enter book name : Biology
Enter number of pages in book : 247

Record you wanted to edit has been edited

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 2
Book name : Biology
Number of pages : 247

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 6

Enter position at which you want to insert new record : 2

Enter book ID : 3
Enter book name : Chemistry
Enter number of pages in book : 458

Record has been inserted

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 3
Book name : Chemistry
Number of pages : 458

Displaying data for book
Book ID : 2
Book name : Biology
Number of pages : 247

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 7

Enter book ID after which you want to insert new record : 3

Enter book ID : 4
Enter book name : Math
Enter number of pages in book : 367

Record has been inserted

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 3
Book name : Chemistry
Number of pages : 458

Displaying data for book
Book ID : 4
Book name : Math
Number of pages : 367

Displaying data for book
Book ID : 2
Book name : Biology
Number of pages : 247

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 5

Enter record number to delete : 2

Record you requested to be removed has been deleted

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 4
Book name : Math
Number of pages : 367

Displaying data for book
Book ID : 2
Book name : Chemistry
Number of pages : 247

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 9

Number of records is 3

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 8

Search according to
1. ID
2. Name
Enter your choice : 1

Enter ID to search for : 1

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 8

Search according to
1. ID
2. Name
Enter your choice : 2
Enter name to search for : Math

Displaying data for book
Book ID : 4
Book name : Math
Number of pages : 367

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 2

Enter book ID : 5
Enter book name : English
Enter number of pages in book : 847
Do you wish to enter another record? (y / n): n

Do you want the menu to be shown again? (y / n) : y

Book Data Management Program
1. Create file
2. Append file
3. Read file
4. Edit nth record
5. Delete nth record
6. Insert record at nth position
7. Insert record after a book ID
8. Search for a book
9. Count total number of records
Enter your choice : 3

Displaying data for book
Book ID : 1
Book name : Physics
Number of pages : 145

Displaying data for book
Book ID : 4
Book name : Math
Number of pages : 367

Displaying data for book
Book ID : 2
Book name : Chemistry
Number of pages : 247

Displaying data for book
Book ID : 5
Book name : English
Number of pages : 847

Do you want the menu to be shown again? (y / n) : n

/ Program limitations – Only a basic amount of error-handling has been built in. */