What is model learning in computer science?
What are its uses?
what is the “Black Box”?
In: Computer Science
INTERFACE (BinaryTreeInterface):
BinaryTreeInterface.java
This interface represents all the functionalities a generic binary
tree.
Operations
+ getRootData(): T - This method returns the data stored in the
root node of a tree. Note that you cannot return the data of an
empty tree.
+ getRootNode(): BinaryNode<T> - This method returns the
reference to the root node of a tree.
+ setRootNode(BinaryNode<T>):void - This method sets the root
node of a tree.
+ getHeight():int - This method returns the height of a tree.
+ getNumberOfNodes(): int - This method returns the number of nodes
in a tree.
+ isEmpty():boolean - This method returns true, if a tree is empty,
false otherwise.
+ clear():void – clears a tree.
CLASS (BinaryTree): BinaryTree.java
This generic class implements the BinaryTreeInterface. The class
has one attribute root, which represents the root node of a tree.
In addition, it has the following behaviors:
+BinaryTree(): constructor - initializes root to null.
+ BinaryTree(data): constructor - initializes the root node’s
data.
+ BinaryTree(data, leftTree, rightTree): constructor - initializes
the root node with the given values.
+ setTree(data, leftTree, rightTree): void- set the tree to the
root with data and the leftTree and rightTree subtrees. Make sure
that the new created tree has only one point of entry, which is the
root.
+inorderTraversal(): void – displays all the nodes in tree using
inorder traversal. It displays the content of the nodes separated
by a space in a single line. For example, if the nodes’ content are
1, 2, 3, and 4, the method displays “1 2 3 4”. We have to have a
non empty tree for traversals.
Please implement those interface and class today, thank you
In: Computer Science
1. Match the term with the definition
Malware
[ Choose ] any software specifically designed to damage a computer system without owner knowledge. Although it is often legal and used by big companies such as Verizon and Panasonic, it can be used by illegitimate companies promoting pornography or gambling. Software that's planted on a computer; redirects to impostor web page even though you type in the right URL. You can protect yourself against it by going to websites that contain https not http. is misleading software that is secretly installed on a computer through the web. Confidential information can be obtained by the installer such as passwords, keystrokes and email addresses. A systems that extract features from speech patterns in order to recognize someones voice which is then digitalized and stored.
Spyware
[ Choose ] any software specifically designed to damage a computer system without owner knowledge. Although it is often legal and used by big companies such as Verizon and Panasonic, it can be used by illegitimate companies promoting pornography or gambling. Software that's planted on a computer; redirects to impostor web page even though you type in the right URL. You can protect yourself against it by going to websites that contain https not http. is misleading software that is secretly installed on a computer through the web. Confidential information can be obtained by the installer such as passwords, keystrokes and email addresses. A systems that extract features from speech patterns in order to recognize someones voice which is then digitalized and stored.
Adware
[ Choose ] any software specifically designed to damage a computer system without owner knowledge. Although it is often legal and used by big companies such as Verizon and Panasonic, it can be used by illegitimate companies promoting pornography or gambling. Software that's planted on a computer; redirects to impostor web page even though you type in the right URL. You can protect yourself against it by going to websites that contain https not http. is misleading software that is secretly installed on a computer through the web. Confidential information can be obtained by the installer such as passwords, keystrokes and email addresses. A systems that extract features from speech patterns in order to recognize someones voice which is then digitalized and stored.
Pharm
[ Choose ] any software specifically designed to damage a computer system without owner knowledge. Although it is often legal and used by big companies such as Verizon and Panasonic, it can be used by illegitimate companies promoting pornography or gambling. Software that's planted on a computer; redirects to impostor web page even though you type in the right URL. You can protect yourself against it by going to websites that contain https not http. is misleading software that is secretly installed on a computer through the web. Confidential information can be obtained by the installer such as passwords, keystrokes and email addresses. A systems that extract features from speech patterns in order to recognize someones voice which is then digitalized and stored.
voice
[ Choose ] any software specifically designed to damage a computer system without owner knowledge. Although it is often legal and used by big companies such as Verizon and Panasonic, it can be used by illegitimate companies promoting pornography or gambling. Software that's planted on a computer; redirects to impostor web page even though you type in the right URL. You can protect yourself against it by going to websites that contain https not http. is misleading software that is secretly installed on a computer through the web. Confidential information can be obtained by the installer such as passwords, keystrokes and email addresses. A systems that extract features from speech patterns in order to recognize someones voice which is then digitalized and stored.
2.What prevention technique did the American Library Association suggest for youth using the Internet?
3. What is Biometrics and where was it said to have started?
4. Why do we have passwords and what ancient civilization was reported to use it?
5. Why do computer systems have firewalls?
6. According to your readings, what are a Trojan horse, a virus, and a worm? Highlight their differences.
7. Authentication is used to determine that you are who you are. Authorization refers to resources to which you have access. They are two very different security items.
One of the rising stars of authentication is Biometrics. Discuss two forms of biometric authentication and explain how they can add to the security of a person's identity.
8. Briefly explain the difference in a boot sector virus, a macro virus, and a logic bomb.
9. What did Lamarr, a film star from the late 1930s to the 1950s, assist in inventing and how many frequencies did it range?
10. In your words, what is cyberterrorism? Make sure the answer is your own.
In: Computer Science
In python please :)
How to get the n th smallest even value of given array? (Use for loop for this problem. Do not use existing codes. Use your own codes). For example, in given list [11,23,58,31,56,22,43,12,65,19], if n is defined as 3. The program will print 56. (By using for loop and obtain the set of evens. By using another for loop, from the set of evens remove (n-1) observations and break the loop and find the minimum observation of the updated list). You can use the remove function to remove the observations from a list. remove function can be used as in the below example: A=[12, 41 ,5, 16,32,54 ] # List a is given # If you want to remove number 16 from the list A , You can use below code A.remove(15) # Now A=[12, 41, 5, 32, 54] # if you also want to remove 5 from the list A A.remove(5) # Now A=[12, 41, 32, 54]
In: Computer Science
The purpose of this assignment is to have you become familiar with polymorphism and be able to design classes with inheritance
The purpose of this assignment is to have you become familiar with polymorphism and be able to design classes with inheritance. Task The School Library has many items available for its students; some can be checked out and others cannot. Among those that can be checked out are journal (i.e., a literary journal) and digital video disk (i.e., a DVD). These two types have many attributes in common such as title, publisher, and dewey decimal classification. Design a class to represent the library item that would capture the common features among journals and DVDs. Then, design journal and digital video classes that are derived from the library item base class.
The library item class does not need more attributes (you can use the ones provided if you like), but you should add at least 2 methods to the class. The journal and digital video classes should have at least 3 attributes and at least 2 methods.
I need a java code for this.
In: Computer Science
Need it in C# using visual studio (also can you show me how to implement the code in vs)
Create a New Project named Preferred Customer to be used in a retail store for preferred customers, where customers can earn discount on all purchases depending upon how much money they are going to spend. To begin with designing your Application, you must add a class named Person with properties for holding a Person’s Name, Address and Telephone Number. Next step is to create a class named Customer, which is derived from the Person class. The Customer class must have a property for Customer Number and a Boolean property indicating whether customer wished to be on a mailing list. Further, design a class named PreferredCustomer, which is derived from the Customer class. The PreferredCustomer Class must have properties for an amount of the customer’s purchases and the customer’s % discount earned. The GUI of Application (Form1 object) must have four input Text Boxes: (1) one for customer’s Full Name, (2) the second for customer’s Full Address, (3) the third one for customer’s Phone Number and (4) the fourth one for customer’s Purchased Amount as shown in Fig. 1. BorderStyle property of the Purchased Amount text box control is to be set at Fixed3D. In addition to these four Text Boxes, your Application must have one Radio button and one Display button controls: (1) Radio button is used to add customer’s name in mailing list or not, and (2) Display button, when clicked demonstrates the class in this Application. When you click Display button without entering any real data in tis GUI, the Application must show a message in a Message Box that “Input string was not in a correct format”, which is shown in Figure 2 on page # 2. Then you click OK button to enter real data input in Application’s GUI. Your Application must have provision of Close and Clear buttons in its interface so that it could be possible to close it and clear all controls in its GUI. It is required that your GUI should be displayed at the Center of your computer’s monitor and your source code must have Comment Lines at appropriate places. Take a screen-shot of your GUI for each run, copy and paste it in a MS Word doc file.
In: Computer Science
For each of the following Perl regular expressions, give a complete and precise description of the function of the regular expression, plus a related example string:
(a) /"([^"]*)"/
(b) /[-+]?\d+(\.\d*)?F\b/
(c) /(\D{2,}).*\[\1\]/
(d) /((.*?)\d)\s\2/
(e) /^[0-9]+\/\d+([+\-*\/]\=|([+]{2}|[-]{2}));$/
In: Computer Science
Write a program that prompts the user to enter the number of
students and each student’s name and score, and finally displays
the student with the highest score and the student with the
second-highest score. Use the next() method in the Scanner class to
read a name rather using the nextLine() method.
This is my code , but i get this error Enter the number of
students: Exception in thread "main"
java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:871)
at java.util.Scanner.next(Scanner.java:1494)
at java.util.Scanner.nextInt(Scanner.java:2139)
at java.util.Scanner.nextInt(Scanner.java:2095)
at Exercise05_09.main(Exercise05_09.java:16)
import java.util.Scanner;
public class Exercise05_09 {
public static void main(String[] args) {
// Create a Scanner
Scanner input = new
Scanner(System.in);
// Prompt the user to enter the
number of students
System.out.print("Enter the number
of students: ");
int numberOfStudents =
input.nextInt();
int score,
// Holds students' score
highest = 0,
// Highest
score
secondHigest =
0; // Second highest score
String name = "",
// Holds students' name
student1 = "", // Highest scoring
student name
student2 = ""; // Second highest
scoring student name
// Prompt the user to enter each
students' name and score
System.out.println("Enter each
students' name and score:");
for (int i = 0; i <
numberOfStudents; i++) {
System.out.print(
"Student: " + (i + 1) + "\n Name: ");
name =
input.next();
System.out.print(" Score: ");
score =
input.nextInt();
if (i == 0)
{
// Make the first student the highest scoring
student so far
highest = score;
student1 = name;
}
else if (i == 1
&& score > highest) {
// Second student entered scored
// higher than first student
secondHigest = highest;
highest = score;
student2 = student1;
student1 = name;
}
else if (i == 1)
{
// Second student entered scored
// lower than first student
secondHigest = score;
student2 = name;
}
else if (i >
1 && score > highest && score > secondHigest)
{
// Last student entered has the highest
score
secondHigest = highest;
student2 = student1;
highest = score;
student1 = name;
}
else if (i >
1 && score > secondHigest) {
// Last student entered has the second highest
score
student2 = name;
secondHigest = score;
}
}
// Display the student with the
hightest score
// and the student with the
second-hightest score.
System.out.println(
"Higest scoring
student: " + student1 +
"\nSecond Higest
scoring student: " + student2);
}
}
In: Computer Science
Define a Python function which finds the all of the odd numbers and the product of the odd numbers. (Use for loop and if conditions for this problem. Do not use existing codes. Use your own codes).(You need to use append function to obtain a list of odd numbers)
In: Computer Science
]write two main programs: one will add exception handling to a geometric object, and the other will create a Template function to find the max of three “entities” (either ints, floats, doubles, chars, and strings)
A trapezoid is a quadrilateral in which two opposite sides are parallel. (note: all squares, rectangles, and parallelograms are trapezoids)
Note 1: the length of Base 1 is always greater than or equal to Base 2
Note 2: To form a valid trapezoid, if must satisfy the side/length rule, namely, the sum of the lengths of Leg1,Leg2 , and Base 2 must be greater than the length of Base 1
Note 3:If a default trapezoid is created, set all the sides equal to 1 (i.e., a square, or rhombus)
The following is the UMs for a trapezoid:
|
Trapezoid |
|
-base1 : double -base2: double -leg1: double -leg2: double |
|
+Trapezoid() +Trapezoid (base1, base2, leg1, leg2) // setters and getters +print(void): void +toString(void) : string |
For the driver program:
Note 1: If the user creates a trapezoid that violates the side/length rule (including 0 or negative side lengths), throw an exception
Note 2: If the user sets one of the sides that violates the side/length rule, do not change the side, and throw an exception
A main drvier (main8a.cpp) :
#include <iostream>
#include "trapezoid.h"
using namespace std;
int main()
{
cout << "Welcome to Lecture 16: Exceptions and Templates" << endl;
cout << "The Trapezoid Program!\n";
cout << "\nTry creating t1 (no parameters, which is valid):\n";
try
{
Trapezoid t1; // this is valid, by design
t1.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
cout << "\nTry creating t2(15,3,3,3) (which is invalid):\n";
try
{
Trapezoid t2(15,3,3,3); // this is invalid
t2.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
cout << "\nTry creating t3(5,3,4,4) (which is valid):\n";
try
{
Trapezoid t3(5,3,4,4); // this is valid
t3.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
cout << "\nTry changing base1 of default t4 to 10 (which is invalid):\n";
try
{
Trapezoid t4;
t4.setBase1(10); // this is invalid
t4.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
cout << "\nTry changing leg2 of t5(55,30,15,12) to 6 (which is invalid):\n";
try
{
Trapezoid t5(55,30,15,12);
t5.setLeg2(6); // this is invalid
t5.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
cout << "\nTry changing leg1 of default t6 to .5 (which is valid):\n";
try
{
Trapezoid t6;
t6.setLeg1(.5); // this is valid
t6.print();
}
catch(string errorMsg)
{
cout << errorMsg << endl;
}
return EXIT_SUCCESS;
}In: Computer Science
Using C language:
void show_array (int data[ ], int n);
void InsertionSort (int data[ ], int n);
void SelectionSort (int data[ ], int n);
where data[] is the array and n is the size of the array.
If you implement both sort routines you will need to make a copy of the original unsorted array before using the first sort, or else the second sort will be working on a sorted version of the array.
In: Computer Science
Select a Database of your own choice and apply the
first three normalization processes. (1NF, 2NF & 3NF)
• The minimum number of records in the table must be 10
• Make sure you carry the same table from 1NF to 2NF and 3NF, do
not use separate tables from scratch for all the three forms.
• Brief explanation of the normalization processes must be
specified
In: Computer Science
ETHICS IN IT
The general moral imperatives involving individuals is to:
a. Contribute to society and human well-being.
b. Avoid harm to others.
c. Be honest and trustworthy.
d. Be fair and take action not to discriminate.
e. Honour property rights including copyrights and patent.
You are required to discuss the above general moral imperatives in
relation to
Information and Communication Technology (ICT).
In: Computer Science
Consider the following relation and convert to the normal form indicated. Make sure your Primary Key and its attribute(s) is/are underlined for full credit. Also indicate foreign keys using (FK) if any.
0NF:
ORDER[order_num, date, SSN, cust_name, phone, email, (SKU, item_name, price)]
Notes:An order has only one customer, but a customer can place many orders. Each order can have multiple items.
1NF:
2NF:
3NF:
In: Computer Science
In c++ please. Write a program that opens a specified text tile then displays a list of all the unique words found in the file. Hint: Store each word as an element of a set.
In: Computer Science