Python code
def plot_dataset(file_path):
"""
Read in a text file where the path and filename is given by the input parameter file_path
There are 4 columns in the text dataset that are separated by colons ":". c1:c2:c3:c4
Plot 3 datasets. (x axis vs y axis)
c1 vs c2 (Legend label "n=1")
c1 vs c3 (Legend label "n=1")
c1 vs c4 (Legend label "n=1")
Make sure you have proper x and y labels and a title. The x label should be "x", y should be "Fourier Sum"
And the title be Fourier Series. Remember, you should have your first.last.yy in parentheses in the title.
For full credit you must also include a legend with the dataset labels as shown above.
Upload the resulting plot (.png) to scholar for credit. No unit tests here.
:param file_path:
:return:
"""
I am kinda confused on this one. the only txt file i think i need to use is called fourier_series.txt but I may not need it at all.
In: Computer Science
Research list optimization techniques regarding reviews online. Describe how these tools work and state the pros and cons of how these can affect consumers and businesses.
In: Computer Science
Two Systems 80 Km apart are communicating through a direct Metallic cable (note: signal speed is 2 x 10^8 m/s). The data is in the form of 60 KB packets with transmission rate 1M bps. Calculate the following:
In: Computer Science
Use JAVA to Design a simple registration system that allows Student to register in a course.
Requirements
In: Computer Science
Write a program that takes an integer as input and returns whether it is a prime number or not in C++. (Using if, loops, or/and bool only)
In: Computer Science
Question no 3: USE PYTHON
a. Generate a discrete uniform distribution of population size 100 between interval (1,10).)
b Consider the sample size of N=10, Simulate the sampling distribution of the sample mean. (repeat 100 times)
c Consider the sample size of N=30, what is the sample mean and sample standard deviation? (repeat 100 times)
In: Computer Science
Please Use the ECLIPSE AND FOLLOW THESE RULES
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character
- classes start with an uppercase character
- packages use only lowercase characters
methods start with a lowercase character
question1:
Design a Lotto class with one array instance variable to hold three random integer values (from 1 to 9). Include a constructor that randomly populates the array for a lotto object. Also, include a method in the class to return the array.
Use this class to simulate a simple lotto game in which the user chooses a number between 3 and 27. The user runs the lotto up to 5 times and each time the sum of lotto numbers is calculated. If the number chosen by the user matches the sum, the user wins and the game ends. If the number does not match the sum within five rolls, the computer wins.
question2:
Write a Java class that implements a set of three overloaded static methods. The methods should have different set of parameters and perform similar functionalities. Call the methods within main method and display the results.
eclipse...
In: Computer Science
Provide pseudo-code to compute the difference of two sets, S - T, using:
a. sets represented by linked-lists of characters.
b. sets represented by bit strings. (hint - what is "exclusive or?")
In: Computer Science
Is there a way to limit the # of times an Excel file can be opened? The solution would also require that the Excel file could not be copied to another location to bypass the counter.
In: Computer Science
Explain how a read I/O operation happens in 2 scenarios: with DMA and without DMA. Clearly explain how the I/O device and the CPU works concurrently in both cases. Explain through an example showing the steps of the protocols and the algorithms underneath.
In: Computer Science
PLEASE Use the ECLIPSE...
AND FOLLOW THIS RULES..
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character
- classes start with an uppercase character
- packages use only lowercase characters
methods start with a lowercase character
Write a Java application that simulates a test. The test contains at least five questions about first three lectures of this course. Each question should be a multiple-choice question with 4 options.
Design a Test class. Use programmer-defined methods to implement your solution. For example:
For each question:
switch ( randomObject.nextInt( 4 ) )
{
case 0:
return( "Very good!" );
……
}
At the end of the test display the number of correct and incorrect answers, and the percentage of the correct answers.
Your main class will simply create a Test object and start the test by calling input answer method.
Thank you.
In: Computer Science
Algorithm. We divide each of the matrices A and B into 9 submatrices with size n/3 × n/3 each. The matrix C = A × B is obtained by using 25 multiplications and 30 additions of the submatrices. What is the recursive formula of the running time function T(n) of this algorithm? What is the running time of this algorithm (in Θ notation)?
In: Computer Science
System.out.println("Enter a temperature in Fahrenheit:
");
double fahrenheit = input.nextDouble();
double celsius = (5.0 / 9) * (fahrenheit - 32);
System.out.println("Fahrenheit " + fahrenheit + " is "
+ celsius + " in Celsius");
the above code i would like to print to 2 decimal places for celsius please
this is in JAVA
In: Computer Science
in Java, I need to create an array of animals. The user is going to be prompted to enter the size of the array where a valid size is 10-30(inclusive). Then I have to populate only half of this array. I am not sure how to do that so can you please write comments explaining.
Thank you
In: Computer Science
Identify all private and shared variables in the following code snippet. What is the output of the program (e.g. the value of res)?
// =========
int A[100];
int count;
void work(int index[])
{
float B[10];
……
}
void main(){
int res = 10;
#pragma omp parallel
{
int index[10], i=0, IS=0;
work(index);
#pragma omp for
for(i=0;i<100;i++)
{
IS = IS + i;
}
#pragma omp critical
res += IS;
}
cout << res << endl;
}
View keyboard shortcuts
In: Computer Science