SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 213 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Engineering Posted 22 Dec 2017 My Price 10.00

Using the IDLE development environment

The area of a triangle is given by the formula Area = 1/2 * Base * Height. Using the IDLE development environment, create a Python script named t_area.py . Your script must calculate the area of a triangle and display the results of the calculation. The triangle that your script must calculate the areas for has a base of 12 inches and a height of 16 inches. IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script.

 

Your script must use (at a minimum) the following three variable names.

 

   area - this variable will contain the results of the calculation which will be the area of the triangle.

 

   base – this variable will contain the length of the triangle base. You must set the value of this variable to 12.

 

   height – this variable will contain the height of the triangle. You must set the value of this variable to 16.

 

Your script must have at least 2 comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, the computation of area and the assignment of the result to the variable area, or the display of the result.

 

Your script must display the results of your calculation computing the area of the triangle using the print statement. You must code your script, test it, and if required, debug it. When you have successfully completed this assignment please capture the output displayed by your script. You can copy and paste the output from the IDLE window into a document and attach it to your assignment.

 

Example:

 

The following shows and example python script that computes the area of a circle. The area of a circle is given by the formula area = pi * radius squared

 

   # assign the value 3.14 to the varible pi

   pi = 3.14

 

   # assign the value 8 to the variable radius

   radius = 8

 

   # assign the results of the operation to the variable area

   # the operation multiplies radius by radius and then multiplies the result by

 

   # the value of pi

   area = pi * (radius * radius)

 

   # print the value of area

   print(area)

 

Using IDLE

IDLE is a Integrated Development Environment or IDE. An IDE will enable you to use a text editor to create programs (in the case of Python we refer to the program as a script) as well as execute the program. The IDLE editor understands the syntax of the Python programming language and can help you to debug your program by identifying code that is not valid and must be corrected.

 

When you first start IDLE, it will display a window that is the Python interpreter. You can type Python commands directly into this environment and Python will interpret and execute them. For all of the assignments in this course, you must create a script. To create a script, select new window from the file option. This will open a new script file. You can also use the open or recent files options under the file menu to open files that you have previously created.

 

You can enter your script into the window that opens when you use the new window option. Before executing your script, you must save it. The first time you attempt to save a new script, you will need to give it a name. All Python scripts must have the suffix of py on the filename.

 

To execute a script, you can select the ‘Run Module’ option under the run menu or simply press F5 on your keyboard.

 

Under the options menu there is an option to configure IDLE. You can configure settings such as the font size of text and other features using this menu.

 

Under the Help menu option there is both IDLE help which provides information about the features of IDLE as well as an option that will bring up the Python documentation.

 

The following will be the items used in the grading rubric of this assignment. Make sure that you have addressed each item in your assignment. You should submit the python script that you created for this assignment (this should be a file with an extension of .py or .txt). However, please note, that Moodle will not allow you to upload a file with a .py extension - so you must change the file extension to .txt or zip the file (.zip) - only after that, will you be able to upload. You must also copy the output produced when you execute your script and attach as part of your assignment. The output can be captured either by selecting, copying and pasting the lines of output from the IDLE run window into a document, or you can capture (on windows) an image of the output window by using the Ctrl+ Alt+ Prnt Scn key sequence to capture the image of the screen and pasting this document into a word document. You should only attached documents in the word format (.doc file extension). Both Microsoft Word and OpenOffice can save files in Word 97/2000 format.

 

This assignment has two components:

 

1 – the Python script file

2 – the output file

 

The assignment will allow you to upload multiple files

Answers

(5)
Status NEW Posted 22 Dec 2017 10:12 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)