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.
Rectangle2D 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 displayName() 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.
In: Computer Science
A sheet of glass is coated with a 495-nm-thick layer of oil (n = 1.42).
1- For what visible wavelengths of light do the reflected waves interfere destructively?
2- What is the color of reflected light? ( Yellow,Green-blue,Red, or Orange )
3- What is the color of the most part of transmitted light? ( Orange, Yellowish green, Red,or Blue ).
Please, show me.
In: Physics
Choose a job in your field from one of the job search sites. Using Word, describe how you would network to get the position you chose. Submit to the Job Search and Networking Folder below.
In: Operations Management
Slaughterhouse-Five Analysis
Why end with the novel with "Poo-tee-weet?"
In: Psychology
If (S)-Ibuprofen is more active pharmacologically, why are Ibuprofen prescriptions still prepared from a racemic mixture of the enantiomers?
In: Chemistry
In: Operations Management
Two computers have 7-stage fetch-execute cycles where branches are determined in stage 4. One computer is not pipelined, and the other is pipelined. Assuming that tp = 1, answer the following questions when running a program with 50,000 instructions where 1,000 of the instructions are conditional branches and each branch, if taken, skips over 10 instructions.a.How much faster is the pipelined machine over the non-pipelined machine assuming that no branches are taken.b.How much faster is the pipelined machine over the non-pipelined machine assuming that all branches are taken.c.Bonus question: How many branches would the program have to have assuming every branch is taken (and every branch skips over 10 instructions) for the non-pipelined machine to execute the program in the same time as the pipelined machine?
In: Computer Science
Imagine you are working for a Korean company. Discuss how you would be able to deal with the Korean management style, and what would probably be the biggest cultural challenges for you to accommodate to such an environment.
(4 paragraphs)
In: Operations Management
There are 4 processes with different arrival time and service time.
|
Process |
Arrival |
Service |
|
A |
0 |
10 |
|
B |
3 |
4 |
|
C |
5 |
6 |
|
D |
7 |
2 |
a. Use FCFS, RR(4), SPN, SRT, and HRRN to schedule them. Calculate
the waiting time and turnaround time for each process and the
average turnaround time for each algorithm.
b. Compare all the 5 algorithms. Considering the overhead time for each scheduling takes 1 time unit, which is the best? If the overhead takes 4 time units, which is the best?
In: Computer Science
Based on your reading style, how could you have learned material better, how could you apply this information? Give an example of how you did or could have applied this information. 250 word initial response.
In: Psychology
Use R programming Language
Q1.
(a)Write a function called lowerTrim that takes 2 arguments: x and trimBelow. This function takes the average of those values in x that are greater than the trimBelow. Make x a required argument and supply a default value for trimBelow of negative infinity.
First create some variable to be used for testing later.
x = 1:5 y = letters z = list(a = 1:5, b = 1:10)
Now test your function with the following
lowerTrim(x) lowerTrim(-10:5, trimBelow = 0) lowerTrim(-10:5, -2) lowerTrim(x = -10:5, trimBelow = Inf)
The return values should be: 3, 3, 2, and NaN, respectively
(b). Extend your function so that it takes a third parameter, which allows the caller to use a function other than mean() when calculating the lowerTrim. Call this argument sumFunc and give it a default value so that it operates like the original lowerTrim function. Call this revised function lowerTrim2
Check your function with the following calls:
lowerTrim2(-10:20, trimBelow = -5, median) lowerTrim2(-10:20, trimBelow = 0, sumFunc = summary)
The return values should be 8 and the summary values of 1, 5.75 10.5, 10.5, 15.2, and 20.
(c) Modify your function to take in any argument through the ... argument and pass these arguments. Call this new function lowerTrim3.
And test your code with
lowerTrim3(x, sumFunc = sd)
lowerTrim3(-10:20, trimBelow = 0, sumFunc = quantile,
probs = 0.99)
lowerTrim3(-10:20, trimBelow = 0, trim = 0.1)
The results should be 1.58, 19.8, and 10.5.
In: Computer Science
In: Psychology
Silver Company makes a product that is very popular as a Mother’s Day gift. Thus, peak sales occur in May of each year, as shown in the company’s sales budget for the second quarter given below:
| April | May | June | Total | |
| Budgeted sales (all on account) | $300,000 | $500,000 | $200,000 | $1,000,000 |
From past experience, the company has learned that 20% of a month’s sales are collected in the month of sale, another 70% are collected in the month following sale, and the remaining 10% are collected in the second month following sale. Bad debts are negligible and can be ignored. February sales totaled $230,000, and March sales totaled $260,000.
Required:
1. Prepare a schedule of expected cash collections from sales, by month and in total, for the second quarter.
2. What is the accounts receivable balance on June 30th?
In: Accounting
In: Computer Science
For Problems 1–4, using the STORES Database, formulate SQL queries, Hand in a listing of each query and its output.
1. (10 Points) For each customer, list each stock item ordered, the manufacturer, the quantity ordered, and the total price paid. Include the following columns in the order given below:
From Customer Table: Company
From Stock Table: Description
From the Manufact Table: Manu_Name
From the Items Table: Quantity, Total Price
Order the output by Company and Description.
2. (10 Points) List all orders with a shipping date between December 25, 1999 and January 5, 2000. List the Order Number, Order Date, Customer company name, and Shipping Date. Order by Customer Company Name and Order Number.
3. (10 Points) Count the number of customers who do not have any orders placed.
4. (10 Points) List all customers who are ordering equipment whose description begins with ‘tennis’ or ‘volleyball’. List the Customer number, Stock number, and Description. Do not repeat any rows.
5. (15 Points) Use the following SQL CREATE commands to CREATE the following tables in your
User ID:
CREATE TABLE Professor
(Prof_ID NUMBER(3) Constraint pk_Professor Primary Key,
Prof_Lname VARCHAR2(15) NOT NULL,
Prof_Hiredate DATE,
Prof_Sal NUMBER(8,2),
Prof_Dept CHAR(6)
);
CREATE TABLE Student
(Stu_ID NUMBER(4) Constraint pk_Student Primary Key,
Stu_Lname VARCHAR2(15) NOT NULL,
Stu_Major CHAR(6),
Stu_CredHrs NUMBER(4),
Stu_GradePts NUMBER(5),
Prof_ID NUMBER(3),
CONSTRAINT fk_Student_Prof_ID FOREIGN KEY(Prof_ID)
REFERENCES Professor
);
Hand in: Print out of the Create commands, the system response and a DESCRIBE of the tables.
6. (15 Points) Insert the following data into the tables created above using SQL INSERT commands.
Professor Table:
|
Prof_ID |
Prof_Lname |
Prof_Hiredate |
Prof_Sal |
Prof_Dept |
|
123 |
Hilbert |
20-MAY-1992 |
58000.00 |
MATH |
|
243 |
Newell |
15-JUL-1997 |
65500.00 |
CMPSCI |
|
389 |
Lessing |
04-APR-1988 |
40250.00 |
ENG |
Student Table:
|
Stu_ID |
Stu_Lname |
Stu_Major |
Stu_CredHrs |
Stu_GradePts |
Prof_ID |
|
2001 |
Parker |
CMPSCI |
52 |
160 |
243 |
|
2166 |
Smith |
ENG |
30 |
75 |
389 |
|
3200 |
Garcia |
MATH |
62 |
248 |
123 |
|
4520 |
Smith |
CMPSCI |
45 |
157 |
NULL |
In: Computer Science