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

Assignment Help:

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.


Related Discussions:- Program to access file system

C program to replace every occurrence of in a string, Program is to replace...

Program is to replace every occurrence of in a string: Program is to replace every occurrence of c1 in string with c2 and have function return the no. of replacement int re

Named what can derived class add?, New data members  New member function...

New data members  New member functions  New constructors and destructor  New friends

What is the best fit algorithm, The Best fit algorithm: The best fit metho...

The Best fit algorithm: The best fit method occurs the smallest free block whose size is greater than or equivalent to n. An algorithm to get such a block by traversing the whole

Described multiple inheritance(virtual inheritance)?, Described multiple in...

Described multiple inheritance(virtual inheritance)? And explain its advantages and disadvantages? A: It is the procedure in which a child can be derived from more than one pare

Determine the capacitor voltage by c program, Write a program to determine ...

Write a program to determine V c for a given value of time (t)   #include stdio.h #include math.h void main() {      char prompt;   float vs,cr,t,vc;   /* input time */

C code, how can i easily make a program?

how can i easily make a program?

I need website with built in scraper, I need Website with built in scraper ...

I need Website with built in scraper Project Description: The coding skills mentioned above are just possibly ones that will be used. Skills required are ASP, C++ Programm

Computer Science 101, This is what I need help with. "Create a program cre...

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

Explain the new and delete operators, The new and delete operators The ...

The new and delete operators The C language has explained library functions- malloc() and free() for dynamic allocation and de-allocation of memory. C++ gives yet another appro

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd