Entries by Student

write my assignment 30765

Task

You are to write two source files as described below:

·           The first file named stockApp.py, should contain the following two classes:

·    The first is a class called Stock which defines a simple object type representing a stock being traded in a stock market.

·    The second class called StockPortfolio defines objects which are containers of Stock objects.

·           The second file named stockDriver.py defines a Python application, with main method, which creates one StockPortfolio object and allows the various methods of Stock to be called. This class will be an interactive application using the keyboard and the screen to interact with a human operator. It will not do calculations itself but will immediately pass user inputs as arguments to methods of StockPortfolio class.

NOTE: The final application will only execute correctly when both files have been defined completely and correctly but don’t wait until you have completely written all three before you start compiling and testing your cod.e. It is recommended that you save both source cod.e files in the same directory on your file system and compile and test each class as you develop it using small separate programs to creat and test objects of each class.

The files

The files you will require are:

Class Stock [saved in stockApp.py]

Each stock purchased will have 4 instance variables:

·     stock name (a string)

·     amount purchased in lot (an integer, where 1 lot refers to 1000 units)

·     price purchased (per unit, a float, in RM)

·     date purchased (a string, where the format is “MM/DD/YYYY”).

The methods of class Stock should include:

– An initialiser (constructor) method (__init__) which accepts FOUR attributes for a stock – name, amount purchased, price purchased, and date purchased. The method should initialise its object’s attributes with these parametric values.

– A reader (getter) method for each of the four attributes. That is, a simple ‘getter’ method for the name, amount purchased, price purchased, and date purchased.

– A writer (setter) method for each of the attributes.

– A method named value that will return the value of this stock. A stock’s value is calculated by multiplying the purchased price with the amount purchased (in units). For example, a stock purchased with a price of RM3.50 for 2 lots (2000 units) will have a value of RM7000.00

– A method __eq__ that takes another Stock as parameter, and returns true if both stocks are equal (same), false otherwise. Two stocks are considered equal if they have the same name.

– A method __lt__ that takes another Stock as parameter, and returns true if this stock is having a value less than the parametric stock.

– A method __le__ that takes another Stock as parameter, and returns true if this stock is having a value less than or equal to the parametric stock.

– A string method (__str__) which return a single string containing the details of a stock. Such a string can be formed by concatenating the values of the four attributes name, amount purchased, price purchased, and date purchased in the format:

<name> (<amountInLots> lots @<price>/unit) bought <date>

One sample output is as shown below:

HELP (2 lots @RM2.35/unit) bought in 10/10/2010

It is recommended that once you have written the Stock class, you creat a tiny program to test it. The testing program should be used to create one or two Stock objects and call some of the Stock methods. Compile and run the test program to check your work.

Class StockPortfolio [written and saved in the same file as StockPortfolio in stockApp.py]

This class is to be defined in the same file as class Stock. It declares a class of object with maintains a list of Stock objects. It will contain methods which enable the list to show the appropriate behaviours as required by the menu.

The StockPortfolio class should have a client’s name (of type string), and a collection of Stock objects bought by the client, no additional attribute is required:

The StockPortfolio class must also contain some methods which allow the collection of stocks to be managed. The methods of class StockPortfolio should include:

9.    A method named sellStock that takes a positive integer representing the location of the stock to be sold (i.e deleted from the list). If the parametric integer is invalid or out of bounds, then the method should return None.

10.    A method sortedStocks that takes a parameter of type string. The string represents the criteria to be used in sorting the stock list. The method will return a new list containing all the stocks sorted accordingly to the criteria mentioned in the parametric string in ascending order. The criteria could be lots, price, or value.

11.    A method saveToFile that accepts a string representing the filename to save, and all Stock objects will be saved to a text file, one per line, with each attribute separated by a comma.

12.    A method loadFromFile that accepts a string representing the filename where the data is to load from.

When you have written the StockPortfolio class – test it by creating a StockPortfolio object and invoking the methods from a small test program.

stockDriver.py

The aim of this file is to provide a user-interface for a modest application which uses a StockPortfolio container class. The user-interface is written as a ‘console’ application using the normal screen and keyboard to interact with a user via a simple text-based menu.

The user-interface should creat a single StockPortfolio object and provide a menu of choices to the user.

The Menu

Stock portfolio for <user’s name>

———————————

1 Buy stock

2 Display all stocks’ details

3 Display summary information about stock list

4 Display stocks with user-specified stock name

5 Sell a stock based on a given index

6 Display all stocks, sorted according to Stock values

7 Load stock information from file

8 Save stock information to file

0 Quit

Your choice?

 

"Not answered?"


Get the Answer

write my assignment 10059

Based on the Nestle Case Study…

1. Introduction – Identify the key problems and issues in the case. Formulate a thesis statement, summarizing the outcomes of your analysis.

2. Body – Focus your analysis based on relevant facts and the most important issues. Why do those problems exist? How do they affect the organization long- term goals? And, who is responsible for them?

3. Alternatives – Examine possible alternatives. Explain why some alternatives were rejected due to certain constraints.

4. Solution – Select the best solution from the alternatives you have presented. Provide supporting evidence based on the course readings, class discussions, and your own professional experience. Strong supporting evidence presents the pros and cons of the case. And, is your solution realistic?

5. Recommendation – Determine and discuss specific strategies for accomplishing the proposed solution. If applicable, recommend further action to resolve some of the issues. What should be done and who should do it?

 

"Not answered?"


Get the Answer

write my assignment 12010

You are called to the Labour ward to see a full term newborn baby boy because he has difficulty breathing. He was born 15minutes ago to a 20 year old first time mother, who apparently had little antenatal care. The baby was born by caeserean section because it was found to be in breath position. The midwife said that the baby made a few cries immediately after birth, had good tone and heart rate over 100 beats/min. She had placed him on the resuscitate and then had to attend to the mother. When she next looked at the baby, he was breathing very fast and was making a grunting noise.

on examination the baby lookers an appropriate size for his gestational age, he is not dysmorphic and he has been wrapped in dry towel. His lip and tough appear slightly blue. He’s making an intermittent grunting expiratory sound, and his respiratory rate is 70/min.Tgers no increase in resonance on percussion. He is transfered urgently to neonatal unit and a chest radiography taken.

a) what is the likely diagnosis

b) how should the newborn be manage

c) what other conditions can cause respiratory distress in a tern newborn after an unremarkable delivery.

 

"Not answered?"


Get the Answer

write my assignment 8103

Would like to have a one page summary based on the statement below. The course is PROC 5810 Webster University.

Hartz Seed Co. is a supplier of soy beans. Coleman contracted with Hartz for the delivery of one ton of soy beans, for delivery at Coleman’s plant. After delivery, Coleman began inspecting the soy beans for quality. There is a specific inspection testing protocol/procedure involved, and usually takes several weeks to complete because it involves growing some of the seeds. After one month, Coleman noticed several defects in the seedlings that were growing. Coleman immediately notified Hartz of the defects, and rejected the entire lot.

Hartz comes to you for advice concerning a possible action for breach against Colman. Specifically, Hartz asks whether Coleman has 1) accepted the goods, or 2) properly rejected the seeds. How do you advise Hartz? Use UCC provisions to support your answer/analysis.

 

"Not answered?"


Get the Answer