Questions
Using Perl create a program that will output the scores of 3 golfers that are playing...

Using Perl create a program that will output the scores of 3 golfers that are playing nine holes of golf.
Create a blank array, this will be a two-dimensional array
@golf_array;
Load up the follow scores
For hole 1: Golfer 1 shot 4, Golfer 2 shot 3, Golfer 3 shot 5
For hole 2: Golfer 1 shot 3, Golfer 2 shot 3, Golfer 3 shot 4
For hole 3: Golfer 1 shot 7, Golfer 2 shot 5, Golfer 3 shot 5
For hole 4: Golfer 1 shot 6, Golfer 2 shot 3, Golfer 3 shot 4
For hole 5: Golfer 1 shot 3, Golfer 2 shot 7, Golfer 3 shot 4
For hole 6: Golfer 1 shot 3, Golfer 2 shot 3, Golfer 3 shot 3
For hole 7: Golfer 1 shot 4, Golfer 2 shot 4, Golfer 3 shot 5
For hole 8: Golfer 1 shot 5, Golfer 2 shot 5, Golfer 3 shot 4
For hole 9: Golfer 1 shot 3, Golfer 2 shot 6, Golfer 3 shot 3
Print out the scores for each golfer
Golfer 1:
Hole 1 – 4
Hole 2 – 3

Hole 9 – 3
Golfer 2:
Hole 1 – 3
Hole 2 – 3

Extra credit:
Print out which golfer had the lowest score and what that score was.

In: Computer Science

This question is all about Java 1. If we need to import multiple classes from different...

This question is all about Java

1. If we need to import multiple classes from different packages do we need an import line for each? Why?

2. How does dot notation differ when invoking methods & importing packages?

3. How does * work when importing packages?

4. We have to import the Scanner class in order to use its methods. Why not for String or System or Math class?

5. What package are each of the classes found in?

6. We need an object to invoke (call) the String & Scanner methods. Why don't we need to instantiate an object to invoke the Math methods?

7. List the Math methods & their parameter

In: Computer Science

What is a content delivery network, and what are the advantages and disadvantages of using a...

What is a content delivery network, and what are the advantages and disadvantages of using a content delivery network. When do you think you should and should not use one, and why?

In: Computer Science

In Python. Create a function called predictKNN(). Your function will return the classification of your data-pointIn...

In Python. Create a function called predictKNN(). Your function will return the classification of your data-pointIn addition to any parameters you see fit, your function should accept:

  • k
  • a data-point: a vector of r numbers
  • a dataframe with r columns.
    Run your function at least 5 times with different parameters.

In: Computer Science

Implement a GUI for AVL Tree for int data type using JavaFX. The GUI should provide...

Implement a GUI for AVL Tree for int data type using JavaFX. The GUI should provide facility to add, remove and find data elements and also traversal (in-order, pre-order, post-order, level-order) of the tree structure. If tree become unbalance, it should display the message that tree become imbalanced. It should provide a button to make the tree a Balance Tree. Extra: It should provide the option to load the data from a file and save the data in a file. Make it interactive for deleting a node. It will show deletion, insertion and balancing operations in single stepping graphically.

In: Computer Science

Problem 4 • Use Java Collections to write a small program using NetBeans to do the...

Problem 4 •

Use Java Collections to write a small program using NetBeans to do the following:

1. Create a queue object of Integer items, myQueue.

2. Create a stack object of Integer items, myStack.

3. Enqueue the integers 10, 20. 30, .., 100 into myQueue, in that order.

4. Push the integers 10, 20, 30, ..., 100 into myStack, in that order.

5. Display the message: "Here are the elements of myQueue:".

6. Remove and display the front element of the queue until myQueue becomes empty.

7. Display the message: "And here are the elements of myStack:".

8. Remove and display the top element of the stack until myStack becomes empty.

In: Computer Science

Convert the following pep/9 machine language program into an assembly code. Determine the output of this...

Convert the following pep/9 machine language program into an assembly code. Determine the output of this program if the input is ‘tab’. The left column is the memory address of the first byte on the line:

0000 D1FC15

0003 F1001F

0006 D1FC15

0009 F10020

000C D1FC15

000F F10021

0012 D10020

0015 F1FC16

0018 D1001F

001B F1FC16

001E 00

In: Computer Science

Consider the “index calculation” problem we have studied in the class (see lecture note), where we...

Consider the “index calculation” problem we have studied in the class (see lecture note), where we have a relation of 8,000,000 tuples. Again, make the following assumptions:

  • the size of disk block (also called disk page): it is usually 4K or 8K bytes, to make our calculation easier, we will use 4000 bytes as a block size
  • the size of the search key value: say we index the relation by using an attribute that is part of the primary key, and it is 40 byte string
  • the size of physical page addresses: this is needed since every node in the tree will store search key values as well as references to disk pages, i.e., the address of the disk page being referenced. For ease of calculation, we use a 10-byte page address
  • each swap takes about 10 milliseconds
  1. For this relation, calculate how long it will take to find a particular record if we use dense index, as

described by databaseSystems-71-indexing, page 2? [16 points]

  1. Consider again the situation in question 1, with the same dense index, but add one extra level of sparse index, as described by databaseSystems-71-indexing, page 5 – 6. Now, how long it will take to find one particular record? [16 points]

In: Computer Science

Write CORRECT c code to execute the following command >grep csc411 file.txt | sed s/411/414/g.

Write CORRECT c code to execute the following command

>grep csc411 file.txt | sed s/411/414/g.

In: Computer Science

suppose that you heard a famous author say, " Computer games are primarily for telling stories"....

suppose that you heard a famous author say, " Computer games are primarily for telling stories". Whether you agree or disagree with him, and explain why?

Solution plz?

In: Computer Science

Show that (0^n1^n) + (01)^n is decidable using a Turing machine

Show that (0^n1^n) + (01)^n is decidable using a Turing machine

In: Computer Science

Why software development life cycle (SDLC) is not enough for any game development? Any discuss the...

Why software development life cycle (SDLC) is not enough for any game development? Any discuss the different phrases of game game development Life cycle (GDLC)?

solution plz ?

In: Computer Science

#include <iostream> #include <cmath>using namespace std; const int A_CONSTANT = 3; void functionA(int a[], int aNumber);...

#include <iostream>

#include <cmath>using namespace std;

const int A_CONSTANT = 3;

void functionA(int a[], int aNumber);

void functionB(int a[], int anotherNumber);

void functionC(const int anArray[], int aNumber);

void functionD(int& sum);

int functionE(double number); void functionF(int n);

int main( ){

int production[A_CONSTANT];

cout << "This program displays a graph showing\n" << "production for each factory in the company.\n";

functionA(production, A_CONSTANT);

functionB(production, A_CONSTANT);

functionC(production, A_CONSTANT);

return 0;}

void functionA(int a[], int aNumber){

for (int someNumber = 1;someNumber <= aNumber; someNumber++)

{ cout << endl << "Enter production data for plant number " << someNumber << endl; functionD(a[someNumber - 1]);}}

void functionD(int& sum){

cout << "Enter number of units produced by each department.\n" << "Append a negative number to the end of the list.\n";

sum = 0; int next;

cin >> next;

while (next >= 0) {

sum = sum + next;

cin >> next; }

cout << "Total = " << sum << endl;

  

}

void functionB(int a[], int anotherNumber){

for (int index = 0; index < anotherNumber; index++)

a[index] = functionE(a[index]/1000.0);

  

}

int functionE(double number) {

return static_cast<int>(floor(number + 0.5));

  

}

void functionC(const int anArray[], int aNumber){

cout << "\nUnits produced in thousands of units:\n";

for (int someNumber = 1; someNumber <= aNumber; someNumber++) {

cout << "Factory #" << someNumber << " ";

functionF(anArray[someNumber - 1]);

cout << endl;

}

}

void functionF(int n) {

for (int count = 1; count <= n; count++) cout << "*";

  

}

The main purpose of this lab is to reinforce the lectures on code style and documentation.

Make as many improvements to the code style as you can including white space, variable names, etc. (NOTE: do this manually – no automated formatting tools allowed). Comment the file completely.

The main purpose of this lab is to reinforce the lectures on code style and documentation.

Make as many improvements to the code style as you can including white space, variable names, etc. (NOTE: do this manually – no automated formatting tools allowed). Comment the file completely.

The main purpose of this lab is to reinforce the lectures on code style and documentation.

Make as many improvements to the code style as you can including white space, variable names, etc. (NOTE: do this manually – no automated formatting tools allowed). Comment the file completely.

The reason why I wrote the question 3 times is because I want you to READ the question as the last person failed to do so, Please comment out the code

thanks

In: Computer Science

Write a python program that asks the user about their emails and then check the following:...

Write a python program that asks the user about their emails and then check the following:

  1. the entered email is a valid email address (email format is [USERNAME]@[ORGANIZATION].[DOMAIN]. i.e. it should have '@' followed by organization name then at least one '.'and domain)
  2. determine if the entered email is a KFUPM email or not (KFUPM emails ends with @kfupm.edu.sa)
  3. if the entered email is a valid KFUPM email, determine if it is a freshman student email or not (assume all freshman students have ID numbers starts with s2019 and the student ID length is 9 digits)
Sample run Sample run Sample run
write your email address: [email protected]
The email address is Valid
The entered email is a KFUPM email
The entered email is a freshman student email
write your email address: ics@104.
The entered email is not valid
write your email address: [email protected]
The email address is Valid

In: Computer Science

Supervisory Control and Data Acquisition (SCADA) systems are used to monitor and control industrial processes. In...

Supervisory Control and Data Acquisition (SCADA) systems are used to monitor and control industrial processes. In 2007, it was demonstrated that hackers with access to the SCADA system in a power generation plant could cause an industrial turbine to begin "spinning wildly out of control until it becomes a smoking hulk and power shuts down." (Schneier) Suppose such an attack was launched against a power plant. Which security goal (CIA) does the attack violate? Explain your answer.

In: Computer Science