Lab Activity 1: Implement the Weibull Distribution in Java
The Weibull functions are functions not only of wind speed x, but also of their parameters and . Given an input x, we need to calculate the probability density f,(x) and its integral F,(x). Each f
Wind Farm Investment Project
"Windy Profits Incorporated" is offering investors a chance to purchase shares of the output from several proposed wind turbine farms. Three turbines will be placed at one of three locations for a total of nine turbines. Locat
Jave Programming
Exercise 1
Lab 1
a. Open the following program in JCreator. The file Exercise1.java has been sent to you by email and is also posted on WebCT under Week1. Once it is open in JCreator, save it in the active workspace where you are allowed
Syllabus
ECE-203: Section 701 Fall 2007 Textbook: The textbook for the course is: Title: Big Java, 3rd edition Author: Cay S. Horstmann Publisher: Wiley ISBN: 978-0470-112090 In addition, you will also need to visit several online references Grading Schem
Java Midterm for ECE 203
Part A: General Understanding
1. The Java Virtual Machine translates byte-code into: a. source code b. virtual code
First .
c. machine language code
Last .
d. ordinary English sentences.
2. The Java source code for a class should
_author_ = 'robincarr'
print 'WORD SEARCH'
# Python module os provides utilities for displaying and modifying your current
working directory.
import os
print 'The currect working directory is: ', os.getcwd() # Current Work
Directory
# Read in all the word
_author_ = 'robincarr'
print "Educational Goal: Learn how to process python strings using 'string
slicing'."
print 'Slice up each compound word, into its component words.'
# Good references:
# http:/vocablog-plc.blogspot.com/p/compounds.html
# http:/www.e
_author_ = 'robincarr'
"
Calculate Fibonacci numbers using the formula of Binet.
See this reference for more information on the formula.
http:/www.cut-the-knot.org/proofs/BinetFormula.shtml
"
import math
# First define the Golden Ratio, often represented
_author_ = 'robincarr'
# Creates a table of numbers with N first in base 10, and then in base 2, and
16.
# Add base 8 (octal) to the table.
# Add another format flag for the octal numbers, and add a title for the octal
column.
print '%16s%20s%20s%20s' % (
# coding=utf-8
_author_ = 'robincarr'
import math
print 'SOLVING SSS TRIANGLES'
print 'Known: The sides a, b and c of the triangle are known.'
print 'Goal: Find the angles A, B and C of the triangle.'
print 'Side a is the side opposite angle A, side b is
import math
print
print
print
years
"Greetings Earthlings. We are visitors from the Andromeda galaxy."
"Your sun is about to expand and your planet is at risk of incineration."
"We will help you build a new Hollow Earth so you can live a few million
longe
import math
print "Volume and Surface Area of a Pill Capsule with Hemispherical Ends"
print "\n1. Enter the length L (in cm) from one end to the other of the pill
capsule."
L = float( raw_input("Length: ") )
print "\n2. Enter the diameter D in centimeters
def histogram(tally_this):
count = dict() # Empty dictionary of counts
for item in tally_this:
count[item] = count.get(item, 0) + 1
return count
def invert_dict(d):
inverse = dict()
for key in d:
val = d[key]
if val not in inverse:
inverse[val] = [key]
el
_author_ = 'robincarr'
print 'Simple Resistor Calculator'
print 'Finds the equivalent resistance of two resistors connected in series or
parallel.\n'
print 'Enter the value of resistor #1 in Ohms.'
# Convert to float to avoid a possible integer division e
_author_ = 'robincarr'
print 'COIN CHANGE MAKER'
print 'Computes your coin change (0-99 cents) in quarters, dimes, nickels and
pennies using the least number of coins.'
print 'Enter "change due" as an integer in the range 0-99.'
# A while loop can be used
_author_ = 'robincarr'
import time
# 1. New and improved memoized version.
known = cfw_0:0, 1:1
def fibonacci(n):
if n in known:
return known[n]
res = fibonacci(n-1) + fibonacci(n-2)
known[n] = res
return res
# 2. Here is the old recursive version of the
_author_ = 'robincarr'
# Method to invert a dictionary. (from page 105)
def invert_dict(d):
inverse = dict()
for key in d:
val = d[key]
if val not in inverse:
inverse[val] = [key] # Creates a list with one element. Note the [].
else:
inverse[val].append(k
_author_ = 'robincarr'
# Just run this example from the online reading.
# See: http:/www.python-course.eu/tkinter_message_widget.php
from Tkinter import *
master = Tk()
whatever_you_do = "Whatever you do will be insignificant, but it is very
important tha
print "Find the number of Platonic Solids."
print "Each Platonic Solid corresponds to a unique Schlafli Symbol cfw_p,q,"
print "where p and q are >= 3 and satisfy: 1/p + 1/q > 1/2\n"
platonic_dict = cfw_"tetrahedron": (3,3), "cube": (4,3),
"dodecahedron":
from Tkinter import *
# Now Modified TO HANDLE THREE RESISTORS
_author_ = "robincarr"
_date_ = "$Apr 24, 2015 12:47:13 PM$"
" GUI version of Resistor Calculator finds the equivalent resistance for two
resistors
connected either in series or parallel. Feat
_author_ = 'robincarr'
"
Adapted from this source: http:/www.python-course.eu/tkinter_labels.php
"
# See this reference for how the pack() command works:
# http:/effbot.org/tkinterbook/pack.htm
# Live! Use the Photo Image Library.
# 1. Import the Tkinter
_author_ = 'robincarr'
" Adapted from the "Saying Hello with Labels" example on this website:
http:/www.python-course.eu/tkinter_labels.php
Instead of printing "Hello" we'll display this poem. (First stanza of "The
Tyger" by William Blake.)
Tyger Tyger, b
_author_ = 'robincarr'
# explore Tkinter button as a toggle and as a control to cycle through a range
of values.
from Tkinter import *
root = Tk()
# root.title("Click the Button") # Change the title to "Colors of the Rainbow"
root.title("Colors of the Rai
_author_ = 'robincarr'
from Tkinter import *
from tkFileDialog
import askopenfilename
root = Tk()
root.title("Search a file for a given word")
word_list = []
# List of all the lines in the file. Empty for now.
# These methods or callbacks will perform the
"
Completed program to check if two phrases are anagrams, using dictionaries.
"
def histogram(s):
d = dict()
for c in s:
if c not in d:
d[c] = 1
else:
d[c] += 1
return d
def cleanup(s):
result = '
for c in s:
c = c.lower()
if c.isalpha():
result += c
retu
_author_ = 'robincarr'
#
#
#
#
Consider this recursive version of the Fibonacci number sequence.
Initialize count0 and count1 here.
Note: The solutions also implement count2 and count3. (Not asked for.)
The solutions also now show all calls, and count the
_author_ = 'robincarr'
def histogram(tally_this):
count = dict() # Empty dictionary of counts
for item in tally_this:
count[item] = count.get(item, 0) + 1
return count
print 'The following animals have been rescued from a ferocious forest fire.'
rescued_a