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
write a c++ program, that finds the minimum total number of shelves, including the initial one, required for this loading process.

It tells the compiler that a variable or a function exists, even if the compiler hasn't yet seen it in the file presently being compiled. This variable or function may be distinct

Question 1: (a) Explain clearly the following concepts using suitable examples of your own:- (i) concrete class v/s abstract class (ii) constructor v/s over

Question Write a program using c++ for the above function , at a= 1000, b=10 -3 ,10 -2 ,10 -4

program of area under integration

THIS PROGRAM IS TO ADD THE TWO COMPLEX NO.S GIVEN BY THE USER  */ #include #include #include struct complex     {     int real;     int imag;     }; void main()  {  clrs

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Implement (a part of) electronic election Scenario where following political parties are participating in election: PPP, PML and PTI.  Create a class PollingStation where it stor

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

I hv an assignment to do, I almost done. But i cant find whats wrong- my code is to make a simple calculator using function''s all 4 patterns. I did like this- #include int add