Questions
unix Delete the second character from every line in a file Delete the last word from...

unix

  1. Delete the second character from every line in a file
  2. Delete the last word from every line in a file.
  3. Swap the first and second letter of every line in a file.
  4. Swap the first and last characters of every line in a file.
  5. For each line that begins with a single space, replace the space with a tab. Lines that begin with 2 or more spaces should not be effected.
  6. Finds dates in the form mm/dd/yy and replaces them with the form mm/dd/20yy. In other words puts 20 in front of a 2 digit year. 4 digit years should not be changed.
  7. Move lines 3 through 5 after line 8 (so the output lines would be in order 1,2,6,7,8,3,4,5,9,10,....)
  8. Given a line with a UNIX path specified, print the base file name only. So for example, "/home/users/james" would print "james"
  9. Given a line with a UNIX path specified, print the directory part only. So for example, "/home/users/james" would print "home/users"

In: Computer Science

1. List the steps of data mining processes and the corresponding major methods. 2. What are...

1. List the steps of data mining processes and the corresponding major methods.

2. What are the common accuracy metrics for data-mining algorithms?

3. Search the available literature for additional metrics that measure algorithms for accuracy, suitability for a particular purpose, etc.

In: Computer Science

Write a program(Python) using functions and mainline logic which prompts the user to enter a number....

Write a program(Python) using functions and mainline logic which prompts the user to enter a number. The number must be at least 5 and at most 20. (In other words, between 5 and 20, inclusive.) The program then generates that number of random integers and stores them in a list. The random integers should range from 0 to 100. It should then display the following data to back to the user with appropriate labels:

The list of integers

The lowest number in the list

The highest number in the list

The total sum of all the numbers in the list

The average number in the list

Use try/except to make sure the user enters an integer.

[Make it simple so that i can understand]

In: Computer Science

Adding on to 5-8b with the rectangle - cube inheritance, we add on another subclass of...

Adding on to 5-8b with the rectangle - cube inheritance, we add on another subclass of rectangle for a colored rectangle that adds a new field for the color, the constructors should either set an argument to the color or initialize the color to a default blue, and the print should call the rectangle print and then add on a statement to print the color. The new version of the super class and two sub classes are attached. Create a main that declares an array of three rectangle pointers. Each element should be a different kind of object that “is a” rectangle (rectangle, cube, colored rectangle), then separately run the three different constructors (you can send it any values that match up with the argument constructors) and assign to each element of the array (ex. spot 0 rectangle, spot 1 cube, spot 2 colored rectangle). Then in a for loop, print the address of each object that "is a" rectangle (the address in the pointer) and then use dynamic binding to call the print function to print each of the objects in the array.

/rectangle5-12.h

#ifndef rectangle512_h
#define rectangle512_h
#include<iostream>
using namespace std;

class rectangle512
{
protected:
float length;
float width;
float area;
float perimeter;

public:
rectangle512()
{
length = 1;
width = 1;
area = 1;
perimeter = 4;
}

rectangle512(float l, float w)
{
length = l;
width = w;
area = length * width;
perimeter = 2 * (length + width);
}

void virtual print()
{
cout << "Length is " << length << endl;
cout << "Width is " << width << endl;
cout << "Area is " << area << endl;
cout << "Perimeter is " << perimeter << endl;
}
};

#endif

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//colorrectangle5-12.h

#include"rectangle5-12.h"
#include<iostream>
#include<cstring>
using namespace std;

class colorrectangle512 : public rectangle512
{
private:
char color[20];

public:
colorrectangle512() : rectangle512()
{
strcpy(color, "blue");
}

colorrectangle512(float l, float w, char c[]) : rectangle512(l, w)
{
strcpy(color, c);
}

void print()
{
rectangle512::print();
cout << "Color is " << color << endl;
}
};

---------------------------------------------------------------------------------------------------------------------------------------

//cube5-12.h

#include"rectangle5-12.h"
#include<iostream>
using namespace std;

class cube512 : public rectangle512
{
private:
float depth;

public:
cube512() : rectangle512()
{
depth = 1;
area = 2 * length * width + 2 * length * depth +
2 * width * depth;
perimeter = 2 * (length + width) + 2 * (length + depth) +
2 * (width + depth);
}

cube512(float l, float w, float d) : rectangle512(l, w)
{
depth = d;
area = 2 * length * width + 2 * length * depth +
2 * width * depth;
perimeter = 2 * (length + width) + 2 * (length + depth) +
2 * (width + depth);
}

void print()
{
rectangle512::print();
cout << "Depth is " << depth << endl;
}
};

In: Computer Science

Draw Entity Relation Diagram (ER-Diagram) for this scenario: A faculty has many departments. A department belong...

  1. Draw Entity Relation Diagram (ER-Diagram) for this scenario:

A faculty has many departments. A department belong to one faculty.

Faculty has Faculty ID, Faculty name, Faculty Address

Department has Department ID, Department name

  1. Draw Entity Relation Diagram (ER-Diagram) for this scenario:

Department can have many teachers. Teacher only belongs to one department,

Teacher has teacherID, teacher_name, teacher_address and phone_number

  1. Draw Entity Relation Diagram (ER-Diagram) for this scenario:

Teacher can teach many students. Student can be taught by many teachers.

Student has student_id and student_name

  1. Draw Entity Relation Diagram (ER-Diagram) for this scenario:

Student can register many courses. Courses can be registered by many students

Course has courseID, course_name

  1. Draw Entity Relation Diagram (ER-Diagram) for this scenario:

Department can have many courses. Course belong to one department

  1. Combine all the ER-Diagram from 1 – 5 to be a Complete ER-Diagram for BANK DHOFAR’s website/system with the relationship between Entities.
  2. Draw a line for Primary Key for each Entity in ER-D (Question 6)For Question 6-7

In: Computer Science

/** * This class maintains an arbitrary length list of integers. * * In this version:...

/**
* This class maintains an arbitrary length list of integers.
*
* In this version:
* 1. The size of the list is fixed after the object is created.
* 2. The code assumes there is at least one element in the list.
*
* This class introduces the use of loops.
*
* @author Raymond Lister
* @version September 2015
*
*/
public class ListOfNVersion02PartA
{   
public int[] list; // Note: no "= {0, 1, 2, 3}" now

/**
* This constructor initializes the list to the same values
* as in the parameter.
*
* @param element the initial elements for the list
*/
public ListOfNVersion02PartA(int [] element)
{
// make "list" be an array the same size as "element"
list = new int[element.length];


// add whatever code is required to complete the constructor


} // constructor ListOfNVersion01Skeleton(int [] element)

/**
* @return the number of elements stored in this list
*/
public int getListSize()
{
return 999; // replace "999" with the correct answer

/* See Nielsen page 85-86,
* section 4.2.3 Retrieving the size of arrays: length
*
* See Parsons page 45,
* section 3.3.4 The Array “length” Field and also page 47
*/
} // method getListSize

/**
* @return the last element in the list
*/
public int getLast()
{
return 999; // replace "999" with the correct answer

/* See Nielsen page 85-86,
* section 4.2.3 Retrieving the size of arrays: length
*
* See Parsons page 45,
* section 3.3.4 The Array “length” Field and also page 47
*/

} // method getLast

/**
* prints the contents of the list, in order from first to last
*/
public void printList()
{
System.out.print("{");

// add and/or modify code to complete the method

System.out.print("}");

} // method printList

/**
* This method is NOT examinable in this test.
*
* prints the contents of the list, in order from first to last, and
* then moves the cursor to the next line
*/
public void printlnList()
{
printList();
System.out.println();

} // method printlnList

/**
* @return the number of times the element occurs in the list
*
* @param element the element to be counted
*/
public int countElement(int element)
{
// add and/or modify code to complete the method

return 999;

} // method countElement

/**
* @return the number of times the replacement was made
*
* @param replaceThis the element to be replaced
* @param withThis the replacement
*/
public int replaceAll(int replaceThis, int withThis)
{
// add and/or modify code to complete the method

return 999;

} // method replaceAll

/**
* @return the first position in list occupied by the parameter value, or -1 if it is not found
*
* @param findThis the value to be found
*/
public int findUnSorted(int findThis)
{
// This algorithm is known as "linear search"

return 999;


// add and/or modify code to complete the method


} // method findUnSorted

/**
* @return the position of the smallest element in the array, between positions "first" and "last"
*/
public int minPos()
{

return 999;


// add and/or modify code to complete the method


} // method minPos
  
/**
* Inserts an element in the last position. The elements already in the
* list are pushed down one place, and the element that was previously
* first is lost from the list.
*
* @param newElement the element to be inserted
*/
public void insertLast(int newElement)
{   

// add and/or modify code to complete the method


} // method insertLast

} // class ListOfNVersion02PartA

In: Computer Science

a) Find a bug in the code snippet below. Assume that a, b, c and d...

a) Find a bug in the code snippet below. Assume that a, b, c and d are correctly declared and initialized integer variables.

a = b+c
if (a=d) then
  print *,”A equals to D”
else
  print *,”A does not equal D”
end if

b) Find a bug in the code snippet below. Assume that a,b,and c are correctly declared and initialized integer variables.

if (a+b) > c) then
  print *,”Sum of A+B is greater than C”

end if

In: Computer Science

Write a series of codes using WHILE loops C++ 1. Ask the user for a number...

Write a series of codes using WHILE loops C++

1. Ask the user for a number and adds even numbers for 1 to the user entered number.

2. Write another piece of code that asks the user for 2 numbers and adds up the numbers between and including the numbers.

3. Write another piece of code that asks user for a file name and then add up all the numbers for the file.

In: Computer Science

Analysis of Algorithims Bubble sort for 12, 2, 3, 21, 11, 10,8 Binary search for K=12...

Analysis of Algorithims

Bubble sort for 12, 2, 3, 21, 11, 10,8

Binary search for K=12 in the array A={2, 3, 5, 7,11,15, 16,18,19}

selection sort for 12, 2, 3, 21, 11, 10,8

In: Computer Science

*Need 200 words for all 6 questions in total with some websites for resources* Discuss and...

*Need 200 words for all 6 questions in total with some websites for resources*

  1. Discuss and describe the CIA Triad.
  2. What are the requirements to hold a person accountable for the actions of their user account?
  3. Describe the benefits of change control management.
  4. What are the seven major steps or phases in the implementation of a classification scheme?
  5. Name the six primary security roles as defined by ISC2 for CISSP.
  6. What are the four components of a complete organizational security policy and their basic purpose?

In: Computer Science

Write this code in Python only. Draw a 12" ruler on the screen. A ruler is...

Write this code in Python only.

Draw a 12" ruler on the screen. A ruler is basically a rectangular outline with tick marks extending from the top edge. The tick marks should be drawn at each quarter-inch mark. Below the tick marks, your ruler should show large integers at each full-inch position.

In: Computer Science

Explain "In a virtual network, service is described in a data structure, and exists entirely in...

Explain "In a virtual network, service is described in a data structure, and exists entirely in a software abstraction layer,  reproducing the service on any physical resource running the virtualization software.

The configuration attributes of the service can be found in  software with API interfaces, thereby unlocking the full  potential of networking devices."

In: Computer Science

Write a program compare.cpp that asks the user to input two dates (the beginning and the...

Write a program compare.cpp that asks the user to input two dates (the beginning and the end of the interval). The program should check each day in the interval and report which basin had higher elevation on that day by printing “East” or “West”, or print “Equal” if both basins are at the same level.

Example:

$ ./compare
Enter starting date: 09/13/2018
Enter ending date: 09/17/2018

09/13/2018 West
09/14/2018 West
09/15/2018 West
09/16/2018 West
09/17/2018 West

Explanation:

Date East (ft) West (ft)
09/13/2018 581.94 582.66 West is higher
09/14/2018 581.8 582.32 West is higher
09/15/2018 581.62 581.94 West is higher
09/16/2018 581.42 581.55 West is higher
09/17/2018 581.16 581.2 West is higher

In: Computer Science

First, Calculate the 1/3 in binary form using 8-digits. Then convert binary form back to decimal....

First, Calculate the 1/3 in binary form using 8-digits. Then convert binary form back to decimal. Why and what is the error in binary representation ?

In: Computer Science

The coding must be formatted in Python. Write a function matrix_power(A, n) that computes the power...

The coding must be formatted in Python.

Write a function matrix_power(A, n) that computes the power An using Boolean arithmetic and returns the result. You may assume that A is a 2D list containing only 0s and 1s, A is square (same number of rows and columns), and n is an integer ≥ 1. You should call your previously written matrix multiply boolean function. Example: Let R = [ [0, 0, 0, 1], [0, 1, 1, 0], [0, 0, 0, 1], [0, 0, 1, 0] ] Then calling matrix power(R, 2) should return [ [0, 0, 1, 0], [0, 1, 1, 1], [0, 0, 1, 0], [0, 0, 0, 1] ]

In: Computer Science