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

Solving problem by permutation on set is a one-to-one

Prove that PERM=POWER P, the obvious algorithm doesn't run in polynomial time as problem size is logarithmic (and no linear) with respect to the value of t.

Language running on any operating system

Task: You are required to create and deliver a presentation providing an analysis of an existing software exploit (therefore you are not required to craft a new, unknown exp

Explain the major concepts behind computers

Address the following below in at least 20 slides powerpoint or more, you must include as a minimum an introduction, body, summary/conclusion, and notes pages. It is impo

How many times would we have to perform a fetch

That is, the reorganization cost and subsequent search cost are less than the search cost before reorganization. Support your answer. Assume s = 16 ms, rd = 8.3 ms, and btt

Copyright law and user licensing agreements

1) "Software piracy is illegal because software is an intellectual property that is protected by copyright law and user licensing agreements". Illustrating with notable ins

Design and analysis of algorithms

You are given a series of boxes. Each box i has a rectangular base with width Wi and length Li, as well as a height Hi. You are stacking the boxes, subject to the following:

Compose the three parts of a complete email message

Write a GUI application for java for the WebBuy Company that allows a user to compose the three parts of a complete email message: the "To:", "Subject:" and "Message:" text.

What are red-black trees

What are Red-Black trees? Why are they important? What is their efficiency? How do Red-Black trees overcome the shortcomings of Binary Trees? The answer has to be at least

Reviews

Write a Review

 
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