Ask Python Expert

Part I: The Assignment Files
One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a few functions, then fully test them before you write any more. This process makes it easier to find bugs; you know that any bugs must have been part of the work you did since the last test.

Iterative development requires that you work on each of the files simultaneously. In particular, you will write some code in a1test.py, move to a1.py and then back to a1test.py. Therefore, to get you started we want you to first create all three files. You are not going to put (much) code in the files right now. We just want you to have the files created so that you have a starting point to work from.

The very first thing you should do is specifically create a directory for this assignment. This folder should contain the three assignment files and nothing else.

Part II: The Core Functions

Iterative Development

In this part of the assignment, you will work on the files a1.py and a1test.py. It is is broken into four parts (listed as Parts A, B, C, and D). In each part, you will do the following:

Write a function header into a1

We will give you the header to write. We will also give you a detailed docstring specification for the function. You should copy-and-paste the specification into the function body, indented.

Add test cases to a1test

Yes, this means you are writing tests before writing the function bodies. We talked about this in lecture.

Unless otherwise instructed, each test case should be a call to an assert function in the introcs module. Furthermore, your tests should be
representative. While we talked about this in class, you might be a little unsure of what we are asking for here. If so, you might want to go over
lab9 with a consultant before going any further.

Write the function bodies

Make sure that the function satisifies the specifications exactly. If the specification says to return something, you need a return statement. Make sure that the value returned is of the correct type.

Run the unit test a1test

If errors are found, fix them and re-test. Keep doing this until no more errors are found.

Function Specifications

The descriptions that we provide in each part below represent the level of completeness and precision we are looking for in your docstring comments. In fact, it is best to copy-and-paste these descriptions to create the first draft of your docstring comments. If you do not cut and paste, please adhere to the conventions we use, such as using a single line, followed by a blank line and a more descriptive paragraph, or by using "Returns: ..." for fruitful-functions. While we have provided the contents of the specification, we have not always formatted them properly for you.

Part III: The Application Script
You are essentially done. The last part of the assignment is to complete the file a1app.py. This file will be no more complicated than the script
die.py that you made for lab 5. In fact, it will have a similar number of lines.

At the top of the file a1app.py remember to add the line

import a1

This will allow you to access the exchange function in this script. This is the only function of a1.py that you will need to use. Everything else will be either an input function, a print function, or some other built-in function, just as you did in the lab.
We are not going to give you much more guidance than that. Use your file dice.py as a guide if you are unsure what to do. In this end, the script should prompt the user and provide an answer, as shown below.
[user@machine]:a1 > python a1app.py
3- letter code for original currency: USD 3-letter code for the new currency: EUR Amount of the original currency: 2.5
You can exchange 2.5 USD for 2.158923 EUR.

Obviously you will get different answers for different currencies and amounts. But otherwise, the output displayed must look exactly like it does above. You must use those exact words for your final print statement and end with a period.


Attachment:- cs assignment.rar

Python, Programming

  • Category:- Python
  • Reference No.:- M93108577
  • Price:- $130

Guranteed 48 Hours Delivery, In Price:- $130

Have any Question?


Related Questions in Python

Part i the assignment filesone of the most important

Part I: The Assignment Files One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a ...

Homework -this homework will have both a short written and

Homework - This homework will have, both a short written and coding assignment. The problems that are supposed to be written are clearly marked. 1) (Written) Make heuristics Describe two heuristics for the slide problem ...

Tasksdemonstrate data scraping of a social network of

Tasks Demonstrate data scraping of a social network of choice. Develop technical documentation, including the development of the code & detailing the results. Provide a report on the findings, that includes research into ...

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Learning outcomes lo3 - research develop and document a

Learning Outcomes LO3 - Research, develop, and document a basic security policy, and analyse, record, and resolve all security incidents LO4 - Identify and assess the threats to, and vulnerabilities of networks Assessmen ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As