Programming Homework Help

Programming Homework Help. University of Rhode Island Running Ode45 on A System of Od Es Project

I have initial condition, rate constant, and ODEs written in a function but cannot run it with ode45. I tried a few different methods but still not able to solve it. I believe there’s something wrong with my function here. Help and guidance will be much appreciated. Output the ode45 integration result. 

code: 

% coagulation model 1996 RAS

% ode45 solver

% initial condition IC

XIa = 0.3; % nM

IXa = 0;

Xa = 0;

II = 1000; % nM <- prothrombin

IIa = 0; % <- thrombin

VIIIa = 0;

APC = 0;

Va = 0;

Ia = 0; % fibrin

Z = 0;

W = 0;

% putting all initial condition into one variable

IC = [XIa IXa Xa II IIa VIIIa APC Va Ia Z W];

y0 = zeros(8,1); 

tspan = [0 100]; % 0 to 100 mins – time scale

[t,IXa, Xa, IIa, II, VIIIa, Va, APC, Ia] = ode45(@ODEsystem,tspan,IC);

plot(t,IXa, Xa, IIa, II, VIIIa, Va, APC, Ia,’-o’); 

function dydt = ODEsystem(t, IXa, Xa, IIa, II, VIIIa, Va, APC, Ia)

% kinetic constant for thrombin generation model

k9 = 20; % min.^-1

h9 = 0.2; % min.^-1

k8 = 0.00001; % min.^-1

h8 = 0.31; % min.^-1

ka = 1.2; % nM.^-1 min.^-1

k5 = 0.17; % min.^-1

h5 = 0.31; % min.^-1

kcat = 24; % min.^-1

km = 20; % nM

kd = 1; % nM

k10_catmax = 0.003; % min.^-1 or = 500

h10 = 1; % min.^-1

k2_catmax = 2.3; % min.^-1 or = 2000

h2 = 1.3; % min.^-1

k_apc = 0.0014; % min.^-1

h_apc = 0.1; % min.^-1

k1 = 2.82; % min.^-1

k11 = 0.0078; % min.^-1

h11 = 0.2; % min.^-1

% 8 ODEs 

dIxadt = k9*XIa – h9*IXa;

dXadt = k10*IXa + k10*Z – h10*Xa;

dIIadt = k2*Xa*(II/(II+K2m)) + k2*W*(II/(II+K2m)) – h2*IIa;

dIIdt = -k2*Xa*(II/(II+K2m)) – k2*W*(II/(II+K2m));

dVIIIadt = k8*IIa – h8*VIIIa – ka*APC*(VIIIa+Z);

dVadt = k5*IIa – h5*Va – ka*APC*(Va+W);

dAPCdt = k_apc*IIa – h_apc*APC;

dIadt = k1*IIa;

end

Programming Homework Help

Programming Homework Help

Programming Homework Help. UCLA The Relationship Between Poverty Level and Education Level Essay

For the course data analysis project, you will apply statistical analysis to a topic and dataset relevant to public policy that is of interest to you. You will write a research paper with approximately 5 pages of written text, in addition to tables and any figures, presenting the analysis and discussing your conclusions and any limitations of your findings, applying the concepts we will learn throughout the quarter.

You will conduct your analysis by developing a basic R script to document and allow for your work to be reproduced. You may employ any of the methods covered in Weeks 1 through 9 of the course. Students should develop a hypothesis related to a dependent variable and an independent variable and then test their hypothesis applying methods from the course. Developing graphics to explore your dataset and/or present your findings may enhance your paper but is not required.

Structure of Paper

Clarity and structure are critical for the writing of your paper and presenting your results. Your paper should be organized into the following parts.

  1. Introduction: Discussion of the problem, including the context of the question/issue and the citation of one to two background papers.
  2. Hypothesis: Statement of the hypotheses, both using formal statistical hypothesis testing, and describing the hypothesis in plain English, based upon the hypothesis testing approach we review during the quarter.
  3. Data and Methods: Description of the data file and discussion of statistical methods, including any assumptions applied for statistical methods used and reasonableness of assumptions. These should be based on what we learn about the methods and assumptions during the quarter. Descriptive statistics regarding the dataset and key variables may be included, though are not explicitly required.
  4. Results: Presentation of statistical analysis, including potentially test statistics, p-values, confidence intervals, and decision to reject or fail to reject your null hypothesis.
  5. Conclusion: Summary and interpretation of the results, including discussing any limitations of your findings or further questions for study based on your analysis.

Please use Ch. 11 of the Using Statistics text (from Module 2) as a resource on good statistical writing practice.

Your supporting R script must be turned in along with your paper (the dataset and output is not required, other than for possible use to present the results in your paper).

Assignment Details

  • Length: approximately 5 pages of written text, in addition to tables and any figures, double spaced, (not including the title page, references, tables, and figures)
  • Use standard APA formatting (one-inch margins, top and bottom, 12-point font size)
  • All citations should be in APA format.
  • Rubric

    A (90-100) B (80-89) C (70-79) D (0-69)
    Application and Understanding of Statistical Concepts (50%) The student’s paper shows an exceptional understanding of the statistical topics and application of concepts from the course to their data analysis problem. The description of methods and statistical conclusions are appropriate and the student recognizes limitations of their conclusions due to the assumptions of the statistical methods. The student successfully conducted a statistical analysis between an independent and dependent variable, but some aspects of the student’s understanding of the statistical concepts may need to be improved. The statistical methods are appropriate, but the writing misses some important details. The discussion of the limitations of the analysis may miss some critical assumptions of the methods. Statistical methods are applied, but the student’s paper demonstrates some serious misunderstanding of the methods and/or fails to apply the method. The discussion of choice of statistical approach and/or conclusions/limitations misses critical aspects of the methods for understanding their findings. The student may draw incorrect conclusions. The student does not succeed in conducting an analysis between an independent and dependent variable. The student’s writing shows a complete misunderstanding of the application of the statistical methods. The methods are misapplied or totally inappropriate. Conclusions are incorrect.
    Clarity and Organization of Writing (40%) The student’s writing is clear and complete and organized in the appropriate sections. The student thoughtfully establishes some background information and motivation for their research question and structures their hypothesis appropriately. The presentation of data analysis results is clear and may go above and beyond the project requirements, including descriptive statistics regarding their dataset and/or data visualization. The writing is mostly organized, but there are areas of improvement for the student. Certain areas lack clarity. The student may have somewhat deviated from the required structure of the paper. The hypothesis tested is appropriate, but needed details may be missing. The presentation of the data analysis may need some strengthening to adequately portray the results. The writing and organization has some serious deficiencies making it difficult to follow or understand the student’s work. Sections may be missing or underdeveloped. The student’s research question and/or hypothesis may be poorly formulated. The writing is disorganized and unfocused. Sections of the paper are missing and do not at all demonstrate structured thinking to present analyses.
    Supporting R Script (10%) An R script is included that is well commented and clearly documents the analysis steps, including data input and statistical application. The R script presents the student’s analysis, but may need more clarity in portraying the steps the student undertook to conduct their analysis. The R script does not properly document the student’s work. The R script is available but does not make clear the student’s key analysis steps. The R script is entirely missing and/or unrelated to the students’ work and analyses.

Programming Homework Help

Programming Homework Help

Programming Homework Help. University of Phoenix Management Information Systems Questionnaire

Q1) Analyze the role of different management information systems and assess data collection and management systems.

Q2) Evaluate opportunities for enterprise collaboration using information technology.

Q3) Investigate how emerging technology can support the enterprise strategy.

Programming Homework Help

Programming Homework Help

Programming Homework Help. Concord University Python Dictionary Structure Project Lab Report

Assignment #10

This assignment uses a great deal of text. We will focus on the Python dictionary structure which you worked on in module 10. We will use data based on an online copyright free version of Roget’s thesaurus on Gutenberg: http://www.gutenberg.org/cache/epub/10681/pg10681.txt – you can download a copy of the thesauraus here: python_asg10_Roget_Thesaurus.txt

Part 0

You have been hired by a small software company to create a “thesaurus” program that replaces words with their synonyms. The company has set you up with a sample thesaurus stored in a Python dictionary object. Here’s the code that represents the thesaurus:

# define our simple thesaurus
thesaurus = {
              "happy": "glad",
              "sad"  : "bleak"
            }

The dictionary contains two keys – “happy” and “sad”. Each of these keys holds a single synonym for that key.

Write a program that asks the user for a phrase. Then compare the words in that phrase to the keys in the thesaurus. If the key can be found you should replace the original word with the synonym for that word. Words that are changed in this way should be printed in UPPERCASE letters. Make sure to remove all punctuation from your initial phrase so that you can find all possible matches. Here’s a sample running of your program:

Enter a phrase: Happy Birthday! exclaimed the sad, sad kitten
GLAD birthday exclaimed the BLEAK BLEAK kitten

Part 1

Your company realizes that they probably need more than one synonym for each word, so they updated your thesaurus accordingly:

# define our simple thesaurus
thesaurus = {
              "happy":["glad",  "blissful", "ecstatic", "at ease"],
              "sad"  :["bleak", "blue",     "depressed"]
            }

The dictionary contains two keys – “happy” and “sad”. Each of these keys holds a list that contains synonyms of that key.

Write a program that asks the user for a phrase. Then compare the words in that phrase to the keys in the thesaurus. If the key can be found you should replace the original word with a random synonym for that word. Words that are changed in this way should be printed in UPPERCASE letters. Here’s a sample running of your program:

Enter a phrase: Happy Birthday! exclaimed the sad, sad kitten
ECSTATIC birthday exclaimed the DEPRESSED BLEAK kitten

Part 2

The company quickly realized that the simple two-word thesaurus was far too small. In order to address this shortcoming they have provided you with a very large text file that contains over 30,000 words (the file is included in the downloadable data files above – the filename for the thesaurus is “python_asg10_Roget_Thesaurus.txt“).

word1,synonym1,synonym2,...,synonymN-1,synonymN
word2,synonym1,synonym2,...,synonymN-1,synonymN
word3,synonym1,synonym2,...,synonymN-1,synonymN

Every word occupies its own line followed by a comma-separated list of synonyms. Every word can have a potentially unlimited # of synonyms. Your task for this part is to open this file and parse it into a Python dictionary object so that it functions just like the simple thesaurus from the previous part. Here’s a sample running of your program:

Total words in thesaurus: 33054

Enter a phrase: happy birthday said the sad kitten
CONTENT ANNUAL HOLIDAY PRONOUNCED the DOLOROUS CHESHIRE CAT

Hint: For each word you will need to create a new list that contains all the synonyms for that word. You can then store this list in the dictionary using the word as the key.

Part 3

Your program is a hit! In fact, some famous recording artists have come to you to help them re-write some of their most popular songs so that they aren’t so “repetitive”. Your first customer is Mr. Justin Bieber, who’s hit song “Baby” needs a little bit of work:

The lyrics to this song is stored in a text file named “bieber_baby.txt” which you can download here: bieber_baby.txt

Justin doesn’t want you to change ALL of his lyrics – just a few here and there to add some variety. Begin by asking the user for a “chance” value – this value dictates the % chance that a given word will be substituted with one in the thesaurus. Finally, open the file and swap out words using the “chance” value supplied (i.e. the word is “happy” and the chance is 0.5 – this word is in the thesauraus, so there is a 50% chance that we would swap it with a random word from the thesaurus and a 50% chance that we will leave it as-is). Words that are swapped should be printed in all UPPERCASE letters. Here’s a sample running of your program (note that you can simply remove all puntuation from the source file for this program):

Total words in thesaurus: 33054

Enter a % chance to change a word:  0.5

oh whoa 
oh whoa 
oh whoa 
 
you know you REGARD me i know ETHICAL SELF care 
just shout whenever and ill be there 
you are my love you are my INNER NATURE 
and we will NOT A BIT IN ANY WAY ever be RETIRED 
 
are we an INSTANCE SUBTEENER ABJURE WAGERING 
were just friends what are you TEACHING 
say theres another and look right in my eyes 
my INAUGURAL YOUNG MAN DEAD my heart for the first MARCH TEMPO 
and i was IN KIND 
 
LAMBKIN baby TOMATO oooh 
DOTE ON baby DAMSEL baby nooo 
PHONY FLEDGLING baby baby oooh 
i thought youd INFLEXIBLY GO ON mine 
 
HOPEFUL YOUNGER SWEETKINS oooh 
UXORIOUSNESS baby COMPACT DOTE nooo 
AFTER THIS FASHION INVERTEBRATE baby DIMINUTIVE oooh 
i ADVERTENCY youd ALL ALONG SUBSIST EXCAVATE 
 
oh IN THAT you i would have THROUGH WITH whatever 
and i UNINFLUENCED cant SENSE we aint together 
and i wanna play it DIMINISH but im losin you 
SINFUL HOLD WITH you anything ill buy you ANYTHING COCKPIT 
and im in pieces LOVER STABILIZE me 
and just shake SUBCONSCIOUS SELF til SUBLIMINAL SELF TAILPIECE OTHER SELF from this bad dream 
im RELEASE GROUND down down down 
and i UNPREPOSSESSED cant ALLOW my COMMENCEMENT ADORATION wont OCCUR NEAR ENOUGH TO 
 
and im CLOSE COPY 
RECRUIT baby baby oooh 
RIVAL baby DRY-NURSE baby nooo 
IN THAT WAY baby YEARLING PRECIOUS HEART oooh 
i thought youd EVER AND ANON OCCUR mine 
 
GAL FLAME baby oooh 
like baby baby baby nooo 
like baby DUCKLING baby oooh 
i SYMPATHY youd DAILY AND HOURLY BE MET WITH FIRETRAP 
 
luda JUST THE SAME i was  i had my first WANT 
there was nobody that compared to my baby 
and nobody came between us or could ever come ABOVE AND BEYOND 
she had me SOMATIC DEATH crazy oh i was starstruck 
she woke me up daily dont DEPRIVATION DECIDING VOTE starbucks 
FEMALE BEING made my heart pound I MYSELF skipped a beat ALTHOUGH i see MY HUMBLE SELF in the PAVED ROAD and 
at VIEW on the playground but i EXACTLY wanna see her on the PUT IN TIME 
she knows she got me dazing cause she was STRAIGHT amazing 
and ADVANCED my heart is breaking ENTIRELY i BARELY THE HOLE WHEREBY NOTE 
 
baby baby baby oooh 
AT WHAT PRICE baby baby baby nooo 
CHICKEN LIVER SISSY baby PONY oooh 
i IDEATIVE youd RAPIDLY HOLD CONVERT 
 
WEANLING DEBUTANT JELLYFISH oooh 
AT PAR baby SUBDEB baby nooo 
CLOSE NEONATAL baby SCHOOLMAID oooh 
i thought youd always BE THE CASE mine 
 
im ASLEEP yeah yeah yeah yeah yeah yeah 
THIS NIGHT im INTEGRATED gone yeah yeah yeah yeah yeah yeah 
IN THESE DAYS im all IMBECILE yeah yeah yeah yeah yeah yeah 
now im BODILY IMBECILE gone gone gone 
im FLABBY

Programming Homework Help

Programming Homework Help

Programming Homework Help. Concord University Programming & Basic Arithmetic Functions Lab Report

directions provided!

# these are the basic arithmetic functions you will be using for this challenge

# function:   add
# input:      two integers/floats
# processing: adds the two supplied values
# output:     returns the sum (integer/float)
def add(a,b):
    return a+b

# function:   sub
# input:      two integers/floats
# processing: subtracts the two supplied values
# output:     returns the difference (integer/float)
def sub(a,b):
    return a-b

# function:   mult
# input:      two integers/floats
# processing: multiplies the two supplied values
# output:     returns the product (integer/float)
def mult(a,b):
    return a*b

# function:   sqrt
# input:      one integer/float
# processing: computes the square root of the supplied value
# output:     returns the square root (float)
def sqrt(a):
    return a**0.5

# function:   square
# input:      one integer/float
# processing: raises the supplied integer/float to the 2nd power
# output:     returns the square (integer/float)
def square(a):
    return a**2

# these are the two points you will be using

# point 1
x1 = 0
y1 = 0

# point 2
x2 = 100
y2 = 100

# compute the distance between the two points above using the distance formula.
# you may ONLY use the functions above to do this - no math operators are allowed!  
# your calculation must also be done on a single line.
distance = ______________________

print (distance) # answer should be 141.4213562373095

distance formula: 

 Part 2
Write two functions called <strong>'maximum'</strong> and <strong>'minimum'</strong> - these function should accept two arguments and <strong>return</strong> the larger/smaller of the two supplied values. For the purpose of this program you can always assume that the arguments being supplied are numeric.. Your program should work perfectly with the following code:
a = 5
b = 10
c = 15
d = 20

ans1 = maximum(a,b)
ans2 = maximum(a,c)
ans3 = maximum(a,d)
print (ans1,ans2,ans3) # 10 15 20

ans4 = minimum(d,c)
ans5 = minimum(d,b)
ans6 = minimum(d,a)
print (ans4,ans5,ans6) # 15 10 5

ans7 = maximum( maximum(a,b), maximum(c,d) )
print ("The biggest is:", ans7)

Challenge 3

# write a function called '<strong>simple_sort_version1'</strong> that accepts two values.  you can assume
# that your two values will always be the same data type (all ints, all floats or all strings).
# sort these two values in ascending order and <strong>return</strong> them in that order. 
# you may use any function that you've written so far in this assignment if you'd like to (maximum, minimum, etc)

# your function should work perfectly with the following lines of code
a,b = simple_sort_version1(10,20)
print (a,b) # 10 20

a,b = simple_sort_version1(20,10)
print (a,b) # 10 20

a,b = simple_sort_version1(30,30)
print (a,b) # 30 30

Challenge 4

# next, write a new function called '<strong>simple_sort_version2</strong>' that accepts three values.  you can assume
# that your three values will always be the same data type (all ints, all floats or all strings).
# sort these values in ascending order and <strong>return</strong> them. 
# you may use any function that you've written so far in this assignment if you'd like to (simple_sort_version1, maximum, minimum, etc)

# your function should work perfectly with the following lines of code
a,b,c = simple_sort_version2(10,20,30)
print (a,b,c) # 10 20 30

a,b,c = simple_sort_version2(10,30,20)
print (a,b,c) # 10 20 30

a,b,c = simple_sort_version2(30,20,10)
print (a,b,c) # 10 20 30

a,b,c = simple_sort_version2(30,20,20)
print (a,b,c) # 20 20 30
 
  

Part 2a

For this step you are given three functions – go ahead and copy these functions into a new file called “digitalclock.py”:

# function:   horizontal_line
# input:      a width value (integer) and a single character (string)
# processing: generates a single horizontal line of the desired size
# output:     returns the generated pattern (string)
def horizontal_line(width,char):
    return width*char + "n"

# function:   vertical_line
# input:      a shift value and a height value (both integers)  and a single character (string)
# processing: generates a single vertical line of the desired height.  the line is
#             offset from the left side of the screen using the shift value
# output:     returns the generated pattern (string)
def vertical_line(shift,height,char):
    pattern = ""
    for i in range(height):
        pattern += shift*" " + char + "n"
    return pattern

# function:   two_vertical_lines
# input:      a width value and a height value (both integers)  and a single character (string)
# processing: generates two vertical lines.  the first line is along the left side of
#             the screen. the second line is offset using the "width" value supplied
# output:     returns the generated pattern (string)
def two_vertical_lines(width,height,char):
    pattern = ""
    for i in range(height):
        pattern += char + " "*(width-2) + char + "n"
    return pattern

Next, create a file called ‘LastName_FirstName_Assign6_part2.py’ – make sure this file is in the same folder as your newly created ‘digitalclock.py’ file. Import your module then run the following code – you should be able to see a series of graphical patterns that match the output below:

import digitalclock

print ("Horizontal line, width = 5:")
temp = digitalclock.horizontal_line(5, '*')
print (temp)
print ()

print ("Horizontal line, width = 10:")
temp = digitalclock.horizontal_line(10, '+')
print (temp)
print ()

print ("Horizontal line, width = 15:")
temp = digitalclock.horizontal_line(15, 'z')
print (temp)
print ()

print ("Vertical Line, shift=0; height=3:")
temp = digitalclock.vertical_line(0, 3, '!')
print (temp)
print ()

print ("Vertical Line, shift=3; height=3:")
temp = digitalclock.vertical_line(3, 3, '&')
print (temp)
print ()

print ("Vertical Line, shift=6; height=5:")
temp = digitalclock.vertical_line(6, 5, '$')
print (temp)
print ()

print ("Two Vertical Lines, width=3; height=3:")
temp = digitalclock.two_vertical_lines(3, 3, '^')
print (temp)
print ()

print ("Two Vertical Lines, width=4; height=5:")
temp = digitalclock.two_vertical_lines(4, 5, '@')

print (temp)
print ()

print ("Two Vertical Lines, width=5; height=2:")
temp = digitalclock.two_vertical_lines(5, 2, '#')
print (temp)
print ()

Expected Output:

Horizontal line, width = 5:
*****

Horizontal line, width = 10:
++++++++++

Horizontal line, width = 15:
zzzzzzzzzzzzzzz

Vertical Line, shift=0; height=3:
!
!
!
Vertical Line, shift=3; height=3:
   &
   &
   &
Vertical Line, shift=6; height=5:
      $
      $
      $
      $
      $
Two Vertical Lines, width=3; height=3:
^ ^
^ ^
^ ^
Two Vertical Lines, width=4; height=5:
@  @
@  @
@  @
@  @
@  @
Two Vertical Lines, width=5; height=2:
#   #
#   #
   
   Part 2b
As you can see, you have three "primitive" functions for generating simple shapes (horizontal lines, vertical lines and parallel vertical lines). Your next task is to write 10 new functions that generate the digits 0-9 using your three line functions. These functions should be stored in your 'digitalclock.py' module. The goal here is to render the digits as they would appear on a digital display:
Each function should accept a "width" argument to control how wide the number should be as well as a single character. You can assume numbers will always be printed with a height of 5. For example, here is the function for the number 1:
# function:   number_1
# input:      a width value (integer) and a single character (string)
# processing: generates the number 1 as it would appear on a digital display
#             using the supplied width value
# output:     returns the generated pattern (string)
def number_1(width, character):
    pattern = vertical_line(width-1, 5, character)
    return patternAnd here's a sample program that calls the function a few times (test this in your main program, not in your module):
print ("Number 1, width=5: ")
temp = digitalclock.number_1(5, '*')
print(temp)
print()

print ("Number 1, width=10: ")
temp = digitalclock.number_1(10, '*')
print(temp)
print()

print ("Number 1, width=2: ")
temp = digitalclock.number_1(2, '*')
print(temp)
print()And here's the expected output:
Number 1, width=5: 
    *
    *
    *
    *
    *
    

Number 1, width=10: 
         *
         *
         *
         *
         *
         

Number 1, width=2: 
 *
 *
 *
 *
 *
 
 Here's a sample program that prints all of the numbers (0-9).
temp = digitalclock.number_0(5, '*')
print(temp)
print()

temp = digitalclock.number_1(5, '*')
print(temp)
print()

temp = digitalclock.number_2(5, '*')
print(temp)
print()

temp = digitalclock.number_3(5, '*')
print(temp)
print()

temp = digitalclock.number_4(5, '*')
print(temp)
print()

temp = digitalclock.number_5(5, '*')
print(temp)
print()

temp = digitalclock.number_6(5, '*')
print(temp)
print()

temp = digitalclock.number_7(5, '*')
print(temp)
print()

temp = digitalclock.number_8(5, '*')
print(temp)
print()

temp = digitalclock.number_9(5, '*')
print(temp)
print()And here's the expected output:
*****
*   *
*   *
*   *
*****
    *
    *
    *
    *
    *
*****
    *
*****
*
*****
*****
    *
*****
    *
*****
*   *
*   *
*****
    *
    *
*****
*
*****
    *
*****
*****
*
*****
*   *
*****
*****
    *
    *
    *
    *
*****
*   *
*****
*   *
*****
*****
*   *
*****
    *
    *
    
    Part 2c
Write a function called 'print_number' that prints out any desired number to the screen. This function should also be placed in your 'digitalclock.py' module. Here's the IPO for this function:
# function:   print_number
# input:      a number to print (integer), a width value (integer) and a single character (string)
# processing: prints the desired number to the screen using the supplied width value
# output:     does not return anythingAnd here's some sample code that you can use to test your function:
digitalclock.print_number(0, 5, '*')
digitalclock.print_number(1, 6, '*')
digitalclock.print_number(2, 7, '*')
digitalclock.print_number(3, 8, '*')
digitalclock.print_number(4, 9, '*')
digitalclock.print_number(5, 10, '*')
digitalclock.print_number(6, 11, '*')
digitalclock.print_number(7, 12, '*')
digitalclock.print_number(8, 13, '*')
digitalclock.print_number(9, 14, '*')And here's the expected output:
*****
*   *
*   *
*   *
*****

     *
     *
     *
     *
     *

*******
      *
*******
*
*******

********
       *
********
       *
********

*       *
*       *
*********
        *
        *

**********
*
**********
         *
**********

***********
*
***********
*         *
***********

************
           *
           *
           *
           *

*************
*           *
*************
*           *
*************

**************
*            *
**************
             *
             *
 Part 2d
Write two new functions that simulate the addition and subtraction operators. Each of these functions should accept a width value as an argument (integer) and a single character (string) -- the function should then return the generated pattern. You can assume the operators will always be 5 units high. Again, these functions should be placed in your 'digitalclock.py' module. Here's some sample code:
temp = digitalclock.plus(5, '*')
print(temp)
print()

temp = digitalclock.minus(5, '*')
print(temp)Which will generate ...
  *
  *
*****
  *
  *
*****
Note that your "plus" sign may look odd if it is rendered using an even size value - for example:
# rendered using a width of 6
  *
  *
******
  *
  *
To fix this you should double up the vertical line in the center for even sizes, like this:
# rendered using a width of 6
  **
  **
******
  **
  **

Part 2e
Write a function called "check_answer" which will determine if a given addition or subtraction problem was solved correctly. This function should be inside of your "digitalclock.py" module. Here's the IPO notation for the function:
# function:   check_answer
# input:      two numbers (number1 & number2, both integers); an answer (an integer)
#             and an operator (+ or -, expressed as a String)
# processing: determines if the supplied expression is correct.  for example, if the operator
#             is "+", number1 = 1, number2 = 2 and answer = 3 then the expression is correct
#             (1 + 2 = 3).
# output:     returns True if the expression is correct, False if it is not correct
Here's a sample program that you can use to test your function:
answer1 = digitalclock.check_answer(1, 2, 3, "+")
print (answer1)
answer2 = digitalclock.check_answer(1, 2, -1, "-")
print (answer2)
answer3 = digitalclock.check_answer(9, 5, 3, "+")
print (answer3)
answer4 = digitalclock.check_answer(8, 2, 4, "-")
print (answer4)And here's the expected output:
True
True
False
FalsePart 2f
Finally, put everything together and write a program that lets the user practice a series of random addition and subtraction problems. Begin by asking the user for a number of problems (only accept positive values) and a size for their numbers (only accept numbers between 5 and 10). Also prompt them for a single character to be used to generate their patterns - only accept single character strings (i.e. 'a' is OK, but 'apple' is not). The generate a series of random addition and subtraction problems - display the numbers to the user with your digital display functions. Then prompt the user for an answer and check the answer using your check_answer function. Your program should also keep track of how many correct questions the user answered during their game. Here's a sample running of the program:
How many problems would you like to attempt? -5
Invalid number, try again

How many problems would you like to attempt? 5
How wide do you want your digits to be? 5-10: 3
Invalid width, try again

How wide do you want your digits to be? 5-10: 5

What character would you like to use? foo
String too long, try again
What character would you like to use? *

Here we go!

What is .....

*****
    *
*****
    *
*****

  *
  *
*****
  *
  *

    *
    *
    *
    *
    *

= 4
Correct!

What is .....

*****
    *
*****
*
*****
*****
*****
    *
    *
    *
    *

= -5
Correct!

What is .....

    *
    *
    *
    *
    *
*****
*****
*
*****
    *
*****

= 0
Sorry, that's not correct.

What is .....

*****
    *
*****
*
*****

  *
  *
*****
  *
  *

    *
    *
    *
    *
    *

= 3
Correct!

What is .....

*****
    *
*****
*
*****

  *
  *
*****
  *
  *

*****
    *
*****
*
*****

= 4
Correct!

You got 4 out of 5 correct!
 Part 3: Extra Credit
You can add any of the following features to your game for extra credit. These are optional features and are not required to receive full credit on the assignment!:
Add multiplication problems to the game. You will have to update your check_answer function as well as add a new operator function to display the multiplication sign. Note that the visual representation of your multiplication sign does not need to be "perfect" - try and come up with a function that somewhat looks like a "X" or "*" character.
Add division problems to the game. You will have to update your check_answer function as well as add a new operator function to display the division sign. For division problems you need to ensure that the result of the problem you present is a whole number. For example, the following would be valid division problems for this game:2 / 2 = 1
4 / 2 = 2
9 / 3 = 3However, the following would NOT be valid since the answers are not whole numbers:5 / 2 = 2.5
9 / 8 = 1.125
8 / 3 = 2.6666666 (repeating)Ensure that the division problems you supply to your players always yield a whole number result. You may need to generate a few different numbers in order to do this (hint: while loop!).
Add in a "drill" mode to your game. If this mode is activated by the user they will be re-prompted to solve a problem that they got incorrect. Points are turned off in "drill" mode since the user can attempt a problem multiple times. Here's an example:How many problems would you like to attempt? 2
How wide do you want your digits to be? 5-10: 5
Would you like to activate 'drill' mode? yes or no: yes

What is .....

*****
*   *
*   *
*   *
*****

  *
  *
*****
  *
  *

*****
    *
*****
    *
*****

= 1
Sorry, that's not correct.
= 2
Sorry, that's not correct.
= 3
Correct!

What is .....

*****
*   *
*****
*   *
*****

  *
  *
*****
  *
  *

*****
*
*****
    *
*****

= 13
Correct!

Thanks for playing!
Keep track of statistics by problem type. For example, at the end of your program you could display a display like the following that summarizes the performance of the player:Total addition problems presented:  5
Correct addition problems: 4 (80.0%)

Total subtraction problems presented: 4
Correct subtraction problems: 3 (75.0%)

No multiplication problems presented

Total division problems presented: 1
Correct division problems: 0 (0.0%)If you implemented "drill" mode you should modify your statistics display to include information about how many "extra" attempts it took so solve those problems. For example:Total addition problems presented:  5
# of extra attempts needed: 0 (perfect!)

Total subtraction problems presented: 4
# of extra attempts needed: 1

No multiplication problems presented

Total division problems presented: 1
# of extra attempts needed: 5

Programming Homework Help

Programming Homework Help

Programming Homework Help. ENT 586 University of Phoenix Wk 4 Enterprise Information System Presentation

  • This is a team assignment. Only do YOUR SLIDES Analyze enterprise information systems in a presentation

Hi Team,

I have hopes that as a team we can get a start on this week’s assignment early this week. The first question is who can take the lead and what sections will each of the five (5) of us be willing to complete? If the seven (7) bullet points each have 2 or 3 slides completed the slide requirement will be met. I can take the first two bullet points and post them by Thursday.

Analyze enterprise information systems in a presentation with a minimum of 15 to 20 slides which includes:

  • A description of enterprise information systems – Eileen
  • A summary of enterprise data management systems in the context of the data life cycle – Eileen
  • An explanation of the role of enterprise information systems in facilitating collaboration
  • An overview of emerging information system technologies such as cloud computing, virtualization, and big data
  • A summary of BI methodologies and business analytics
  • An assessment of techniques to identify market trends and business opportunities
  • A summary of real-world examples of how BI improved enterprise competition and performance
  • A summary of BI methodologies and business analytics—THIS IS MINE SO DO 3 SLIDES ON THIS TOPIC
  • An assessment of techniques to identify market trends and business opportunities—THIS IS MINE SO DO 3 SLIDES ON THIS TOPIC
  • Programming Homework Help

    Programming Homework Help

    Programming Homework Help. New York University Development of a Weather Application Project

    In your small group, propose how you could add a function to the program.

    This means that the weather application should contain an array, a loop, a branching statement and a function.

    For example, you could use a function to prompt the user for input, or a function that can perform a calculation of some sort (i.e. Fahrenheit to Celsius). This is up to your group.

    Below is the previous question as the reference, only need to answer the above one.

    Write a program that provides a weather alert. Make sure your program does the following:

    • Set the temperature to be a variable.
    • Use either an IF statement or a SWITCH statement to determine what type of advisory to give for the temperature variable.
      • If the temperature is 90 degrees or above, the program alerts a heat advisory
      • If the temperature is 80 – 90, the program alerts a heat warning
      • Do for three more levels of temperatures.

    Programming Homework Help

    Programming Homework Help

    Programming Homework Help. Abbott Academy Find Union and Intersection for Linked List Single Java Coding Task

    1. Find Union and Intersection of two sets. Given two sets (elements
    in a set are distinct), write a method that finds the union and intersection of two sets using
    linked list. E.g., given A= {6,1,3,20,7} and B={2,6,8,3,5}. your algorithm should print Union as (1, 2, 3, 5, 6, 7, 8,20)
    and Intersection as (3, 6). Note that the elements of union and intersection can be
    printed in any order.

    2. Reverse a singly linked list. Write reverselteratively() method
    which reverses a single linked list using a three-pointers approach and using loops. It traverses
    through the linked list and adds nodes at the beginning of the singly linked list in each iteration.
    It uses three reference variables (pointers) to keep track of previous, current, and next nodes.

    Programming Homework Help

    Programming Homework Help

    Programming Homework Help. California Southern University Spaceship C Program

    – Gain experience using strings, arrays, functions and their interactions

       – Gain more experience using arrays (one/multi dimensional)
       – Gain more experience using File Input/Output
       – Gain more experience using modular programming (functions)
       – Reinforce knowledge of previous programming topics
       – Use of  structure
       – Continue to refine C programming skills by following the C coding standard
       – Learn to apply “C” programming to problem solving

    Problem Description:
    Your spaceship is navigating an asteroid field; you are to design a system that will log and
    display the distance between your spaceship and the asteroids. Each asteroid has (x, y, z) position
    in space, where x, y, and z are the distances in kilometers (east-west, north-south, up-down) from
    your spaceship which is at 0,0,0.
    Your program will read a file asteroids.txt that represents the ID and location of each asteroid.
    The distance between your spaceship and each asteroid is calculated based on asteroid’s X, Y, Z
    position using the following formula.
    ? X2 + Y2 + Z2
    This program must be secure. The user must input their name and pin number, if both
    (name and pin) matches the list you have in a text file on the disk (ident.txt), than the
    user gets access to this program. The program should allow 3 tries for name and
    password entry, if unsuccessful after 3 tries the program should print a message to the
    user and terminate.
    Program Input/ Requirements
    ? The name and the pin number of the user
    ? A file called ident.txt which contains names and pin numbers. Example below.
     leia       12345
          darth     23456
           r2d2     34567
           solo      45678
           jabba    56789
           yoda      67890

    ? Input to the program will be generated using random generator for X, Y, and Z
    coordinate. Random generator will generate numbers between 1 and 1000 (including 1
    and 1000). This data will be stored in a text file called asteroids.txt. Assume the speed
    of asteroids is 25Km/Sec. There must be at least 10 asteroids’ data in the file. The text
    data file asteroid.txt has the following format: only the numbers and IDs are in the file
    not the heading (ID, X,Y,Z)
    ID X Y Z
    A 600 200 59
    B 999 999 15
    C 100 1000 555
    D 500 202 666
    – – – –
    – – – –
    Program output / Requirements
    1- Write the following data to a file called distance.txt, after calculating the distance
    A 600 200 59 (whatever the result is)
    B 999 999 15 (whatever the result is)
    C 100 1000 555 (whatever the result is)
    D 500 202 666
    – – – – – – – –
    2- Print an alarm message to screen with X, Y, and Z positions of asteroids within a distance
    of less than 750 km.
    The alarm message could look like the following: only two digits after the decimal point.
    Warning  –  Warning  – Warning
    Nearest asteroid B at ??, ??, ??: ?? km away 

    Time to impact ??? seconds
    asteroid B at at ??, ??, ??: ?? km away
    asteroid D at at ??, ??, ??: ?? km away
    – – – – – – – – – –  – – – – – — – – – – – – – – – – – – — – – – – –
    – – – – – – – – – –  – – – – – — – – – – – – – – – – – – — – – – – –
    3- Display a bar chart (character) for distance of the asteroids.
    Example (something like below):
    A |****************************
    B |*********************
    C |*************************
    D |*******
    E |************
    F |
      |
      |
      0——|——|——|——|——|——|——|————————————————-
               Scale appropriately
    4- Rank the asteroids from closest to farthest and write the result into an array using pointers
    to traverse the array. (you need to sort)
    5- Display ranking with the asteroid ID
    Example:
    Asteroid C distance (must be the closest distance)  
    Asteroid E distance (must be the next to the closest )  
    And so on…
    More requirements, In addition to our standards:
    1. The ident.txt file can contain at least 10 names and pin numbers.
    2. Your program should be able to process the minimum of 10 asteroids.
    3. You must use a two dimensional array for the asteroids position data.
    4. You must use structure to hold the data for name and ID number when you read the file
    ident.txt
    5. The main function must do very little other than calling other functions and passing
    parameters to those functions.
    6. Your program should be modularly designed with functions designed to do one task and
    one task well.
    7. Your program must have at least 5 functions not including the main function

    8. Do not use global variables. Pass data back and forth via parameters or as return values.
    9. Make your functions as general as possible so that they can be called more than once if
    needed.
    10. Document your main function as well as every function you write.
    11. Use defined constants for ALL constants in your program.

    Programming Homework Help