(These will be graded both on the quality of your argument and your demonstration of understanding of what Expert systems are and what the Turing test is.)
Credit will only be given for typed answers.
In: Computer Science
Create a Python program that includes each feature specified below.
In: Computer Science
The Lab 1 development assignment was largely an exercise in completing an already started implementation. The Lab 2 development assignment will call on you to implement a program from scratch. It’s an exercise in learning more about Java basics, core Java Classes and Class/ method-level modularity.
Implement a ‘runnable’ Class called “NumericAnalyzer”. Here’s the functional behavior that must be implemented.
NOTE: Don’t prompt the user for input – this is an exercise passing values to your program via the command line!
Development guidelines:
NOTE: Deriving calculations and displaying output to a Console are separate threads of responsibility, and should therefore be implemented independently of each other.
So your main() method will include a sequence of instructions similar to this:
// main() method code fragment example // Display some error message … (System.err. ) System.exit(1); } NumericAnalyzer analyzer = new NumericAnalyzer(args); analyzer.calculate(); analyzer.display(); System.exit(0); |
Your ‘test cases’ should include testing for (see sample output below –PASTE YOUR Console OUTPUT ON PAGE 5 below):
SAMPLE OUTPUT FOR TEST CASES 1, 2, & 3
|
(2) 256 Count: 1 Min: 256 Max: 256 Range: 0 Sum: 256 Mean: 256 Median: 256 Variance: 0 Standard Deviation: 0 |
(3) 2 4 8 16 32 64 128 256 512 Count: 9 Min: 2 Max: 512 Range: 510 Sum: 1,022 Mean: 113 Median: 32 Variance: 25,941 Standard Deviation: 161 |
PASTE YOUR OUTPUT HERE
0 args |
1 arg |
multiple args (at least 6) |
Sample output
2 4 8 16 32 64 128 256 512
Size: 9
Min: 2
Max: 512
Range: 510
Sum: 1,022
Mean: 113
Median: 32
Variance: 25,941
Standard Deviation: 161
-----------------------------------------------------------------
Lab 1 java code (if needed)
public class JulianCalendar { static private final int MAX_DAY = 31; static private final String[] MONTH_NAMES = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static private final int[] MONTH_SIZES = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static private void displayDayHeading() { System.out.printf("%6s", "Day"); } static private void displayHeading() { displayDayHeading(); for (int i = 0; i < MONTH_NAMES.length; ++i) { System.out.printf("%5s", MONTH_NAMES[i]); } displayDayHeading(); } static public void display() { displayHeading(); for (int i = 0; i < MAX_DAY; i++) { System.out.printf("\n%6d", i + 1); for (int j = 0; j < MONTH_NAMES.length; j++) { int sum = 0; for (int k = 0; k < j; k++) { sum += MONTH_SIZES[k]; } if (sum + MONTH_SIZES[j] >= sum + i + 1) System.out.printf(" %03d", sum + i + 1); else System.out.printf(" %03d", 0); } System.out.printf("%6d", i + 1); } System.out.println(); } public static void main(String[] args) { display(); } }
In: Computer Science
Write a factorial C++ program where n=10,000,000
In: Computer Science
DONE IN POWERSHELL
create a function that allows the user to perform the
following tasks
a.
Create a folder named NetworkInformation
Create a file in the above folder named
NetworkInformation.txt. Pipe the Get-NetTCPConnection, Get-NetNeighbor, and Get-NetUDPEndPoint cmdlets output into the file
In: Computer Science
JAVA: Suppose we have a number of triangles and quadrilaterals in a 2-dimensional coordinate plane. we want to be able to easily determine the perimeter of each shape and move shapes around the coordinate plane. Download the Shape.java and Point.java from Moodle. - Shape.java is an interface contains getPerimeter() and move() abstract methods. - Point.java is a class object which provides getX(), getY(), distanceTo(Point p) and move() methods. Design two classes named Quadrilateral and Triangle that implement Shape interface to determine their perimeter of each shape and move shapes around the coordinate plane. Test your classes in a Driver class that use (1.0, 1.0), (1.0, 2.0), (2.0, 1.0) and (2.0, 2.0) as coordinates for Quadrilateral vertices and (1.0, 1.0), (1.0, 2.0), (2.0, 1.0) as coordinate for Triangle. Use methods from Point Object to calculate their perimeters and display their results. Use move method from Point Object to increment x coordinate by 1.0 and y coordinate by 2.0 for all vertices of both shapes. Calculate their perimeters and display their results.
SHAPE
import java.util.*;
public interface Shape {
public double getPerimeter();
public void move(double deltaX, double deltaY);
}
POINT
import java.util.*;
public class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public double distanceTo(Point p) {
return Math.sqrt(Math.pow(this.getX() - p.getX(), 2) +
Math.pow(this.getY() - p.getY(), 2));
}
public void move(double deltaX, double deltaY) {
x += deltaX;
y += deltaY;
}
}
In: Computer Science
Why are the original/raw data not readily usable by analytics tasks? What are the main data preprocessing steps? List and explain their importance in analytics.
In: Computer Science
I wrote this code and it produces a typeError, so please can you fix it?
import random
def first_to_a_word():
print("###### First to a Word ######")
print("Instructions:")
print("You will take turns choosing letters one at a time until a
word is formed.")
print("After each letter is chosen you will have a chance to
confirm whether or not a word has been formed.")
print("When a word is formed, the player who played the last letter
wins!")
print("One of you has been chosen at random to initiate the
game.")
print()
print("Note: Words must be longer than a single letter!")
print()
#inputs / randomNumGen
player1 = input("Enter player 1's name: ")
player2 = input("Enter player 2's name: ")
random_number = random.randint(0, 1)
#output function
def output_func(player1, player2, random_number):
if random_number == 0:
word = input(player1, 'please enter a character: ')
print(player1, 'input:', word)
else:
word = input(player2, 'please enter a character: ')
print(player2, 'input:', word)
return word
#initial variables
word_confirm = ''
counter = 0
word_array = []
#character input loop
while word_confirm != 'yes':
#function call
word = output_func(player1, player2, random_number)
#append
word_array.append(word)
#alternate players turns
if random_number == 0:
random_number = 1
else:
random_number = 0
#check for exit after >=3 letters formed
if counter >= 2:
print('You have formed the letters:') #three letters
word_confirm = input('Has the word been formed? (type "yes" or
"no"): ')
word_confirm = word_confirm.lower()
counter += 1
complete_word = ''
i = 0
while i < len(word_array):
complete_word += word_array[i]
i += 1
if random_number == 1:
print(player1, 'Wins!')
print('The word was:', complete_word)
else:
print(player2, 'Wins!')
print('The word was:', complete_word)
first_to_a_word()
In: Computer Science
1. Each of the queries in this section contain mistakes that prevent them from running. Explain the mistake and rewrite the query so it works. a. SELECT Customers.custid, Customers.companyname, Orders.orderid, Orders.orderdate FROM Sales.Customers AS C INNER JOIN Sales.Orders AS O ON Customers.custid = Orders.custid b. SELECT C.custid, C.companyname, COUNT(*) as numOrders FROM Sales.Customers as C INNER JOIN Sales.Orders as O WHERE C.custid = O.custid c. SELECT E.empid, COALESCE(COUNT(C.orderid),0) as numOrders FROM HR.Employees as E OUTER JOIN Sales.Customers as C ON E.custid = C.custid;
In: Computer Science
Write a function named timesOfLetter that reads an array and returns the number of times of each lowercase letter and each uppercase letter appear in it, using reference parameter. • Write a function named timesOfNumber that reads an array and returns the number of times of each odd number, and each even number appear in it, using reference parameter. • Write a function named isChar() that determines if the input is alphabetic or not during inputting. • Write a function named isInt() that determines if the input is a digit or not during inputting. • Initialize the size of the arrays as 10.
Hints: • Firstly, determine whether the element is a letter or a number, which should not be any other characters. • By passing by reference, the values can be modified without returning them. • You may call a function inside another function.
In: Computer Science
There are two kinds of bank accounts: checking and savings. You can deposit to (i.e. add money in) or withdraw (i.e. take money out) from an account. A checking account can be withdrawn with an unlimited number of times. A savings account can only be withdrawn at most N times per calendar month. Checking accounts have no monthly fee. Savings accounts have a fixed monthly fee X. But if you deposit at least a money amount of M each month, that fee is waived. You cannot overdraft (take out more money than the current balance) a savings account. For a checking account, if you overdraft, you will have to pay an overdraft fee. 1. Design 3 classes: Account, CheckingAccount, and SavingsAccount 2. Determine the fields and methods of each class. 3. Implement the methods to deposit and withdraw. Please use java for the code.
In: Computer Science
In: Computer Science
1. Obtain the 1’s complement, 2’s complement and sign magnitude system representation in 7 bits for the following decimal numbers:
a) 1510
b) -2110
c) 3510
d) -2710
2. Use 1’s and 2’s complement system to perform the following
calculations and mention if
there will be overflow or not:
a) 1100 – 0101
b) 1010 + 0100
c) 01100 + 00111
In: Computer Science
1. For each of the following, write a single SELECT query against the TSQLV4 database that returns the result set described. Each of these queries involves two tables and can be written using a join operation.
a. One row for each order shipped to France or Germany, showing the order ID, the last name of the employee for the order, and the customer ID for the order.
b. One row for each employee who handled orders to Belgium, showing the employee’s initials (for example, for an employee named Yael Peled, this would be YP) and the number of orders that employee handled that were shipped to Belgium.
c. Same as part b., but include a row for every employee in the HR.Employees table, even if they did not handle any orders shipped to Belgium. (The number of orders for such an employee should be 0.)
In: Computer Science
Python 3 question
Suppose that a directed and weighted graph represented as vertex-list, how could it perform uniform cost search by using priority queue?
In: Computer Science