Questions
SalaryCalculator in Java. The SalaryCalculator class should have instance variables of: an employee's name, reportID that...

SalaryCalculator in Java. The SalaryCalculator class should have instance variables of:

an employee's name, reportID that is unique and increments by 10, and an hourly wage.

There should also be some constructors and mutators, and accessor methods.

In: Computer Science

Which location determines the jurisdiction of a breach of personally identifiable information (PII)? Where the PII...

Which location determines the jurisdiction of a breach of personally identifiable information (PII)?

Where the PII breach occurred

Where the individuals with compromised PII reside

Where the PII was processed

Where the compromised PII was stored

In: Computer Science

The following question is based upon the BIRD relation below, which lists information about the birds...

The following question is based upon the BIRD relation below, which lists information about the birds of the USA . You can assume the data is representative. Note that scientific names are generally used worldwide for plants and animals to eliminate ambiguity, as common names can vary between countries. You have been asked to design a relational database based on this design. You know that there are problems with the current design and that it will need to be modified in order to work effectively. Answer the following questions.

a. What is the candidate key (or keys) of the relation, as it currently exists? What normal form is the relation in? Explain your reasoning.

b. Explain the problems with the existing design, in terms of the potential modification anomalies that it might exhibit.

c. Convert the relation to a set of relations in at least Third Normal Form (3NF). You only need to show the schema, not the data. Do not create any new attributes: work with the ones in the table. Give each of your new relations an appropriate name. Show all primary keys and foreign keys.

d. Explain how your new design addresses the problems you identified in (b). Also demonstrate that your set of relations has the dependency preserving and lossless join properties.

HABITAT GENUS SPECIES ORDER FAMILY FAMILY NAME COMMON NAME FOOD DISTRIBUTION CONSERVATION
desert melanerpes uropygialis Piciformes Picidae Woodpeckers Gila Woodpecker Omnivore Southwestern US Low concern
Forests Buteo platypterus Accipitriformes Accipitridae Hawks, Eagles and Kites Broad-winged Hawk Small animals Eastern US Low concern
Lakes and ponds Pandion haliaetus Accipitriformes Pandionidae Osprey Osprey Fish Northern US Low concern
Lakes and ponds Aix sponsa Anseriformes Anatidae Ducks, Geese and Waterfowl Wood Duck Insects Eastern US low concern
Lakes and ponds Aix sponsa Anseriformes Anatidae Ducks, Geese and Waterfowl Wood Duck Insects Northwest US Low concern
Lakes and ponds Gavia pacifica Gaviiformes Gaviidae Loons Pacific Loon Fish Pacific Coast Low concern
Lakes and ponds Pelecanus erythrorhynchos Pelecaniformes Pelecanidae Pelicans American White Pelican fish Central US low concern
Lakes and ponds Pelecanus erythrorhynchos Pelecaniformes Pelecanidae Pelicans American White Pelican Fish Southern Coast Low concern
Marshes Anser canagicus Anseriformes Anatidae Ducks, Geese and Waterfowl Emperor Goose Plants Northwest Coast Restricted range
Marshes Eudocimus albus Pelecaniformes Threskiornithidae Ibises and Spoonbills White Ibis Aquatic invertebrates Southeast US Low concern
Oceans Larus occidentalis Charadriiformes Laridae Gulls, Terns, and Skimmers Western Gull Fish Pacific Coast Low concern

Please help ^_^. My brain is fried, any help is appreciated!

In: Computer Science

How do I get the following code to accept a float input, while also fixing the...

How do I get the following code to accept a float input, while also fixing the syntax errors in the code because I can't figure out what is wrong with it.

def chemical_strength(pH):
if 0<pH>14:
if pH <= 7:
if pH = 7:
ans = str("neutral")
else: # ph < 7
if 0<pH>=1:
ans = str("very strong acid")
else: # 1<pH>7
if 1<pH>4:
ans = str("strong acid")
else: # 4=<ph>7
if pH = 4:
ans = str("plain acid")
else: # 4<pH>7
if 4<pH>6:
ans = str("weak acid")
else: # 6=<pH>7
ans = str("very weak acid")
else pH >= 7:
if pH = 7:
ans = str("neutral")
else: # ph > 7
if 7<pH>=8:
ans = str("very weak base")
else: # 8<pH>14
if 8<pH>10:
ans = str("weak base")
else: # 10=<pH>14
if pH = 10:
ans = str("plain base")
else: # 10<pH>14
if 10<pH>13:
ans = str("strong base")
else: # 13=<pH>14
ans = str("very strong base")
else:
ans = str("bad measurement")
return ans

In: Computer Science

The Golomb's sequence is G(n) = 1 + G(n - G(G(n - 1))) For what n...

The Golomb's sequence is G(n) = 1 + G(n - G(G(n - 1)))

For what n value (approximately) does your computer stop producing output? Why is this?  

The following is my code, but I don't know what would be the max value for n, since my computer stuck at 80

#include <iostream>

using namespace std;

int golombSequence(int);

int golombSequence(int max){

if(max == 1){

return 1;

}

else{

return 1 + golombSequence(max - golombSequence(golombSequence(max-1)));

}

}

int main(int argc, const char * argv[]) {

// int n = 90;

// for(int i = 1; i<=n; i++){

// cout<<i<<": "<<golombSequence(i)<<endl;

// }

// return 0;

}

In: Computer Science

Using the R code below, calculate daily log returns and assign the name ‘returnlogs’ library(quantmod) getSymbols("MSFT",...

Using the R code below, calculate daily log returns and assign the name ‘returnlogs’

library(quantmod) getSymbols("MSFT", src = "yahoo", from='2017-01-03', to='2018-12-31')

b) MSFTAduestedj <- MSFT$MSFT.Adjusted

In: Computer Science

What tasks and deliverables are needed to implement "User Domain" risk mitigation recommendations?

What tasks and deliverables are needed to implement "User Domain" risk mitigation recommendations?

In: Computer Science

Provide code and assertion statements for the pre/post-conditions. (To execute the assertion code, the java.exe requires...

Provide code and assertion statements for the pre/post-conditions. (To execute the assertion code, the java.exe requires the option -ea for the VM).

// ***  MyArrayList is limited to 100 elements.  ***
public class MyArrayList<E> extends ArrayList<E> {

    public MyArrayList() {
        // assert postcondition
    }

    @Override
    public int size() {
        // assert postcondition
        // code
    }

    // Insert e as a new first element to mal
    public void insertFirst(E e) {
        // assert precondition
        // code
        // assert postcondition
    }

    // Insert e as a new last element
    public void insertLast(E e) {
        // assert precondition
        // code
        // assert postcondition
    }

    // Delete my first element
    public void deleteFirst() {
        // assert precondition
        // code
        // assert postcondition
    }

    // Delete my last element
    public void deleteLast() {
        // assert precondition
        // code
        // assert postcondition
    }

    public void show() {
        for (E e : this) {
            System.out.println(e);
        }
    }
}

public class Student {
     // code
}

public class MyProg {
    public static void main(String[] args) {
        MyArrayList<Student> mal = new MyArrayList<>();
        mal.insertFirst(new Student(1, "John"));
        mal.insertFirst(new Student(2, "Mary"));
        mal.insertLast(new Student(3, "Mike"));
        mal.show();
        mal.deleteLast();
        mal.show();       
        mal.deleteFirst();
        mal.show();

    }
  }

// ------------------- EXPECTED OUTPUT --------------------- //

The following is the execution output if all assertions are valid and passed:

2, Mary

1, John

3, Mike

2, Mary

1, John

1, John

In: Computer Science

At the onset of this course, we discussed converting data into information, or knowledge. In your...

At the onset of this course, we discussed converting data into information, or knowledge. In your own words, describe that process. Why is it important?

In: Computer Science

What is the difference between a process and a thread? What prevents complete thread independence? Give...

  • What is the difference between a process and a thread?
  • What prevents complete thread independence? Give one specific example of a dependency.
  • What are the advantages/disadvantages of designing a concurrent program using threads versus events?

In: Computer Science

in C language only. Write a program called gamecards.c that has a card game logic by...

in C language only.

Write a program called gamecards.c that has a card game logic by comparing the cards from 4 people and calculating which player has the best card.

1. Every card must be represented by exactly two chars
representing a rank and a suit.

ranks: '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'. ('T' = 10)

Suits: 'H', 'D', 'S', 'C'.

7D represents the “7 of Diamond” etc..


2. Write a function called isRank(char c) which
calculate if the given character is one of the ranks. It would return a char with a value of 1 if the character is a valid rank and 0 if not.

Write a function called isSuit(char c) which calculate if the given character is one of the suits. It should return a char with a value of 1 if the character is a valid suit and 0 if not.
(Lowercase are not valid for both functions)

In: Computer Science

Explian interpolation: bilinear interpolation, subject is digital image processing.

Explian interpolation: bilinear interpolation, subject is digital image processing.

In: Computer Science

search the file "myfile.txt" for any occurrences of "Some target string" and print the lines where...

search the file "myfile.txt" for any occurrences of "Some target string" and print the lines where the string is found.

In this assignment, write your own java version of this program:

  1. Name the program LastnameFirstname1 (this is not really an appropriate name for such a program, but following this convention greatly eases the grading process). Example: WhiteMax1
  2. Allow the user to specify the string they are searching for and the file they wish to search with command line arguments. To replicate the above findstr and grep examples, the program would be executed with the following command: java WhiteMax1 "Some target string" myfile.txt  (for help using command line arguments, see this article).
  3. Search each line of the file for the target string. For every occurrence found, first print out the line number where it has been found, the index of the target string's start position in that line, and the entire line itself. For example, searching line 5, "My dog is a good boy" for the target string "dog" would print: 5:3 My dog is a good boy   (If no occurrences are found, nothing needs to be printed. If multiple occurrences are found in the same line, print the line multiple times with each index position. File line numbers start at 1, not 0)

To complete this assignment you will need to use Scanner, File, and String. Consider reviewing the documentation for these classes. The attached file is provided as an example text file for developing and testing your program.

In: Computer Science

Describe two debugging techniques that are used for C programs. Which of these techniques do you...

Describe two debugging techniques that are used for C programs. Which of these techniques do you use most often and why do you use it rather than another technique? Why do you find this technique works better than the other technique?

i need help with this question

In: Computer Science

Assignment 1: JAVA Classes, Objects, and Constructors The goal of this assignment is to get you...

Assignment 1: JAVA Classes, Objects, and Constructors

The goal of this assignment is to get you familiar with some of the most used JAVA syntax, as well as constructors objects, objects calling other objects, class and instance attributes and methods. You will create a small program consisting of Musician and Song classes, then you will have Musicians perform the Songs.

Included is a file “Assignment1Tester.java”. Once you have done the assignment and followed all instructions, you should be able to compile and run “Assignment1Tester.java”. If “Assignment1Tester.java” compiles and runs, this does not mean your code is correct. But it will make sure that your public facing interface and member variables have the correct specification.

Make certain all member variables and methods are exactly as requested. We may use automated marking, and if we do and you spell a member variable differently, you will not get the mark. That is why we highly encourage you to compile and run “Assignment1Tester.java”. It will check some of these things for you.

Every question is worth 5 marks.

1. Open the file “Musician.java”. There is a “static final” variable defaultNumberOfKnownSongs that has been initialized to 3. In the Musician class, we will add 3 more instance variables. The first should be called name and should be of typeString. The second should be called knownSongs and it should be an array of type Song. The third should be an int callednumKnownSongs.

2. Write a constructor that takes two arguments, “String name” and “int numberOfSongs”. Have this constructor initializeknownSongs to an array of Song with length numberOfSongs, and initialize the name instance variable to the name String that was passed in through the constructor. You should make use of the this keyword. Write a second constructor for theMusician class with a single argument “String name” that initializes knownSongs to an array of Song with lengthdefaultNumberOfKnownSongs. In both constructors initialize numKnownSongs to zero.

3. Write a public String toString(). If the name = “Slash” and he knows 2 songs, it should return a String “My name is Slash and I know 2 songs.”

4. Open the class “Song.java”. Write three constructors. Write a no-argument constructor that assigns the name “unknown” to the song name and “pop” to genre. Write a constructor that takes a String argument and assigns it to name, and assigns “pop” to genre. Write a constructor that takes two String arguments, the first of which is assigned to name and the second is assigned to genre. Make sure that “name” comes first in the constructor method signature.

5. Write a static method “randomSong()” that returns a Song object with a random name from the songNames array and a random genre from the songGenre array.

6. Write a method “public String toString()” that returns a String object describing the Song. That is, if name = “Paradise City” and genre = “hard rock”, then “public String toString()” should return the String “the hard rock song ‘Paradise City’.”

7. Write a method “equals(Song song)” in the Song class that compares the current Song object to the song variable. It returns true if the two songs have the same name and same genre, and false otherwise.

8. In the Musician class, write a method “public boolean learnSong(Song song)”. It should assign the song argument to the first open position in the knownSongs array. If the array is full it should not change the array and return false. If the array is not full, add the song and return true.

9. In the Musician class, write a method “public boolean playSong(Song song)”. If the song argument is equal to a song in the knownSongs array, then the method should output the Musicians name followed by “performs” followed by the song. For instance, if the Musician is named “Slash” and the song was ‘Paradise City’, it would print “Slash performs the hard rock song ‘Paradise City’.” to the screen and return true. Hint: you can make use of the toString() method of the Song class. If the Song argument is not equal to any Song in the knownSongs array, then this method should print “Slash does not know the hard rock song ‘Paradise City’.” and return false.

10. In the Musician class, write a method “public void playAllKnownSongs()”. This method should play every song in the knownSong array with each song formatted as in Question 9.

In: Computer Science