Write script readpatwts that will first attempt to open file

Assignment Help Basic Computer Science
Reference no: EM13854497

For a biomedical experiment, the names and weights of some patients have been stored in a file patwts.dat. For example, the file might look like this:

Darby George   166.2

Helen Dee  143.5

Giovanni Lupa   192.4

Cat Donovan   215.1

Create this data file first. Then, write a script readpatwts that will first attempt to open the file. If the file open is not successful, an error message should be printed. If it is successful, the script will read the data into strings, one line at a time. Print for each person the name in the form ilast,firsti followed by the weight. Also, calculate and print the average weight. Finally, print whether or not the file close was successful. For example, the result of running the script would look like this:

>> readpatwts

George,Darby 166.2

Dee,Helen 143.5

Lupa,Giovanni 192.4

Donovan,Cat 215.1

The ave weight is 179.30

File close successful

Reference no: EM13854497

Questions Cloud

Amount of the capitalization of retained earnings : What is the amount of the capitalization of retained earnings for the stock dividend?
What is the relationship between vengeance and honor : Is Achilles' continued withdrawal from the army justified? Does his reaction to the violation of the heroic code give him heroic stature? What is the relationship between vengeance and honor that Achilles seems to pursue? Is this problematic at al..
Write a brief response on only the good die young : write a brief response on Violence is better than reason in dealing with dangerous situations.
Explain explain of a chronic disease surveillance system : When thinking about chronic diseases, how do you perceive the purpose and utility of passive surveillance as an epidemiological tool. Explain with an example of a chronic disease surveillance system. Would you advocate the reporting of select chro..
Write script readpatwts that will first attempt to open file : Create this data file first. Then, write a script readpatwts that will first attempt to open the file. If the file open is not successful, an error message should be printed.
Explain the patterns of variation in a population : A detailed description of the data in terms of person, place, and time. A detailed description of the potential problems relating to the completeness and quality of data. A description of how the potential problems can influence the way you use dat..
Consider the purpose and audience in determining : Consider the purpose and audience in determining the necessary information
Differences between public health and acute care healthcare : What are the similarities and differences between Public Health and Acute Care Healthcare. What are the advantages and disadvantages of each
Would you say that products advertised are high involvement : Watch the videos and analyze the commercials. Would you say that the products advertised are high or low involvement? Why?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Construct and describe a tree

Construct and describe a tree that indicates the following: A college president has 2 employees who answer directly to him or her, namely a vice president and provost. The vice president and provost each have an administrative assistant.

  Generalized statements relating to a group of people

Identify the rhetorical strategy in each of the following statements. 1. I did not say the meat was tough. I said I did not see the horse that is usually outside (W. C. Fields). _________________ 2. Have you stopped beating your wife? ____..

  Explain two standard apis supported by jaxp

Explain two standard APIs supported by JAXP (Java API for XML processing) and give a comprison between two mechanism.

  Write a function to evaluate a polynomial

Write a function to evaluate a polynomial at a given real value a. That is define a function eval(P,a) that takes a list (polynomial) P and a given real number a, and computes P(a).

  What is the result of issuing 0x08 function code

In a SCADA system, what is the result of issuing 0x08 function code followed by a 0x01 subfunction code on a slave using Modbus?

  Stage of ec purchase decision-making process

Banner advertising on Websites helps trigger a realization taht there is a gap between reality and a desired state, which occurs in the ______ stage of the EC purchase decision-making process.

  Create a class titled schooltextbook that contains fields

Create a class titled SchoolTextBook that contains fields for the author, title, page count, ISBN, and price. This SchoolTextBook class will also provide setter and getter methods for all fields.

  Programming in mpi

What advantages are gained by programming in MPI as opposed to using threads? Is there a disadvantage to MPI? What?

  What does moody suggest is scarce in the free software world

Economics has been called the study of scarcity. It is only possible to sell what is scarce, because what is not scarce (e.g., abundant) has no monetary value. What does Moody suggest is scarce in the Free Software world

  Compare the size of all three-image files

Open the GIF image the image editor and save it as a JPG - Reopen the same GIF image and save it as a PNG-8 image - Compare the size of all three-image files

  initialize the temperature to 100 degrees celsius

Initialize the temperature to 100 degrees Celsius. In a loop, decrement the Celsius value and compute the corresponding temperature in Fahrenheit until the two values are the same.

  Compare and contrast monitoring of patient vital signs by

mobile computing has dramatically changed how information is accessed and shared. wireless networking has been an

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