Pages

Tuesday, November 29, 2011

IT job roles

Programmers

·         Assist systems analysts in defining requirements of users of the proposed IT system.
·         Create a detailed design for the proposed system.
·         Translate specifications - for a software product or project - given by the systems analyst into lines of code i.e. programs.
·         Modify code to correct errors or to enhance a program’s capabilities.
·         Test programs already developed.
·         Prepare documentation for the program developed & designed.
·         This is an entry-level IT job. Programmers may also be called software engineers, web developers, etc. depending on the specific job content.

To be successful as a programmer, you need certain professional qualities:

·         Technical aptitude
·         Logical approach to solving problems
·         Ability to work independently as well as be a team player
·         Good communication skills, written as well as oral, are a plus point
·         Willingness to continuously learn since technology keeps changing

Web developers
These are programmers who work on online (web) applications.

·         They create prototypes of the site based on the site’s objectives.
·         Depending on the website, developers may have to develop interactive forms, shopping carts, mailing lists & online programs.
·         They use programming languages (such as Java, VB Script, MS-SQL, MySQL CGI, Perl, Visual C++, C#, SQL, JSP, ASP.NET, PHP, XML & DHTML) to create these programs & applications.
System analysts


·         System analysts study the needs of users of the system & define their requirements through documents/ processes.
·         These documents are then used by the programming team to create a better system.
Software testing & Quality Assurance
Software is tested by 'Software Testers' to confirm if it has been built as planned & is performing well. This includes finding software 'bugs'. Software is put through several types of tests. Various manual methods & automated tools are used for this.
      Software Quality Assurance involves the entire software development process & is oriented towards prevention of problems.
Quality Asssurance (QA) professionals
·         Monitor & improve the processes by which software is created.
·         Make sure that any agreed-upon standards & procedures are followed.
·         Ensure that problems are found & dealt with.
Database analysts, architects & administrators

Data is core to any IT application. Data professionals make sure that users can access & manage data in a flexible, efficient & secure manner.
They:
·         Analyze & design databases.
·         Develop, install & implement databases.
·         Perform database administration & maintainance to ensure data integrity.
·         Perform database testing.
·         Provide data assurance i.e. security of data.

      Software Architects, Solution builders & Consultants
These are senior job roles.
Software Architects have a deep understanding of a single technology area.

Solution builders understand a wide range of technologies & pull them together to create a solution to a customer problem.

Consultants not only have a broad knowledge of technology, they usually have deep knowledge of a particular industry or business.
Project Managers 
·         Programmers/ software engineers usually work in teams. Each project team may consist of 10 to 15 engineers & is headed by a project leader. Two, three or more project teams are together supervised by a project manager. Delivery managers are senior people who supervise several project groups & coordinate with the sales people in the company and with the client.
·         A software engineer can choose to follow the 'management path' & grow into a project leader and then into a project manager. Or he or she can follow the 'technical path' & become a database specialist, software architect or a specialist in a given technology.
Technical writers & Documentation specialists  
·         They create manuals for users to:
·         Develop documents for each project/ application.
·         Maintain copies of all documents developed for future use.

Helpdesk & Technical support
·         Help install, maintain & repair PCs, printers and other devices, LAN, Wide Area Networks (WAN).
·         Ensure Internet connectivity.
·         Are usually available immediately to resolve hardware & connectivity problems. Software or hardware installed at a customer’s premises may require support of the following types: installation, configuration. troubleshooting, customer queries or training.
Management Information Systems (MIS) 
·         To manage any organization, its managers need information about its various activities e.g. sales, finance, purchase, HR. This information is usually got from data & reports from the organization’s computer network/ system.
·         Some of the entry-level MIS jobs are data analysts & data entry operators.
   
Other IT jobs
IT people may also work in sales & marketing or as faculty i.e. in teaching or as trainers. They can also work in hardware & networking jobs such as network administrators or system administrators

Sunday, November 6, 2011

Writing a Binary File - Using write()

Lets write a code to store some data in a file in binary mode using the write()

Example 1

#include "iostream.h"
#include "fstream.h"
#include "conio.h"
class person
{
 char name[10],addr[20];
 int age;
public:
 void getpers()
 {
  cout<<"\nEnter name : ";
  cin>>name;
  cout<<"\nEnter address : ";
  cin>>addr;
  cout<<"\nEnter age : ";
  cin>>age;
 }

void showpers()
{
cout<<"\Name : "<<name;
cout<<"\nAddress : "<<addr;
cout<<"\nAge : "<<age;
}
};
void main()
{
clrscr();
person pers;
pers.getpers();
ofstream out("list",ios::app);
out.write((char *)&pers,sizeof(person));
cout<<"\nData Saved In File ";
out.close();
}

When the above code is run, it asks the user to enter name,address and age of a person and the same data is stored in a file called "list". The message "Data Saved In File" confirms that the data has been saved in the file.
Point to remember
After compiling the above code a new file named "list" is created and the data is stored in it. To verify that the file has been created and data stored, if you try to open the file using normal methods, for example, go to DOS Shell and type the command "type list",  you will see that the file contains data that is not readable by us. Why ? because the data is stored using the "write()" function which is a binary function. To read such a file we will use some functions that are able to process binary files. Have a look at the next post.

Binary Files

In the earlier posts, I wrote about handling text or character files. Now is the time to learn another type of file handling - Binary File Handling.

 
What is a Binary File
All the files that we use are not text or char files. We don't "read" all the files, some of them are "heard" or "viewed"  also like audio, picture or video files. A char file is something that stores only char data that can be easily read using a basic text editor whereas a binary file can be a collection of text, char or audio, video etc.In binary files, to input and output data with the extraction and insertion operators (<< and >>) and functions like getline is not efficient, since we do not need to format any data, and data may not use the separation codes used by text files to separate elements (like space, newline, etc...).
 
File streams include two member functions specifically designed to input and output binary data sequentially: write and read. The first one (write) is a member function of ostream inherited by ofstream. And read is a member function of istream that is inherited by ifstream. Objects of class fstream have both members. Their prototypes are:
 
write ( memory_block, size );
read ( memory_block, size );
 
 
Where memory_block is of type "pointer to char" (char*), and represents the address of an array of bytes where the read data elements are stored or from where the data elements to be written are taken. The size parameter is an integer value that specifies the number of characters to be read or written from/to the memory block.
Binary files are very similar to arrays of structures, except the structures are in a disk-file rather than an array in memory. Binary files have two features that distinguish them from text files:
  1. You can instantly use any structure in the file.
  2. You can change the contents of a structure anywhere in the file.
Why Should I use Binary Files Handling Functions
The answer is quite simple - If you use the functions like put() or get() , you can only handle characters or strings since these functions only know how to handle chars. So if a user wishes to input an integer or float value, these function will show their incapability in processing the same. On the other hand using binary file handling functions, we can easily process data of any type, be it integer, float, char or string.

Binary File Handling Functions
To read or write data in binary form the following functions are used
  1. write : To write the data in a file in binary format
  2. read : To read the data from a file in binary format.

Reading a binary file - Using read()

A file that has been created using binary functions like "fwrite" can only be read using the "fread" function that can read or process a binary file. Following is the same code that was given in the previous post "Writing a binary file - Using write()". If you look at the end of the code you will see that there some additional statements there.
Example 1

#include "iostream.h"
#include "fstream.h"
#include "conio.h"
class person
{
char name[10],addr[20];
int age;
public:
void getpers()
{
cout<<"\nEnter name : ";
cin>>name;
cout<<"\nEnter address : ";
cin>>addr;
cout<<"\nEnter age : ";
cin>>age;
}


void showpers()
{
cout<<"\Name : "<<name;
cout<<"\nAddress : "<<addr;
cout<<"\nAge : "<<age;
}
};
void main()
{
clrscr();
person pers;
pers.getpers();
ofstream out("list",ios::app);
out.write((char *)&pers,sizeof(person));
cout<<"\nData Saved In File ";
out.close();// closing the file from write mode
// READING SECTION
 ifstream in("list"); // reopening the file in read mode
 in.read((char *)&pers,sizeof(person)); // reading the data using the read() function
 pers.showpers(); // displaying the data
 in.close(); //closing the file again

}

The above code first opens the file in the write() mode, gets the data from the user, stores into the file and then reopens the file to read the data. When the data is read using the read() function, the data will be displayed exactly as it as entered. Therefore keep in mind "if written using write(), use read()"

Thursday, October 20, 2011

Copying a file

To copy the contents of a file to another, we will use both get() and put() in the same code. To make this program, we will open two files at the same time , the source file(the one that we want to copy) and the target file(the file that will contain the copied data). The source file will be opened in the read mode(using ifstream) whereas the target file will be accessed in the write mode(using ofstream).

Have a look at the code

#include "iostream.h"
#include "conio.h"
#include "fstream.h"
void main()
{
 clrscr();
 int cnt=0;
 ifstream in("file1.txt"); // source file (must be existing)
 ofstream out("file2.txt"); // target file (will be automatically created)
 char ch;
 in.get(ch); // reading from the source file
 while(in)
 {
  out.put(ch); // writing in the target file
  in.get(ch); // reading the next char from the source file
  cnt++;
 }
 cout<<"\nCopied "<<cnt "<<"" characters="" characters?;="" copied. in.close();
 out.close();
}


Output : (Assuming that the source file has 30 characters)
Copied 30 characters

The above code will open two files - source(file1.txt) and target(file2.txt). The get() will read a character from the first file and store it in the variable "ch". The put() will copy the content of the variable "ch" into the target file. The process will continue till the first file gets completely read.Once the program completes its execution we can open the target file to see if the copy was correct or not.



Word Count Program Using get()

Using the get() we can easily write a program that can count the number of characters in a file. This will be quite similar to the Word Count option available in Ms-Word.


#include "conio.h"
#include " ctype.h" // for character functions
#include "iostream.h"
#include "fstream.h"
void main()
{
 clrscr();
 ifstream in("file1.txt"); // name of any existing file
 int chars=0,caps=0,small=0,num=0,space=0;
 char ch;
 in.get(ch);
 while(in)
 {
  if(isalpha(ch))
  {
   chars++;
   if(isupper(ch))
    caps++;
   else if(islower(ch))
    small++;
  }
  else if (isdigit(ch))
   num++;
  else if(isspace(ch))
   space++;
  in.get(ch);
 }
 cout<<"\nStatistics ";
 cout<<"\n============";
 cout<<"\nTotal Chars : "<<chars;
 cout<<"\nCapital Letters : "<<caps;
 cout<<"\nSmall Letters : "<<small;
 cout<<"\nDigits : "<<num;
 cout<<"\nSpaces : "<<space;
 in.close();

}

Output
Statistics
==========
Total Chars : 40
Capital Letters : 20
Small Letters : 10
Digits : 5
Spaces : 5

The above code will first open the file in read mode and start reading the file one char at a time using the "get()". The read char will be checked to see whether it is a capital or small letter, a digit or a space. Wehave declared different counter variables to count each type of char, for example the variable "caps" will count the capital letters while "small" is used to check small letters. To check a character, the character functions "isupper()","islower()" have been used. These are boolean functions and return their value in true/false. We can also use manual comparison statements like "if(ch>='A' && ch<='Z') etc.

Tuesday, October 18, 2011

Reading a complete file using get()

Reading the whole file using get()

The get() can not read more than one character at a time , therefore we must use a loop to read the file. The while loop is most suitable for reading a file since we don't know how much data is there in the file.

#include "conio.h"
#include "iostream.h"
#include "fstream.h"
void main()
{
 clrscr();
 ifstream in("file1.txt");
 char c;
 in.get(c);
 while(in)
 {
  cout<<c;
  in.get(c);
 }
 in.close();
}

Output (Assuming that the file contains a word "Welcome")
Welcome

The while loop will run as long as the file contains the data. The get() function will read all the contents of the file till the its end.