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.
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".
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”
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.
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.
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.
The Student class extends the Person class.
All (if any) class variables of the Student class must be private.
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.
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.
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.
All class variables of the Student class must be private.
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.
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.
is a class with a single constructor, GSUStoreSupervisor(String lName, String fName, int birthYear, int birthMonth, int birthDay).
All class variables of the Student class must be private.
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.
The GSUSuperStudent class extends the GSUStudentWorker class and inherits from the MonthlyEmployee interface.
All class variables of the Student class must be private.
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
In: Computer Science
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
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 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 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 (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.
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:
Insert your comparison answer here:
In: Computer Science
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
A job ad for Gaggle Inc. says that it is necessary to major in math, computer science, or philosophy, and be an A or B student. However, Gaggle makes an exception and does not have any grade requirements if you have won a Turing award or Fields Medal (they still have the major requirements). You have also heard through the grapevine that it is sufficient that you are in one of these 3 majors and an A student.
Express the above as one PC wff. You should of course state what your atoms represent. Please do not do any form of reasoning to simplify the wff – that’s not the point here, and may also introduce bugs.
In: Computer Science
1. Using Kerberos for authentication eliminates the need for a user to have a password for each server or resource they want to access.
True
False
2. Secure hash functions provide data integrity, but not data authenticity .
True
False
3. Which of the following is an example of "Something you possess"?
Key
Face Recognition
Finger print
Password
4. ____________ enables the sharing of identities across different enterprises for user access to applications.
Identity Federation
Kerberos Realm
Public-key infrastructure
Multifactor Authentication
5. Which of the following is considered an offline password attack?
Man-in-the-middle attack
Packet sniffing attack
Replay Attack
Rainbow Attack
6. Linux based system use a method called __________ in their password hashes to create unique hashes for all passwords.
LM-hash
SHA-512
Virtual Secure Mode
Salting
In: Computer Science
IN PYTHON:
write a new subclass hiAccount that allows you to earn interest at the rate of .01% per SECOND.
Write a new method called checkBalance for hiAccount that computes hiAccount's value, accounting for the growth of your hiAccount between when the time when the deposit was made and when you invoke checkBalance.
using following code:
class Account:
"""A bank account that has a non-negative balance."""
def __init__(self, account_holder):
"""Every Account is described using the name of the account holder,
which is a string."""
self.balance = 0
self.holder = account_holder
def deposit(self, amount):
"""Increase the account balance by amount and return the new
balance."""
self.balance = self.balance + amount
return self.balance
def withdraw(self, amount):
"""Decrease the account balance by amount and return the new
balance."""
if amount > self.balance:
return 'Insufficient funds'
self.balance = self.balance - amount
return self.balance
In: Computer Science
add -54 and -101 using 9 bit 2's complement
In: Computer Science
Shapes2D
Write the following four classes to practice using an abstract class and polymorphism. Submit all four classes.
Shape2D class
For this class, include just an abstract method name get2DArea() that returns a double.
Rectangle2D class
Make this class inherit from the Shape2D class. Have it store a length and a width as fields. Provide a constructor that takes two double arguments and uses them to set the fields. Note, the area of a rectangle is the length times the width.
Circle2D class
Also make this class inherit from the Shape2D class. Have it store a radius as a field. Provide a constructor that takes a double argument and uses it to set the field. Note, the area of a circle is PI times it's radius times it's radius.
Shape2DDriver class
Have this class provide a method named displayArea() that takes an object from just any of the above three classes (you can't use an Object type parameter). Have the method display the area of the object, rounded to one decimal place.
Also the code should Enforce an abstract get2DArea() method and the right parameter type for displayArea()
Executes the following code:
Shape2DDriver tester = new Shape2DDriver();
Rectangle2D r = new Rectangle2D( 2, 3 );
Circle2D c = new Circle2D( 4 );
tester.displayArea( r );
tester.displayArea( c );
In: Computer Science
add -19 and 79 using 16-bit 2's complement format
In: Computer Science
Please write a program in c# that meets the following specifications.
Dominion Gas Corporation would like you to develop an application that helps them calculate the gas consumption bill of their customers. The application would first ask for the customer account number, the customer name and the type of account (residential or commercial). Then the application asks for the gas consumed during the past month by the customer in MCF (the unit used to indicate the amount of gas consumed). After gathering all this information the application calculates the bill based on the type of account (residential or commercial) and prints out the bill.
Technical Specifications:
The application will have two classes: Account and AccountTest
The Account class will have the following elements in it:
INSTANCE VARIABLES:
Constructor
Methods
The AccountTest class will have the following elements in it
the main method performs the following actions
asks for the account number, reads it in and stores it in a variable
Asks for the customer name, reads it in and stores it in a variable
uses these two pieces of information to create an object using the Account class's constructor
Calls the method that calculates the bill for the object created
calls the method that displays the bill for the object created.
In: Computer Science