2. Combine multiple files
Use Python programming to combine two text files: customer-status.txt and sales.txt
Data columns in customer-status.txt (separated by comma):
Account Number, Name, Status 527099,Sanford and Sons,bronze
Data columns in sales.txt (separated by comma):
Account Number, Name, SKU, Quantity, Unit Price, Ext Price, Date
163416,Purdy-Kunde,S1-30248,19,65.03,1235.57,2014-03-01 16:07:40 527099,Sanford and Sons,S2-82423,3,76.21,228.63,2014-03-01 17:18:01
After you combine, you will see the following:
527099,Sanford and Sons,S2-82423,3,76.21,228.63,2014-03-01 17:18:01,bronze
In: Computer Science
Using C++
Create a polymorphic banking program using the Bank-Account hierarchy created in Exercise 2 of Written Assignment 4. For each account in the vector, allow the user to specify an amount of money to withdraw from the Bank-Account using member function debit and an amount of money to deposit into the Bank-Account using member function credit. As you process each Bank-Account, determine its type. If a Bank-Account is a Savings, calculate the amount of interest owed to the Bank-Account using member function calculateInterest, then add the interest to the account balance using member function credit. After processing an account, print the updated account balance obtained by invoking base-class member function getBalance. [MO 5.1, MO 5.2]
In: Computer Science
In: Computer Science
Write your answer in ESSAY format (approximately 300 words)
Which of the following CPUs are compatible with the Z390 AORUS MASTER Motherboard ?
AMD RYZEN 9 3900x
Intel Core i7-7700
Intel Core i7-9700k
Intel Core i9 9820x
Explain the criteria you checked to make your choice. Make sure to explain why the other CPUs were NOT compatible.
Hint: check socket type, chipset, generation, manufacturer, motherboard specifications
Describe the features of the compatible CPU including speed, cache, supported chipset and any other important features.
The explanation should be written in a way that even a layman can understand the importance of these features.
In: Computer Science
In: Computer Science
Provide a 250-400 word description of the issues DirectAccess addresses related to the use of VPNs within an organization.
In: Computer Science
Problem 1: Describe using pseudocode and implement an efficient algorithm for finding the ten largest elements in an array of size n. What is the running time of your algorithm?
Problem 2: An array A contains n-1 unique integersin the range [0, n-1]. There is one number from this range that is not in A. Design a O(n) algorithm for finding that number. Describe the algorithm in pseudocode. Implement the algorithm in Java. Hint : Consider computing a function of the integers in A that will immediately identify which one is missing.
Problem 3: Perform an experimental analysis of the two algorithms given below. Subsequently provide the growth functions and a BigOh analysis of the 2 algorithms.
public static double[] prefixAverage1(double[] x) {
int n = x.length;
double [] a = new double[n];
for (int j =0; j < n; j++)
{
double total =0;
for (int i =0; i <=j ; i++)
total += x[i];
a[j] = total / (j + 1);
}
return a;
}
public static double[] prefixAverage2(double[] x)
{
int n = x.length;
double [] a = new double[n];
double total = 0;
for (int j =0; j < n; j++)
{
total += x[i];
a[j] = total / (j + 1);
}
return a;
}
In: Computer Science
Using a python program find the numerical derivative at the indicated point, using the backward, forward, and centered formula. Use ℎ=0.05h=0.05, then each case compute the error. Which one is more accurate?
Using a python program find the Monte Carlo integration, compute the value of π.
In: Computer Science
Having a problem with syntax error in Java:
JAVA (Perfect Numbers) An integer number is said to be a perfect number if its factors, including 1 (but not the number itself), sum to the number. For example, 6 is a perfect number, because 6 = 1 + 2 + 3. Write a method isPerfect that determines whether parameter number is a perfect number. Use this method in an application that displays all the perfect numbers between 1 and and integer entered by the user. Display the factors of each perfect number to confirm that the number is indeed perfect. Challenge the computing power of your computer by testing numbers much larger than 1000. Display the results.
import java.util.Scanner;
public class IsPerfect {
static boolean isPerfect(int n)
{ int Sum = 0;
for (int i=1; i<n ; i++) {
if(n% i == 0) {
Sum = Sum +
i;
}
}
if (Sum == n) {
return true;
}
else {
return false;
}
}
public static void main(String[] args) {
int user_input; // taking user input
try (Scanner input = new Scanner(System.in)){
System.out.println("Perfect numbers between 1 and "+
user_input + "are:");
for (int i=1; i<= user_input; i++){
if (isPerfect(i)){
System.out.println(i);
}
}
}
}
In: Computer Science
I need to deep clone these 4 classes, using the cloneable interface. This is my code so far. Is it correct or do I need to make any changes?
class Record implements Cloneable {
private String CNAME;
private ArrayList<Subject> eCores;
private Major eMajor;
private ArrayList<Subject> eElectives;
private int totalCredit;
private Status status;
private ArrayList<Student> students;
@Override
protected Record clone() throws CloneNotSupportedException {
Record record = (Record) super.clone();
record.eMajor = (Major) eMajor.clone();
eCores = new ArrayList<>();
for (Subject s : eCores) {
Subject s1 = (Subject) s.clone();
record.eCores.add(s1);
}
eElectives = new ArrayList<>();
for (Subject ss : eElectives) {
Subject ss1 = (Subject) ss.clone();
record.eElectives.add(ss1);
}
return record;
}
public class Subject implements Cloneable {
private String subjectName;
private String subjectCode;
private int subjectCreditPoint;
private ArrayList<Student> studentList;
@Override
protected Subject clone() throws CloneNotSupportedException {
return (Subject) super.clone();
}
abstract class Student implements Cloneable, Enrollment {
private String studentName;
private String studentDOB;
private String studentSex;//Student Gender
private int studentNumber;
private ArrayList<Record> record;
@Override
protected Student clone() throws CloneNotSupportedException {
Student student = (Student) super.clone();
record = new ArrayList<>();
for (Record r : record) {
Record r1 = (Record) r.clone();
student.record.add(r1);
}
return student;
}
class Major implements Cloneable {
private String mName;
private ArrayList<Subject> mCores;
@Override
protected Major clone() throws CloneNotSupportedException {
Major major = (Major) super.clone();
mCores = new ArrayList<>();
for (Subject s : mCores) {
Subject s1 = (Subject) s.clone();
major.mCores.add(s1);
}
return major;
}
In: Computer Science
2. Convert the following infix form expression into the postfix form expression by using a stack:
A+(B*(C-D)+E)/F-G*H
Show the stack after each push/pop.
In: Computer Science
JAVA
Implement a class Robot that simulates a robot wandering on an
infinite plane. The robot is located at a point with integer
coordinates and faces north, east, south, or west. Supply methods:
public void turnLeft() public void turnRight() public void move()
public Point getLocation() public String getDirection() The
turnLeft and turnRight methods change the direction but not the
location. The move method moves the robot by one unit in the
direction it is facing. The getDirection method returns a string
"N", "E", "S", or "W".
In: Computer Science
3. Assume that binary trees are defined as
public class BTNode<E>
{
private E data;
private BTNode<E> left, right;
}
We say that a binary tree t1 is a prefix of a binary tree t2 if t2 can be made identical to t1
by removing zero or more leaves of t2. Write a method
In: Computer Science
Write JavaScript statements to accomplish each of the following tasks:
a) Display the value of the seventh element of array f.
b) Initialize each of the five elements of one-dimensional array g to 8.
c) Total the elements of array c, which contains 100 numeric elements.
d) Copy 11-element array a into the first portion of array b, which contains 34 elements.
e) Determine and print the smallest and largest values contained in 99-element floating-
point array w.
PLEASE WRITE ALL HTML PROGRAM IN A SINGLE PROGRAM. ALL ANSWERS SHOULD BE SOLVED IN A SINGLE OUTPUT.
In: Computer Science
a) Write a trial run for the algorithm using the input 5,3,1,4
b) Use induction to prove that your algorithm returns the correct value
The recursive algorithm in pseudocode is as follows (The input: a1,a2, ..., an a sequence of numbers where n>=1, the output: m, the minimum value of the sequence)
minvalue (a1,a2,...,an)
If(n=1) return a1
m: = minvalue(a2,a3,...,an)
If (a1
return m
In: Computer Science