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 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 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 given:
One example shown below with the user input highlighted:
Give a number: 2020 2020 is the current year. |
|
In: Computer Science
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
In: Computer Science
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 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)
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)
In: Computer Science
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
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
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
In: Computer Science
import javax.swing.*;
public class MenuFrame extends JFrame {
public MenuFrame() {
setTitle("Menu Frame");
setSize(500, 500);
MenuListenerExample myMenu = new
MenuListenerExample();
setJMenuBar(myMenu);
setLayout(null);
add(myMenu.textArea);
}
public static void main(String[] args) {
MenuFrame frame = new MenuFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
import javax.swing.*;
import java.awt.event.*;
public class MenuListenerExample extends JMenuBar
{
JMenu fileMenu, editMenu, helpMenu;
JMenuItem cut, copy, paste, selectAll;
JTextArea textArea;
public MenuListenerExample() {
cut = new JMenuItem("cut");
copy = new JMenuItem("copy");
paste = new JMenuItem("paste");
selectAll = new JMenuItem("selectAll");
textArea = new JTextArea();
cut.addActionListener(new MenuAction());
copy.addActionListener(new MenuAction());
paste.addActionListener(new MenuAction());
selectAll.addActionListener(new
MenuAction());
fileMenu = new JMenu("File");
editMenu = new JMenu("Edit");
helpMenu = new JMenu("Help");
editMenu.add(cut);
editMenu.add(copy);
editMenu.add(paste);
editMenu.add(selectAll);
add(fileMenu);
add(editMenu);
add(helpMenu);
textArea.setBounds(30, 30, 430, 400);
}
private class MenuAction implements ActionListener
{
public void actionPerformed(ActionEvent e) {
if (e.getSource() == cut) {
textArea.cut();
}
if (e.getSource() == paste) {
textArea.paste();
}
if (e.getSource() == copy) {
textArea.copy();
}
if (e.getSource() == selectAll) {
textArea.selectAll();
}
}
}
}
modify the above Java program to include the following: - When the
user clicks on the help menu, a drop-down list will appear with an
item called About, then when the user clicks on it, the window will
show some instructions about the functionality of the menu, e.g,
what the edit menu does, etc. - When the user clicks on the File
menu, a drop-down list will appear with one item called Show
Picture, and when the user clicks on it, a picture of your choice
will appear.
In: Computer Science
Question 4
A. Suppose the following letter grade class has been defined globally in a program.
#include <iostream>
using namespace std;
class Grade {
private:
char grade;
public:
Grade(char in_grade);
void print( );
};
Grade::Grade ( char in_grade) {
grade = in_grade;
}
void Grade::print ( ) {
cout << grade;
}
Write a main function that reads one character from the keyboard, create a Grade object containing that character, and then have the object print itself.
Furthermore, create an output file (named “output.txt”), and save the character to this output file. Last, close this output file.
int main ( )
{
int a = 3, b= 2, c= 1, d, e, f, g;
d = a&b; e = a | c; f = a >> 1, g = a << 1;
cout << “d= “ << d << “ e = “ << e << “ f = “ << f << “g = “ << g << endl;
}
In: Computer Science
Consider the following variation of merge sort: split the list into thirds, sort each third, and then merge all three sorted lists.
(a) Write pseudo-code for this sorting algorithm in python.
(b) Write a recurrence relation for the run-time of this algorithm, and use the master theorem to find the “big O” run time of the algorithm.
(c) How does the run time compare to the usual merge sort? Is this an improvement?
In: Computer Science