rknhassignments

rknhassignments

Lv3

RKNH AssignmentsCUNY-Lehman College

1 Follower
0 Following
0 Helped

ANSWERS

Published42

Subjects

English7Ethics2Algebra3Probability2Computer Science12Calculus4Biology1Statistics3Chemistry8
Answer: To solve the problem of checking if one string (s2) is a substring of ...
  1. Given the following main program

    #main
    a = [5,2,9,6,3] doubleList(a) print a

    Implement the function named doubleList that takes one list argument and modifies the list so that each element in the list is doubled. The statement print(a) in the main program will then have to print [10,4,18,12,6]

  2. Given the following main program

    #main
    a = [5,2,9,6,3]
    b = reversedList(a) print b
    print a

    Implement the function named reversedList that takes one list argument and returns a list that contains the elements in the list argument in reverse order. The statement print(b) in the main program will then have to print [3,6,9,2,5]. The statement print(a) must print the original list [5,2,9,6,3] unaffected. This means your function should not modify the list argument.

  3. Given the following main program

    #main
    a = [5,2,9,6,3] reverseList(a) print a

    Implement the function named reverseList that takes one list argument and reverses the list so that the modified list contains the same elements in reverse order. The statement print(a) in the main program will then have to print [3,6,9,2,5]

  4. What is the return value of the functions doubleList, reversedList and reverseList in questions 1, 2, and 3 above?

  1. Given the following main program

    #main
    a = [5,2,9,6,3]
    b = evenElements(a) print b

    Implement the function named evenElements that takes one list argument and returns a list that contains the elements in the list argument that are even integers. The statement print(b) in the main program will then have to print [2,6]. What is the return value of the function? Your function should not modify the list argument.

  2. Given the following main program

    #main
    a = [5, 2, 9, 6, 3, 7, 19, 4, 8, 17, 21, 20, 15] removeOddElements(a)
    print a

    Implement the function named removeOddElements that takes one list argument and modifies the list so that all odd integers in the list are removed. The statement print(a) in the main program will then have to print [2,6,4,8,20]. What is the return value of the function?

  3. Part A
    #Main program A=[5,8,2,0,-5,3] n=-5
    answer = isFound(A, n) if answer == True:

    print "The integer is found in the list" else:

    print "The integer is not found in the list."

    Consider the main program shown above. Write a Python function named isFound that takes a list of integers and an integer as arguments and returns True if the integer is found in the list; otherwise it returns False.

    Remark: You are NOT allowed to use the in operator or any other built in function when you write this function. Instead, you must write a loop to go through the elements of the list.

    Part B

    Give the following main program

page2image58001280 page2image58001664

#main
A = [5,2,9,6,3]
B = [2,4,3,9,7,1,6,5]
flag = isList1InList2(A, B) if flag:

print "The list", A, "is contained in the list", B else:

print "The list", A, "is not contained in the list", B

Implement the function named isList1InList2 that takes two list arguments and returns True if and only if each element of the first list argument are found in the second list argument; otherwise it returns False.

Remark: You are NOT allowed to use the in operator or any other built in function when you write this function. Instead, if you wish, you can use the function you wrote in Part A.

For the lists shown in the main program, your function must return True because each element of list A is found in list B.

  1. A given List is known as Palindrome List if the reverse of the List contains the same elements in the same order of the original List. For example the List of integers [2, 5, 0, 3, 3, 0, 5, 2] is a Palindrome because the reverse of the List which is [2, 5, 0, 3, 3, 0, 5, 2] contains the same elements in the same order as the given List. However the List [1, 2, '2', 1] is not Palindrome because its reverse which is [1, '2', 2, 1] does not contain the same elements in the same order as the given List.

    Write a Python function named isPalindrome that takes a List as argument and returns True if the argument is a Palindrome List; otherwise it returns False. You don't need to write the main program; just write the function. If you would like to test your function, then it is ok to write the main program too but you will not get any mark for the main program.

  2. Given your function in question #7 above, what is the output of the following code: a=[]

    b = [5,2,9,6,3]

    print isList1InList2(a,b)

  3. Given your function in question #7 above, what is the output of the following code:

    a=[]
    b=[]
    print isList1InList2(a,b)

  4. Given your function in question #7 above, what is the output of the following code: a = [5,2,9,6,3]

    b=[]

print isList1InList2(a,b)

  1. Given the following main program

    #main
    a=[]
    n = readListElements(a)
    print "The user entered", n, "elements to the list" print a

    Implement the function named readListElements that takes one list argument and modifies the list by repeatedly asking the user to enter integer values and then appending them to the list. The process stops when the user enters -1000. The stopping value -1000 should not be appended to the list. Moreover your function must count the appended elements and return it. Example if the user enters the integers 31, -4, 9, 1,-1000 then your function must modify the list a to a = [31, -4, 9, 1] and return the number elements added which is 4.

  2. Write a function named createRandomList that takes an integer argument n and returns a list with n elements. The elements must be random numbers in the range [0,100]

  3. Given the following main program:

    #main

       n = int(input("How many elements do you want in your list? "))
       a = createList(n)
       s1 = sumOfElementsAtEvenIndexes(a)
       print s1
    
       s2 = sumOfElementsAtOddIndexes(a)
       print s2
       s3 = sumOfAllElements1(a)
       print s3
    
       s4 = sumOfEvenElements(a)
       print s4
       s5 = sumOfOddElements(a)
       print s5
    
       s6 = sumOfAllElements2(a)
       print s6
       if (s3 != s6):
    
             print "Something is wrong in your program."
       else:
    
             print "Looks like you have done a good job."
    

    Implement the functions as follows:

  •  createList: returns a list object with n elements. The elements are generated randomly so that each element is in the range [15,45]

  • sumOfElementsAtEvenIndexes: returns the sum of the elements at even indexes. Use a for loop or a while loop.

  • sumOfElementsAtOddIndexes: returns the sum of the elements at odd indexes. Use a for loop or a while loop.

  • sumOfAllElements_A: returns the sum of all the elements in the list using the functionssumOfElementsAtEvenIndexes and sumOfElementsAtOddIndexes. Here you are NOT allowed to use any loop; instead make function calls as described.

  • sumOfEvenElements: returns the sum of the even integer elements in the list. Use a for loop or a while loop.

  • sumOfOddElements: returns the sum of the odd integer elements in the list. Use a for loop or a while loop.

  • sumOfAllElementsB: returns the sum of all the elements in the list using the functions sumOfEvenElements and sumOfOddElements. Here you are NOT allowed to use any loop; instead make function calls as described.

17. Most data compression algorithms like winzip, gzip, lzip and etc are based on the frequency distribution of characters in a given string. Write a function named getFreqDistribution that takes a string argument and returns a LIST that has length 26 such that the first element of the list is the number of appearance of 'a' or 'A' in the string, the second element is number of appearance of 'b' or 'B', and so on so forth.

I'm studying python 2 and have a lot of troubles with solving these homework questions.

Answer: Problem 1: Implement doubleList python Copy code # main program a = [5...
1.Create a list that contains 10 successive integers starting with the value in the variable start. For example, if start is 7, the resulting list should be [7, 8, 9, 10, 11, 12, 13, 14, 15, 16]. Store the list in a variable named my_list. Assume that the value of start has already been set.
 
2.Create a list that is made up of the first half of the elements of a list called original_list. Store the new list in a variable called half_list. Assume that the original list has already been initialized and contains an even number of elements.
 
 
3. Write a predicate function called same_ends that accepts a list of integers and an integer (n) as arguments. Return True if the first n numbers in the list are the same as the last n numbers in the list, and False otherwise. For example, if the list was [1, 2, 3, 4, 99, 1, 2, 3, 4], the function would return True if n is 4 and False if n is 3. Assume that n is between 1 and the length of the list, inclusive.
 
4.Write a function called highest_values that accepts as arguments a list of numeric values and a single integer (n). The function should return a list made up of the largest n values from the argument list in order from lowest to highest. For example, if the argument list is [46, 82, 25, 61, 70, 33, 54] and n is 3, the return value should be [61, 70, 82]. Assume that the argument list contains at least n elements.
 
5.Assume that a list of integers stored in a variable named original contains exactly two elements that are zero. Write code that creates a separate list that contains the elements from original that are between the two zeros. Do not include the zeros in the new list. Store the list in a variable named between_zeros.
 
6. Write a function called price_range that accepts a list of floating-point numbers representing prices as an argument and returns the the difference between the highest price and the lowest price. Do NOT use the built-in functions max or min in your solution. Assume that all prices are positive values and that none of them exceed 10,000.00.
 
7. Write a function called count_vowels that accepts a string argument that represents a word and returns the number of vowels that are in the word. The vowels are A, E, I, O, and U (ignore the 'sometimes Y' rule). Count both uppercase and lowercase vowels.
 
8.
Assume that the variable table holds a two-dimensional list of integers. Write code that computes the sum of all elements in the table, assigning the result to the variable table_sum.

 

Answer: Create a list of 10 successive integers starting from a variable start...

I have to do this assignment until Thursday morning. I have to use Prolog.

Note: "Word-tuple" is a 3-tuple of the form "(word,POS,sense_number)"

Note: "Synset" is the list of word-tuples of a synset.

 

  1. Define a predicate offset_to_synset(+Offset,?Synset) that succeeds if Synset is the list of all the word-tuples of Offset. (Tip: use findall/3.)
  2. Define a predicate wordTuple_to_offset(?WordTuple,?Offset) that succeeds if WordTuple belongs to the synset with offset Offset.
  3. Define a predicate wordTuple_to_synset(+WordTuple,?Synset) that succeeds if WordTuple belongs to Synset. Look up a few words using your new predicate.
  4. Define a predicate wordTuple_to_gloss(+WordTuple,-Gloss) that succeeds is Gloss is the gloss that corresponds to WordTuple. Look up a few words using your new predicate.
  5. Define a predicate synonymous(?WordTuple1,?WordTuple2) that succeeds if WordTuple1 and WordTuple2 are distinct and synonymous word-tuples.
  6. Define a predicate polysemous(?Word) that succeeds if Word is a polysemous word.
  7. Compute the number of polysemous words in WordNet. (Tip: use a combination of findall/3, list_to_set/2 and length/2.)
  8. Define a predicate meronym(?Offset1,?Offset2) that succeeds if Offset2 is a meronym of Offset1 (note that the predicates for the three different kinds of meronyms are spread out over three files).
  9. Define a predicate hyponym(?Offset1,?Offset2) that succeeds if Offset1 is a direct hyponym of Offset2.
  10. Define a predicate coordinate(?Offset1,?Offset2) that succeeds if Offset1 and Offset2 have the same hypernym.
  11. Hypernymy is a transitive relation. Define a predicate trans_hypernym(?Offset1,?Offset2) which computes this relation.
  12. Define a predicate trans_hypernym_path(?Offset1,?Offset2,?Path) that succeeds if Path is is a list of offsets leading from Offset1 to Offset2.
Answer: 1. Define a predicate offset_to_synset(+Offset, ?Synset) This predicat...
Answer: To find the percent abundance of the second isotope, we can use the gi...
Answer: To calculate the atomic mass of copper (AavgA_{\text{avg}}Aavg​), we u...
.
Answer: 6.9057
Answer: Write symbols for each of the isotopes: a. Each atom contains one prot...
Answer: So, the answers are: b. rubidium a. F, Cl, S, Br d. nitrogen-15 has th...
Answer: Name of the Element: Chlorine (Cl) Common Isotopes and Their Percent A...
Answer: World's Greatest Element Presentation: Carbon Element Symbol: CElement...
.
Answer: Explanation: Document Structure: <!DOCTYPE html>: Declares the d...
Answer: No, HTML (Hypertext Markup Language) is not a programming language. HT...
Step-by-step explanation: 1. History of Java Programming Language 1991: Java's...

python is nowadays the most popular programming language but you can say it is the fastest growing programming language nowadays. The concept of python came into picture in 1989 and even java was you know the concept of java or python i 'll pronounce it as python right okay now see python is being used right now the main areas are machine learning data science artificial intelligence. White has become so popular because first thing is it is easy to learn easy to understand and it has wide range of applications i have told you in how many areas almost in every area it 's been used in almost every area. The big giants companies are using this language maybe the main language or supportive type of language as a support language. python is multi-paradigm language it is general purpose language almost in every field for making everything you can use this language. python is interpreted language without compiled language and is open source so that is why it is having a huge community and rich library many ill you know inbuilt packages modules functions.

 

 

The main areas where Python is being used are in software development, web development, data science,, artificial intelligence,, game development, and mobile apps..NK] Big giants companies are using Python as a support language in their research and development fields.. [UNK] is an easy to-understand, relatively low-level language that is suited for data analysis, software, development,, and game programming..NK] also has a wide range of applications in fields like artificial intelligence and machine learning.. 1.. Python is a general purpose, interpreted language. 2.. Python has a rich library with many preexisting functions and modules that can be used in programs without having to write them from scratch. 3.. Python is a popular language for data science and machine learning due to its built-in libraries and modules.. 4. Python has a large community of developers who can answer questions and help you out if you are struggling with using. It.

 

 

There are lots of career opportunities for this in this field for this language. There are many career opportunities and average salary is also high like it 's from 8 to 12 per nm so that is why it is so popular and i'm sure you are aware about now this language some features who are using it the application areas of python and all. In the next video we will see history of this language first.

Answer: Python has rapidly emerged as a leading programming language, driven b...
Answer: ChatGPT Printing the steps of the Tower of Hanoi problem involves recu...
Answer: ChatGPT Python offers several benefits that contribute to its populari...
Answer: To solve the system of equations: bg−d=babg - d = babg−d=ba d−mg=mad -...
Answer: Given the equations: x=a(sin⁡u+cos⁡v)x = \sqrt{a}(\sin u + \cos v)x=a​...
Answer: (a) Number of outcomes in the sample space: When we toss a fair six-si...
Step-by-step explanation: (a) How many seating arrangements are there? There a...
Answer: Same man, same.
Answer: I have experienced borrowing something and unfortunately losing it. I ...
Answer: Lesson Review Outline: Genre of the Selection: Identify and justify th...
Answer: My stance on the potential of AI in mental health services is cautious...
Answer: Introduction: Have you ever wondered what it might be like to unravel ...

English assignment (language arts)

For this assignment I chose the story “Lob’s Girl” by Joan Aiken

Complete this assignment using your selected novel on short story for this module: 

"Lob's Girl" by Joan Aiken
"Tuesday of the Other June" by Norma Fox Mazer
"Scout's Honor" by Avi
Twenty-One Balloons by William Pene du Bois The Long Road to Gettysburg by Jim Murphy Esperanza Rising by Pam Muñoz Ryan The Watsons Go to Birmingham by Christopher Paul Curtis
 
Part I: Written Review
Introduction
  • a hook to inspire readers to look at or listen to your review. Your hook may be an unusual question, a vivid description, or an interesting statement taken from the book or author.
  • specific information including the title, author, and genre of the story.
  • a brief summary of the setting, characters, conflict, and plot. Provide enough details to get readers interested without giving away information that could spoil the story.
Type your introduction here:
Body
  • transitions that lead your reader from one thought to another.
  • an interesting character in the story. Explain $a$ bit about the character and provide textual evidence to support your ideas.
  • the most interesting event in the story. Describe the scene, explain to the audience why this event is important, and support your ideas with evidence from the text.
  • the tone/mood of the text. Describe the author's attitude about their subject and the feeling the author creates through their diction and syntax.
  • the theme the author is sharing. If you wish, discuss more than one theme. Do not give away the ending, but let readers know what type of life lesson they might learn from reading the text.
  • any other elements you think are successful.
Type your body here:
Conclusion
  • transition that lets your reader know that you are summarizing your thoughts in this final paragraph.
  • a recommendation that mentions the type of audience that would most enjoy reading the material. Is it perfect for sports fans? Is it suited for fans of historical fiction? Will it appeal to people who love animals?
  • clincher to end your review in a memorable way. Create
Type your conclusion here:
Answer: Introduction: Have you ever wondered what it might be like to unravel ...
Answer: Sure Step-by-step explanation:Nice resume though, needs more work.
Activity: Equity Law Assignment Instructions
Overview
Ethics is the study of moral choices that conform to professional standards of conduct. Morals are rules of conduct based on standards of right and wrong. Etiquette is the prescribed code of courteous social behavior. Equity law is based on societies' changing principles in the areas of ethics, morals, and conscience. Society has also added etiquette as being a social necessity.
 
INSTRUCTIONS
Write an essay defining and describing the principles of ethics, morals, conscience, and etiquette as related to the medical office. Find and summarize at leastl peer-reviewed article for each of the 4 categories.
 
Your answers will vary regarding the articles found, but the descriptions should include the following ideas:
 
Ethics: the rules of conduct recognized in respect to a particular class of human actions or a particular group, culture, etc.: medical ethics; Christian ethics.
 
Morals: of, pertaining to, or concerned with the principles or rules of right conduct or the distinction between right and wrong; ethical: moral attitudes.
 
Conscience: capable of or marked by thought, will, design, or perception.
 
Etiquette: the code of ethical behavior regarding professional practice or action among the members of a profession in their dealings with each other: medical etiquette.
 
Your paper must be 2-3 pages, use at least 4 peer-reviewed sources, must be written in current APA formatting, and incorporate a biblical worldview.
Answer: Definitions and Descriptions Ethics: Ethics refers to the set of moral...
Answer: Creating a company culture that promotes both meaningful work and resp...
Answer: The explanation provided is correct. Here's a summary of the calculati...

Step 1: Read The Twelve Dancing Princesses by the Brothers Grimm

Step 2: Complete the Lesson Review.

Lesson Review

Directions: For each question, write your answer in complete sentences. Use supporting details from the lesson to justify your answers. Do not copy and paste text but use your own words to demonstrate understanding of the lesson concepts. Remember to cite your resources. Citation examples are provided below the Review.

1. What is the genre of this story? Are there any other possible genres this story could fall into?

2. What is the exposition of the story? Summarize it in your own words and provide an example of the text.

3. What is the rising action or actions in this story? What is the climax of this selection? What is the falling action in the story? What is the denouement in the story? Do the characters go back to their normal everyday lives?

4. Is there one protagonist or several? Does the story have traditional heroes or heroines (protagonists) and villains (antagonists)?

5. What are the most important traits of the main characters?

6. Are there static characters in this story? List the static characters and give textual evidence to support your response.

7. Are there dynamic characters in this story? List the dynamic characters and give textual evidence to support your response.

8. Character Sketch: Choose one character from the story and complete a character sketch (description). Remember to include specific details. Your response must be a minimum of 7 sentences.

Answer: Genre of the Story: The genre of "The Twelve Dancing Princesses" is a ...
Answer: NiceStep-by-step explanation:It seems like you might be offering a ser...
Answer: What is the question?
Answer: Ignored Step-by-step explanation:Question was a test, please ignore
Answer: Organisms in extreme environments survive through intricate communicat...
My Notes Ask Your Teacher Medical research has shown that repeated wrist extensions beyond 20 degrees increase the risk of wrist and hand Injuries. Each of 24 students at a university used a proposed new computer mouse design, and while using the mouse, each student's wrist extension was recorded. Data consistent with summary values given in a paper are given here. 28 28 23 27 27 25 25 24 24 24 25 28 22 25 24 28 27 26 31 25 28 27 27 25 (a) Use these data to estimate the mean wrist extension for people using this new mouse design using a 90% confidence interval. (Round your answers to three dedmal places.) (b) What assumptions are required in order for it to be appropriate to generalize your estimate to the population of students at this university? O Yes, the assumption would have to be made that the 24 students in the study formed a random sample of people in the country, Yes, the assumption would have to be made that the 24 students in the study formed a random sample of students at this university No, we can generalize the estimate to the population of students at this university. O Yes, the assumption that the 24 students in the study formed a random sample of students at all universities. O No, we cannot generalize the estimate to any population as we have less than 30 students. To the population of all university students? O No, we can generalize the estimate to the population of all university students. O Yes, the assumption would have to be made that the 24 students in the study formed a random sample of people in the country. Yes, the assumption that the 24 students in the study formed a random sample of students at all universities, Yes, the assumption would have to be made that the 24 students in the study formed a random sample of students from this university O No, we cannot generalize the estimate to any population as we have less than 30 students. (c) Based on your interval from part (a), do you think there is reason to believe that the mean wrist extension for people using the new mouse design is greater than 20 degrees? Explain why or why not. No, the entire confidence interval is below 20, so the results of the study would be very likely If the population mean wrist extension were greater than 20. Yes, the entire confidence interval is above 20, so the results of the study would be very unlikely if the population mean wrist extension were as low as 20. No, the confidence interval contains 20, so the results of the study would be very likely if the population mean wrist extension were greater than 20. Yes, the confidence interval contains 20, so the results of the study would be very unlikely if the population mean wrist extension were as low as 20.
Answer: To address the questions given, we will follow these steps: Estimate t...
Answer: Let's analyze the two situations and identify which population members...

Weekly leaderboard

Start filling in the gaps now
Log in