Questions
Problem 10 Write down the running time function, T(n), of the program below. def prob10(L): s...

Problem 10 Write down the running time function, T(n), of the program below.

def prob10(L):
    s = 0
    for x in L:
        for y in L:
            if x+y % 10 == 0:
                print(x, y, x+y)
                s = s + x*y
    return s

ANSWER:

T(n) = ...

***Big-O, Omega, Theta complexity of functions, Running time equations of iterative functions & recursive functions,  Substitution method & Master theorem

Please answer within these topics.***

In: Computer Science

Create a program that determines the name of the person with the highest or lowest number...

Create a program that determines the name of the person with the highest or lowest number of votes. The data will be in two arrays. The first array is of type String and has the following names in it: Mike Muldune Justin Meiber Clark Kent Ana Karina The second array is of type integer and has the following numbers in it: 2324, 2425, 3344 and 2526. Ask the user to enter a 1 for highest and 2 for lowest. If the user enters a 1, print the name of the person with the highest number of votes and the number of votes received. It the user enters a 2, print the name of the person with the lowest number of votes and the number of votes received.

In: Computer Science

Write the following questions as queries in Relational Algebra. Use only the operators discussed in class...

Write the following questions as queries in Relational Algebra. Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming —in particular, no outer joins or aggregations). Type your answers. If you can’t find Greek letters in your word processor, you can simply write out the operator, all uppercase (i.e. ’SELECT’). Please use renaming consistently, as indicated in the handout. Before starting, make sure you understand the schema of the database. If you are in doubt about it, please ask the instructor.

Assume a database with schema:

ACTOR(name,age,address,nationality)

MOVIE(title,year,genre,budget,director-name,studio)

APPEARS(name,title,salary)

Write the following questions in Relational Algebra:

1. List the titles and budgets of movies where actor Keanu Reeves appeared in 1999.

2. List the names and ages of actors who have appeared in a comedy produced by Studio ’MGM’.

3. List the names of directors who have directed a drama or a comedy.

4. List the names of directors who have directed a drama and a comedy.

5. List pairs of actors who have appeared together in a movie (note: the schema of your answer should be (name1,name2), where both name1 and name2 are names of actors.

In: Computer Science

For example My IP address 128. 0. 0. 1 My IP address 53. 20. 62. 201...

For example

My IP address 128. 0. 0. 1

My IP address 53. 20. 62. 201

My IP address 77. 122. 180. 76

My IP address 54. 33. 11. 11

My IP address 33. 33. 2. 11

My IP address 202. 29. 205. 69

My IP address 215. 18. 15. 185

My IP address 56. 66. 33. 30

How do you write a regular expression that covers all IP addresses and display all list using a loop in Python

In: Computer Science

Write the method: public static String removeSubstring(String s1, String s2) Method removeSubstring(String s1, String s2) Must...

Write the method: public static String removeSubstring(String s1, String s2) Method removeSubstring(String s1, String s2)

Must do 3 things:
1. Take two parameters, the original String (String s1) and the substring (String s2) that is to be removed;
2. Create a new String that consists of the original String data less all occurrences of the substring data;
3. Return the new String.

Note:
1. The data to be removed is each occurrence of the complete substring, not individual characters of the substring. For example, if the original String is “hello” and the substring is “el”, the String to be returned is “hlo” and not “ho”.
2. The second, third and fourth examples include spaces, so the substring also includes a space that is to be removed.

PLEASE HELP ME UNDERSTAND HOW TO COMPLETE THIS CODE BELOW:

public class RemoveSubstring
{
   public static void main(String [] args)
   {

   String testString1 = "173167176531317";
   String subStr1 = "17";
  
   String testString2 = "I am not happy";
   String subStr2 = "not ";
  
   String testString3 = "I am not happy and not glad";
   String subStr3 = "not ";
  
   String testString4 = "neither this nor that works!";
   String subStr4 = "neither this nor ";
  
   System.out.println("The string " + testString1 + " without " + subStr1 + " is: " + removeSubstring(testString1, subStr1));
   System.out.println("The string " + testString2 + " without " + subStr2 + " is: " + removeSubstring(testString2, subStr2));
   System.out.println("The string " + testString3 + " without " + subStr3 + " is: " + removeSubstring(testString3, subStr3));
   System.out.println("The string " + testString4 + " without " + subStr4 + " is: " + removeSubstring(testString4, subStr4));

   }

   public static String removeSubstring(String s1, String s2)
   {
  
return("PLEASE HELP ME UNDERSTAND HOW THIS WORKS OR WHERE TO LEARN MORE I AM LOST HERE THANK YOU");
   }

}

In: Computer Science

2. Explain why it is important to develop an effective data governance program What industries can...

2. Explain why it is important to develop an effective data governance program

What industries can you think of that might have strict data governance regulations in place?

What are the advantages of good data governance?

What are the characteristics of weak or non-existent data governance?

3. How can virtualization reduce IT costs while improving performance?

4. Discuss your own experiences with virtualization. Do you have any?

5. How does virtualization lead us to cloud computing?

6. Do you see Cloud as a form of outsourcing, or is it more than that?

7. what is your understanding of the 3 main delivery models?

8. What aspects of any of the 3 main delivery models do you utilize personally, or through

work?

9. What disadvantages can you see with cloud computing?

In: Computer Science

Write a program that reads in a single integer. Display a message depending on what is...

Write a program that reads in a single integer.

Display a message depending on what is given:

  • When the number is 42, output "42 is the Ultimate Question of Life, the Universe, and Everything."
  • When the number is 2020 output "2020 is the current year."
  • When the number is greater than 1000 and less than 3000 output "1500 could be a year." where 1500 is the number the user originally inputted
  • When none of the above, output "no idea."

One example shown below with the user input highlighted:

Give a number: 2020
2020 is the current year.
-- Font family -- -- Font size --

In: Computer Science

1. The following program has syntactic errors. Identify the errors and correct them. Compile the corrected...

1. The following program has syntactic errors. Identify the errors and correct them.

Compile the corrected program and submit a screeshot showing that the program has 0 (zero) errors.

You can use  https://repl.it/languages/c  or  https://www.onlinegdb.com/

#include <stdio.h>

int main (Void)

{

      INT sum;

      /* Compute result

      sum = 25 + 37 - 19;

      // Display result

      printf (“The answer is %i\n”, sum);

      return 0;

} // main

2. What is the purpose of a variable?

a.

To assign values

b.

To perform calculations

c.

To hold a value

d.

To hold a constant value

In: Computer Science

Data science use in construction required in typed words contain at least 1000 words

Data science use in construction

required in typed

words contain at least 1000 words

In: Computer Science

what aggregate functions priobably would be usefull to school administrators to analyze student population and why?...

what aggregate functions priobably would be usefull to school administrators to analyze student population and why? (school environment database management)

In: Computer Science

Iterative Process a. What is meant by the iterative development process? Briefly explain its key attributes...

Iterative Process

a. What is meant by the iterative development process? Briefly explain its key attributes and benefits .

b. What is the Agile Manifesto and what are some of its key values? explain at least 2 values in terms of their implications on the agile model.

In: Computer Science

NOTE give complete and accurate answers FOR 30 marks 1(a) A Give the output for the(2*5)...

NOTE give complete and accurate answers FOR 30 marks

1(a) A Give the output for the(2*5)

array([ 0, 1, 8, 27, 64, 125, 216, 343, 512, 729])

a. a[:6:2] = -1000 (ii) a[ : :-1] )

b. Display the values of 1D array using for loop?


c. Write a code to print a 3D array?


d. How to print the transpose of a 2D array?


e Write a function to sort the array row and coloumn wise ?

(b) You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.(5)

(c) Normally in all engineering colleges, there will be a long vacation after every even semester and a short vacation after every odd semester.Create a program in python to determine whether he will have a long vacation or short vacation at the end of a particular semester.(5)

(d) Design a 2D array to store the marks of six subjects of a student and display its total marks and average percentage?(5)

(e) Differentiate between VIEW and COPY?(5)

A Give the output for the(2*5)

array([ 0, 1, 8, 27, 64, 125, 216, 343, 512, 729])

a. a[:6:2] = -1000 (ii) a[ : :-1] )

b. Display the values of 1D array using for loop?


c. Write a code to print a 3D array?


d. How to print the transpose of a 2D array?


e Write a function to sort the array row and coloumn wise ?

Q2. You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.(5)

Q3 Normally in all engineering colleges, there will be a long vacation after every even semester and a short vacation after every odd semester.Create a program in python to determine whether he will have a long vacation or short vacation at the end of a particular semester.(5)

Q4 Design a 2D array to store the marks of six subjects of a student and display its total marks and average percentage?(5)

Q5 Differentiate between VIEW and COPY?(5)

A Give the output for the(2*5)

array([ 0, 1, 8, 27, 64, 125, 216, 343, 512, 729])

a. a[:6:2] = -1000 (ii) a[ : :-1] )

b. Display the values of 1D array using for loop?


c. Write a code to print a 3D array?


d. How to print the transpose of a 2D array?


e Write a function to sort the array row and coloumn wise ?

Q2. You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.(5)

Q3 Normally in all engineering colleges, there will be a long vacation after every even semester and a short vacation after every odd semester.Create a program in python to determine whether he will have a long vacation or short vacation at the end of a particular semester.(5)

Q4 Design a 2D array to store the marks of six subjects of a student and display its total marks and average percentage?(5)

Q5 Differentiate between VIEW and COPY?(5)

A Give the output for the(2*5)

array([ 0, 1, 8, 27, 64, 125, 216, 343, 512, 729])

a. a[:6:2] = -1000 (ii) a[ : :-1] )

b. Display the values of 1D array using for loop?


c. Write a code to print a 3D array?


d. How to print the transpose of a 2D array?


e Write a function to sort the array row and coloumn wise ?

Q2. You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.(5)

Q3 Normally in all engineering colleges, there will be a long vacation after every even semester and a short vacation after every odd semester.Create a program in python to determine whether he will have a long vacation or short vacation at the end of a particular semester.(5)

Q4 Design a 2D array to store the marks of six subjects of a student and display its total marks and average percentage?(5)

Q5 Differentiate between VIEW and COPY?(5)

A Give the output for the(2*5)

array([ 0, 1, 8, 27, 64, 125, 216, 343, 512, 729])

a. a[:6:2] = -1000 (ii) a[ : :-1] )

b. Display the values of 1D array using for loop?


c. Write a code to print a 3D array?


d. How to print the transpose of a 2D array?


e Write a function to sort the array row and coloumn wise ?

Q2. You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.(5)

Q3 Normally in all engineering colleges, there will be a long vacation after every even semester and a short vacation after every odd semester.Create a program in python to determine whether he will have a long vacation or short vacation at the end of a particular semester.(5)

Q4 Design a 2D array to store the marks of six subjects of a student and display its total marks and average percentage?(5)

Q5 Differentiate between VIEW and COPY?(5)


This is a python assignment

In: Computer Science

Copy the following Python fuction discussed in class into your file: from random import * def...

Copy the following Python fuction discussed in class into your file:

from random import *
def makeRandomList(size, bound):
    a = []
    for i in range(size):
        a.append(randint(0, bound))
    return a

a. Add another function that receives a list as a parameter and computes the sum of the elements of the list. The header of the function should be

def sumList(a):

The function should return the result and not print it. If the list is empty, the function should return 0. Use a for loop iterating over the list.

Test the function in the console to see if it works.

b. Write a function that receives a list as a parameter and a value, and returns True if the value can be found in the list, and Falseif not. Use a for loop that goes over the list and compares each element to the value. If any of them is equal to the value, it returns True. Otherwise after the loop is done, you can return False. Thus, if the loop completes without a return statement happening, then the value is not in the list. The function header should look like this:

def searchList(a, val):

Test this second function a few times the same way as the first one.

c. Below the three functions, add a piece of code that

  • calls the function makeRandomList to generate a list with a size of 10 and a bound of 50, stores it in a variable, and prints it.
  • Then it should call the function sumList to compute the sum and also print the result.
  • Finally, it should ask the user for a value, input it and store it in a variable, then call the function searchList with the list and this variable, and output the result.

Test the program to make sure that it works fine.

In: Computer Science

How do i remove all javacript text from a block of text in python for example...

How do i remove all javacript text from a block of text in python

for example

Removal of any HTML tags – any text between a < character and a >you can assume is a HTML tag and needs to be removed.. Removal of JavaScript code – before you remove your HTML tags above, you will also need to remove any text that is between the <script> or </script> tags "Note that a <script> or </script>tag can have any amounts of whitespace or other text between the "" character and valid script tag that must be removed.

Im also not allowed to import any module form the python library

In: Computer Science

This is an exercise in correctly implementing insertion sort and selection sort. This assignment includes a...

This is an exercise in correctly implementing insertion sort and selection sort.


This assignment includes a text data file containing information on tutorial websites for a variety of programming languages. The data file is named Tutorials. It contains records of programming tutorial websites. The record structure for this text file is:


FIELD 1 = Programming Language

FIELD 2 = Name and Description of Website

FIELD 3 = URL Web Address of Language Tutorial


The structure of the file is that there is a separate line for each field/property/attribute of the record. Every three lines makes up one physical record.


For those of you who took computer science I here at CCP, you covered using a bubble sort to sort elements in a collection.


In your project, create two methods for the project – one that performs a selection sort on your Tutorial Website object array and one that performs an insertion sort on your Tutorial Website object array.


You should create a user defined object of Tutorial Website type. The object should have three properties:

Language Name
Website Description
Website URL

Your object will need to implement the comparable interface for this object. You may choose the property is used to determine the order of your object. Language name would be the best choice.


Your project should read the list of programming language tutorials in from the text data file, and load the data into a Tutorial Website object . In the process it should add the object into an array. After the array is fully loaded, print the list in unsorted order. sort the list in the array in ascending order using a Selection Sort Algorithm. After the list in the array is sorted in ascending order using the selection sort, print the list to the screen and write the list to CSV file. You should then sort the list in descending order using a Insertion Sort Algorithm. After the list in the array is sorted in ascending order using the selection sort, print the list to the screen and write the list to a CSV file in the project folder. After the list in the array is sorted in descending order using the Insertion sort, print the list to the screen and write the list to a CSV file in the project folder.

In: Computer Science