Questions
Create an executable bash script named sync. You may find file name pattern matching and the...

Create an executable bash script named sync. You may find file name pattern matching and the basename command useful. In fact, the sync-skeleton file contains part of the solution to this problem. You may choose to use it anyway you wish. You'll have to create your own test directories (using the mkdir command) and files (using the touch command) to test this script.

You should research the options to the cp command in its main page.

  1. The script takes TWO ARGUMENTS. Let's call them dir1 and dir2. If two arguments are not given display an error message to that effect and exit.

  2. Verify that both given arguments are paths to directories. If one or neither argument is a path to a directory, display an error message to that effect and exit.

  3. If a file exists in dir1 but not in dir2, copy the file from dir1 to dir2 preserving its timestamp. Display a message saying what's being done.

  4. If a file exists in dir2 but not in dir1, copy the file from dir2 to dir1 preserving its timestamp. Display a message saying what's being done.

  5. If a file is in both directories but is newer in dir1 than the file in dir2, copy the file from dir1 to dir2 preserving its timestamp. Display a message saying what's being done.

  6. If a file is in both directories but is newer in dir2 than the file in dir1, copy the file from dir2 to dir1 preserving its timestamp. Display a message saying what's being done.

In: Computer Science

PYTHON PROBLEM: Goal: Design and implement a Python program to solve the following problem. Scientists measure...

PYTHON PROBLEM:

Goal: Design and implement a Python program to solve the following problem.

Scientists measure an object’s mass in kilograms and weight in newtons. If you know the amount of mass of an object in kilograms, you can calculate its weight in newtons with the following

formula:

[Note: Use or test any random numbers to check whether the weight is heavy, can be lifted or light]

????h? = ???? × 9.8

Write a program that asks the user to enter an object’s mass in kilograms, then calculates its weight in newtons. If the object weighs more than 980 newtons, the program should display the following message

The object is too heavy to be lifted

obviously indicating that it is too heavy to be lifted; otherwise, it should display the message

The object can be lifted

with the obvious meaning. If the object weighs less than 98 newtons, the program must display the following additional message

The object is quite light

1. Write the pseudocode for solving the problem.

2. Write the Python program.

In: Computer Science

Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...

Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every 4 minutes a new customer arrives at the end of waiting line, each customer will need 7 minutes for the service

Write a program to print out the information after the first 60 minutes

  • The time of arriving for each customer
  • The time of leaving for each customer
  • How many customers are in the line?
  • Who is the current serving customer?

(((( data structure course

Programming Language: java
Hint: use the queue concept )))

In: Computer Science

This is to be done using MIPS assembly language. Display the following menus, ask user to...

This is to be done using MIPS assembly language.

Display the following menus, ask user to select one item. If 1-3 is selected, display message “item x is selected”, (x is the number of a menu item), display menus again; if 0 is selected, quit from the program.

1. Menu item 1

2. Menu item 2

3. Menu item 3

0. Quit Please select from above menu (1-3) to execute one function. Select 0 to quit

In: Computer Science

create a java class with name ModernArt: For the first part of the assignment, you will...

create a java class with name ModernArt:

For the first part of the assignment, you will be extending the JApplet class and creating a work of modern using the Graphics class to draw various shapes to the applet window. As part of your masterpiece, you should incorporate the following elements:

  • At least 1 non-solid rectangle
  • At least 1 non-solid oval
  • At least 1 solid oval
  • At least 1 non-solid Polygon
  • At least 1 solid Polygon
  • At least 3 lines
  • At least 3 different colors
  • A caption (a text String) displayed somewhere on your work of art

You may use more elements than the minimal requirements above, but you must use at least that many. There are unit tests for this question that will determine if you have correctly included the required shapes and colors, but there are no tests to judge your work itself as it is not possible to write unit tests which measure the sheer lack of sophistication typically embodied by so much of modern art.

In: Computer Science

Program in C Make both a SOURCE AND HEADER FILE WITH FUNCTIONS to run the program....

Program in C

Make both a SOURCE AND HEADER FILE WITH FUNCTIONS to run the program. Input data from csv file. Two files. grades.c and grades.h Thank you

data.csv file

Mark Prest,37468,36,113,In Person
Andy Joe,6785923,19,98,Online
Caden Miller,237741,20,70.1,In Person
Luke Jr,2347878,18,45.9,In Online
Ally Rogers,8467483,30,89.99,Online
Maya Jank,5674930,30,90,In Person

Expected output
Name: Mark Prest
ID: 37468
Age: 36
Grade: 113.00
Attending: In Person

Name: Andy Joe
ID: 6785923
Age: 19
Grade: 98.00
Attending: Online


Name: Caden Miller
ID: 237741
Age: 20
Grade: 70.10
Attending: In Person


Name: Luke Jr
ID: 2347878
Age: 18
Grade: 45.90
Attending: Online


Name: Ally Rogers
ID: 8467483
Age: 30
Grade: 89.99
Attending: Online


Name: Maya Jank
NUID: 5674930
Age: 30
Grade: 90.00
Attending: In Person
--------------

2

---- Grade Stats ----
A's: 3
B's: 1
C's: 1
D's: 0
F's: 1
Avg grade: 84.50
---- Enrollment Statistics ----
Number of in person: 5
Number of online: 1
Average age: 25.50

In: Computer Science

Using Java, write the the following code. Only the bold needs to be answered Here is...

Using Java, write the the following code. Only the bold needs to be answered

Here is the driver:

package assign

public class A3Driver {

public static void main(String[] args) {

//Test GSUStudent object

GSUStudentWorker gsw = new GSUStudentWorker("Bunny","Bugs", 2000, 9, 8, 9001234);

gsw.setGPA(3.7);

gsw.setHourlyRate(10.00);

gsw.setTotalHours(30);

System.out.println(gsw);

GSUStudentWorker gsw2 = new GSUStudentWorker("Bunny","Betty", 1999, 9, 8, 9002413);

gsw2.setGPA(4.0);

gsw2.setHourlyRate(10.00);

gsw2.setTotalHours(45);

System.out.println(gsw2);

//Test GSUStoreSupervisor

GSUStoreSupervisor gss = new GSUStoreSupervisor("Duck","Daffy", 1980, 9, 8);

gss.setMonthlyPay(4000);

System.out.println(gss);

//test GSUSuperStudent

GSUSuperStudent gsuper = new GSUSuperStudent("Mouse","Minny", 1990, 9, 8, 9004321);

gsuper.setGPA(3.9);

gsuper.setHourlyRate(10.00);

gsuper.setTotalHours(30);

gsuper.setMonthlyPay(4000);

System.out.println(gsuper);

}

}

1. The Person class
a. Person is an abstract class.

b. All class variables of the Person class must be private.

c.is a class with a single constructor, Person(String lName, String fName, int birthYear, int birthMonth, int birthDay). All arguments of the constructor should be stored as class variables. There should only be getter methods for first and last name variables. There should be no getters or setters forbirthYear, birthMonth, birthDay.

  1. The method computeAge() takes no arguments and returns the person’s computed age (as of today's date) as a string of the form "X years, Y months and Z days". Hint: Use the LocalDate and Period classes.

    i. e.g. "21 years, 2 months and 3 days". ii. e.g. "21 years and 3 days".

    iii. e.g. "21 years and 2 months". iv. e.g. "21 years".

    v. e.g. "2 months and 3 days".

  2. The toString method returns a string comprised of the results of

    getFname, getLName and computeAge. E.g.
    i. “Bunny Bugs is 19 years and 1 day old”

  3. The equals method returns true if the name and date of birth of this person and the other person are the same, otherwise return false.

2. The Employee interface
a.has a single method, getPay(), which returns a double

representing the pay earned for the period in dollars and cents.

3. The MonthlyEmployee interface
a. This interface extends the Employee interface.
b. has a single void method, setMonthlyPay(double perMonth), which

takes a double as an argument. The argument is the amount earned for the month in dollars and cents.

4. The HourlyEmployee interface
a. This interface extends the Employee interface.
b. has a void method, setHourlyRate(double perHour), which takes a

double as an argument. The argument is the amount earned for

each hour that the employee works.


c. has a void method, setTotalHours(double hoursWorked), which

takes a double as an argument. The argument is the total hours worked for the week.

  1. Has a final integer variable MAX_WEEKLY_HOURS, which is assigned

    a value of 40. This variable is used to assess if the total

    hours worked exceeds the mandated hours.

  2. Has a final double variable OVERTIME_RATE, which is assigned a

    value of 1.75. This variable is used to compute the pay amount for hours worked that exceeds the mandated hours.

5. The Student class
a. The Student class is abstract.

  1. The Student class extends the Person class.

  2. All (if any) class variables of the Student class must be private.

  3. has an abstract void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.

  4. has an abstract method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.

6. The GSUStudentWorker class
a. The GSUStudentWorker class extends the Student class and

inherits from the HourlyEmployee interface.

  1. is a class with a single constructor, GSUStudentWorker (String lName, String fName, int birthYear, int birthMonth, int birthday, int eid). There should be a getter and setter for eid, which is the Eagle ID of the student.

  2. All class variables of the Student class must be private.

  3. has a void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.

  4. has a method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.

f. Has a toString() method that returns a string in the form shown below.

i. Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.

7. The GSUStoreSupervisor class
a. The GSUStoreSupervisor class extends the Person class and

inherits from the MonthlyEmployee interface.

  1. is a class with a single constructor, GSUStoreSupervisor(String lName, String fName, int birthYear, int birthMonth, int birthDay).

  2. All class variables of the Student class must be private.

  3. Has a toString() method that returns a string in the form shown below.

    i. Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.

8. The GSUSuperStudent class
a. GSUSuperStudent has found a way to get paid as a monthly

         employee and as a student employee.
  1. The GSUSuperStudent class extends the GSUStudentWorker class and inherits from the MonthlyEmployee interface.

  2. All class variables of the Student class must be private.

  3. Has a toString() method that returns a string in the form shown below.

    i. Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.

Example output:

__________Example from A3Driver shown below

Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.

Betty Bunny is 20 years and 15 days old and is a Great Sauce student with a 4.0 GPA who earned $487.50 this week.

Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.

Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.

In: Computer Science

Using Java, write the the following code. Only the bold needs to be answered Here is...

Using Java, write the the following code. Only the bold needs to be answered

Here is the driver:

package assign

public class A3Driver {

public static void main(String[] args) {

//Test GSUStudent object

GSUStudentWorker gsw = new GSUStudentWorker("Bunny","Bugs", 2000, 9, 8, 9001234);

gsw.setGPA(3.7);

gsw.setHourlyRate(10.00);

gsw.setTotalHours(30);

System.out.println(gsw);

GSUStudentWorker gsw2 = new GSUStudentWorker("Bunny","Betty", 1999, 9, 8, 9002413);

gsw2.setGPA(4.0);

gsw2.setHourlyRate(10.00);

gsw2.setTotalHours(45);

System.out.println(gsw2);

//Test GSUStoreSupervisor

GSUStoreSupervisor gss = new GSUStoreSupervisor("Duck","Daffy", 1980, 9, 8);

gss.setMonthlyPay(4000);

System.out.println(gss);

//test GSUSuperStudent

GSUSuperStudent gsuper = new GSUSuperStudent("Mouse","Minny", 1990, 9, 8, 9004321);

gsuper.setGPA(3.9);

gsuper.setHourlyRate(10.00);

gsuper.setTotalHours(30);

gsuper.setMonthlyPay(4000);

System.out.println(gsuper);

}

}

1. The Person class
a. Person is an abstract class.

b. All class variables of the Person class must be private.

c.is a class with a single constructor, Person(String lName, String fName, int birthYear, int birthMonth, int birthDay). All arguments of the constructor should be stored as class variables. There should only be getter methods for first and last name variables. There should be no getters or setters forbirthYear, birthMonth, birthDay.

  1. The method computeAge() takes no arguments and returns the person’s computed age (as of today's date) as a string of the form "X years, Y months and Z days". Hint: Use the LocalDate and Period classes.

    i. e.g. "21 years, 2 months and 3 days". ii. e.g. "21 years and 3 days".

    iii. e.g. "21 years and 2 months". iv. e.g. "21 years".

    v. e.g. "2 months and 3 days".

  2. The toString method returns a string comprised of the results of

    getFname, getLName and computeAge. E.g.
    i. “Bunny Bugs is 19 years and 1 day old”

  3. The equals method returns true if the name and date of birth of this person and the other person are the same, otherwise return false.

2. The Employee interface
a.has a single method, getPay(), which returns a double

representing the pay earned for the period in dollars and cents.

3. The MonthlyEmployee interface
a. This interface extends the Employee interface.
b. has a single void method, setMonthlyPay(double perMonth), which

takes a double as an argument. The argument is the amount earned for the month in dollars and cents.

4. The HourlyEmployee interface
a. This interface extends the Employee interface.
b. has a void method, setHourlyRate(double perHour), which takes a

double as an argument. The argument is the amount earned for

each hour that the employee works.


c. has a void method, setTotalHours(double hoursWorked), which

takes a double as an argument. The argument is the total hours worked for the week.

  1. Has a final integer variable MAX_WEEKLY_HOURS, which is assigned

    a value of 40. This variable is used to assess if the total

    hours worked exceeds the mandated hours.

  2. Has a final double variable OVERTIME_RATE, which is assigned a

    value of 1.75. This variable is used to compute the pay amount for hours worked that exceeds the mandated hours.

5. The Student class
a. The Student class is abstract.

  1. The Student class extends the Person class.

  2. All (if any) class variables of the Student class must be private.

  3. has an abstract void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.

  4. has an abstract method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.

6. The GSUStudentWorker class
a. The GSUStudentWorker class extends the Student class and

inherits from the HourlyEmployee interface.

  1. is a class with a single constructor, GSUStudentWorker (String lName, String fName, int birthYear, int birthMonth, int birthday, int eid). There should be a getter and setter for eid, which is the Eagle ID of the student.

  2. All class variables of the Student class must be private.

  3. has a void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.

  4. has a method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.

f. Has a toString() method that returns a string in the form shown below.

i. Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.

7. The GSUStoreSupervisor class
a. The GSUStoreSupervisor class extends the Person class and

inherits from the MonthlyEmployee interface.

  1. is a class with a single constructor, GSUStoreSupervisor(String lName, String fName, int birthYear, int birthMonth, int birthDay).

  2. All class variables of the Student class must be private.

  3. Has a toString() method that returns a string in the form shown below.

    i. Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.

8. The GSUSuperStudent class
a. GSUSuperStudent has found a way to get paid as a monthly

         employee and as a student employee.
  1. The GSUSuperStudent class extends the GSUStudentWorker class and inherits from the MonthlyEmployee interface.

  2. All class variables of the Student class must be private.

  3. Has a toString() method that returns a string in the form shown below.

    i. Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.

Example output:

__________Example from A3Driver shown below

Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.

Betty Bunny is 20 years and 15 days old and is a Great Sauce student with a 4.0 GPA who earned $487.50 this week.

Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.

Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.

In: Computer Science

Give examples to show that (a) The intersection of two countably infinite sets can be finite;...

Give examples to show that
(a) The intersection of two countably infinite sets can be finite;
(b) The intersection of two countably infinite sets can be countably
infinite;
(c) The intersection of two uncountable sets can be finite;
(d) The intersection of two uncountable sets can be countably infin
ite;
(e) The intersection of two uncountable sests can be uncountable
Give examples to show that
(a) The intersection of two countably infinite sets can be finite;
(b) The intersection of two countably infinite sets can be countably
infinite;
(c) The intersection of two uncountable sets can be finite;
(d) The intersection of two uncountable sets can be countably infin
ite;
(e) The intersection of two uncountable sests can be uncountable
Give examples to show that
(a) The intersection of two countably infinite sets can be finite;
(b) The intersection of two countably infinite sets can be countablyinfinite;
c) The intersection of two uncountable sets can be finite;
d) The intersection of two uncountable sets can be countably infinite;
e) The intersection of two uncountable sests can be uncountable

In: Computer Science

Application assignment: using Excel Descriptive Statistics of Quantitative Data (measured on Ratio scale). Use this file...

Application assignment: using Excel

Descriptive Statistics of Quantitative Data (measured on Ratio scale).

Use this file for submission, but use Excel to do your work and copy and paste in the appropriate places identified in this word file.

Note: The following Excel functions in answering Questions 1 and 2 below.

AVERAGE , AVEDEV, COUNT, CORREL, MIN, MAX, MDIAN, MODE, STDEV , STDEVP, STDEV.P, and STDEV.S

Q3. Data Analysis descriptive   Option on Excel 2010 or later to obtain descriptive statistics (Mean, Standard Error, Median, Mode,… ) of both variables X and Y.

Insert your answer here .

Note: Copy the data for the two variables into an excel file and calculate the Descriptive Statistics of both X and Y (using Excel) as explained in class. After you find the required statistics in excel copy them and paste your answer below.

Descriptive for the X values:

Descriptive for the X values:  

Table 1

        ID

           X

      Y

1

3

29

2

4

32

3

4

34

4

5

36

5

5

37

6

5

38

7

5

39

8

6

40

9

6

41

10

6

42

11

6

42

12

7

43

13

7

44

14

7

44

15

7

45

16

7

45

17

8

46

18

8

46

19

8

47

20

8

47

21

9

48

22

9

48

23

9

49

24

9

49

25

9

50

26

10

51

27

10

51

28

10

52

29

10

52

30

10

53

31

11

53

32

11

54

33

11

54

34

11

55

35

12

55

36

12

56

37

12

56

38

13

57

39

13

58

40

13

58

41

14

59

42

14

60

43

15

61

44

15

62

45

16

63

46

17

64

47

18

66

48

19

68

49

21

71

50

23

73

In: Computer Science

Write a program that removes a target item (a string) from a list of strings, and...

Write a program that removes a target item (a string) from a list of strings, and
that will print out the list without the item. Do not use built-in functions other than
input, print, and append. Instead, you may generate a new list that does not
include the target item and you can use the append() function. Your program
should read two inputs: the target and the list. For example, if the input is “apple”
and the list is [‘berry’, ‘apple’, ‘pear’, ‘orange’], the outputs should be [‘berry’,
‘pear’, ‘orange’] .

In: Computer Science

Create a dice simulator in C#. The simulator must roll the dice 6 times and it...

Create a dice simulator in C#. The simulator must roll the dice 6 times and it must add the 3 highest rolls. So say it simulates: 4 4 5 2 1 3 the total would be 13 (4+4+5=13). Repeat this 6 different times.

So if the random dice simulator simulates the outcomes below it should output: 13, 13, 14, 12, 16, 12

1) 4 4 5 2 1 3

2) 2 3 6 1 3 4

3) 5 3 1 4 6 2  

4) 4 2 2 1 1 6

5) 5 4 5 6 3 1

6) 1 2 4 5 3 2

In: Computer Science

Problem Statement Create a program that will convert a decimal value into roman numeral, and output...

Problem Statement Create a program that will convert a decimal value into roman numeral, and output the result. The program will ask for an integer input, assume all inputs are valid, and the program should not end unless the user tells you to.

Refactoring Once your program is running correctly, put your conversion algorithm into a function named d_to_r(), which takes a string as parameter and return an int. You are allowed to create more helper functions if needed.

Link for Roman numerals: http://sierra.nmsu.edu/morandi/coursematerials/RomanNumerals.html

In: Computer Science

Please post a screenshot of excel file. Application assignment: using Excel Descriptive Statistics of Quantitative Data...

Please post a screenshot of excel file.

Application assignment: using Excel

Descriptive Statistics of Quantitative Data (measured on Ratio scale).

Use this file for submission, but use Excel to do your work and copy and paste in the appropriate places identified in this word file.

Note: The following Excel functions in answering Questions 1 and 2 below.

AVERAGE , AVEDEV, COUNT, CORREL, MIN, MAX, MDIAN, MODE, STDEV , STDEVP, STDEV.P, and STDEV.S

Q4.

  1. Use the x data and define a new variable called U=X+10 by adding 10 to each of the x values.

Use the data for U and reuse Data Analysis descriptive Option to calculate the descriptive statistics of U.

Insert your answer here:

Descriptive for the U values:  

  1. Compare the results for X with that of U and report the differences.

Insert your comparison answer here:

In: Computer Science

USING THE SWITCH STATEMENT - Write a java program that asks the user to enter the...

  1. USING THE SWITCH STATEMENT - Write a java program that asks the user to enter the number of their favorite month of the year – obviously, that would be 1 – 12.

Write a switch statement that takes the number and converts it to the fully spelled out name [ex. 3 would be MARCH] .

Be sure to build in error message to catch any invalid data entries such as 0 or 13 etc.

Print out the number that was entered and the name that resulted.

In: Computer Science