Program to access file system, C/C++ Programming

The program must use the file named on the command line as its input file. Suppose the program is named pdbtool. Then if the user types pdbtool 1A36.pdb the program must read the data in 1A36.pdb. If the file argument is missing, or if the file does not exist or cannot be opened for reading, the program should quit with an appropriate error message. The program should be robust enough that if the file is not a PDB file, it will not crash. This will require no extra effort if the program is designed to look only for the ATOM and HETATM records in the file. The program can assume that all ATOM records are in the correct format; it does not have to check that the lines follow that format.

The program should read the data in the PDB file, and for each distinct atom in the file, store a record for that atom in an array of atom records. The program can assume that the file contains only a single model, and that each ATOM record in the file identifies a distinct atom. For each atom, the program will need to store:

_ The atom's serial number

_ The three-letter name of the amino acid to which it belongs (e.g., ARG)

_ The atom's three coordinates (x,y,z)

_ The atom's one- or two-letter element name (e.g. C, O, N, Na)

After reading all of the data the program must display a message indicating how many atom records were created, such as 5285 atoms recorded.

The program will prompt the user to enter a command, with a short and simple prompt such as

command:

The user will be allowed to enter one of the following commands:

freq

length

density d

quit

If the user enters _freq_ the program displays, for each distinct element in the _le, a line of the form element: n where n is the number of atoms of that element. Sample output could be same.

Posted Date: 3/19/2013 3:42:10 AM | Location : United States







Related Discussions:- Program to access file system, Assignment Help, Ask Question on Program to access file system, Get Answer, Expert's Help, Program to access file system Discussions

Write discussion on Program to access file system
Your posts are moderated
Related Questions
#question.College life is tough. Eating pizza for every meal is hitting you hard. You are looking at working out to stay healthy. You found a web site that tells you how many ca

A: In C++, the definition of NULL is 0, thus there is only an aesthetic difference. I prefer to ignore macros, so I employ 0. Another difficulty with NULL is that people sometimes

A Network of routers have been configured for the purposes of handling data traffic within your company. You would like to have an application that does a network

FUNCTIONS It refers to a subprogram that is meant to do a certain task. It is basically used to execute a set of operations and return information to the main or calling functio

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on enumeration types that are incorrect/unsafe things to

how to make the coding

Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) {             int temp;             temp=*a;

construct a console programme for a bank ATM machine.

The task consists of two parts which are both preferably implemented in one source file. Towards the end of this document you will find a code skeleton that you must assume. Start