Step 1: Create a new Java project named ContainerPartyProject
---------
Step 2: Add a ContainerParty class to your project. It should contain:
- The date of the party
- A list of people attending
- A list of containers at the party
- The address of the party (this can be either a String or a Class)
---------
Step 3: Add a Container class in your project. It should be an abstract class. Your Container class must be properly encapsulated and include the following attributes:
In addition to a constructor that allows you to set all of these values, it should include a getInfo() method and an abstract calculateVolume() method.
---------
Step 4: Add a CircularContainer class to your project. Your CircularContainer must be a subclass of your Container class. In addition to the attributes that it inherits from Container, CircularContainer should add the following attributes:
It should include a getInfo() method and a calculateVolume() method that override the versions of these methods from your parent class. You may use the following formula for volume:
volume=π⋅radius2⋅height
---------
Step 5: Add a RectangularContainer class to your project. Your RectangularContainer must be a subclass of your Container class. In addition to the attributes that it inherits from Container, RectangularContainer should add the following attributes:
It should include a getInfo() method and a calculateVolume() method that override the versions of these methods from your parent class. You may use the following formula for volume:
volume=length⋅width⋅height
Important: In steps 3 and 4, your getInfo() methods must use the super keyword to leverage the getInfo() method of its superclass (Container). Remember DRY - Don’t Repeat Yourself! You should not unnecessarily duplicate any code between getInfo() in your subclass and superclass!
---------
Step 6: Create a Person class with 3 attributes of your choice. Create attributes, methods, and constructors as necessary to complete the assignment.
---------
In: Computer Science
Given the following code, what is output by the method call, mystery(6 * 8)?
public static void mystery (int x[]) {
System.out.println("A");
}
public static void mystery (int x) {
System.out.println("B");
}
public static void mystery (String x) {
System.out.println("C");
}
A
B
C
CA
CB
Which of the following is true about overloaded methods?
Java cannot use a method's return type to tell two overloaded methods apart.
Java cannot use a method's parameters to tell two overloaded methods apart.
You can only overload methods that have parameters.
All overloaded methods must have different names.
None of the above
Given the following code, what is output by the method call, mystery (5, 7.0015)?
public static void mystery (int a) {
System.out.println("A");
}
public static void mystery (double a) {
System.out.println("B");
}
public static void mystery (int a, double b) {
System.out.println("C");
}
public static void mystery (double a, int b) {
System.out.println("D");
}
A
B
C
D
Nothing is printed - there is an error.
Consider the following methods:
public static double doStuff(int a) {
return a/2;
}
public static double doStuff(double val) {
return val/10;
}
What is output by the following?
System.out.println(doStuff(5) + doStuff(5.0));
2.00.5
2.50.5
22.5
2.5
5
What is output to the screen by the following code?
System.out.println("Sum=" + 4 + 5);
Sum= 5 4
Sum=45
Sum=9
Sum= 4 5
Sum=54
What is output to the screen by the following code?
System.out.print(21/5);
3.5
4
4.2
5
5.5
Consider the following three classes: Clothing, Socks, and Sweater. Which would you choose be an abstract class?
Clothing
Socks
Sweater
Socks and Sweater
all of the above
Which of the following keywords allows a child class to access the overridden methods in a parent class?
extends
new
super
this
None of the above
Questions 9 and 10 refer to the following code:
public abstract class Phone {
abstract void
dial();
}
public class MobilePhone extends Phone {
}
public class RotaryPhone extends Phone {
public void dial () {
//code not
shown
}
}
Which of the following statements is true?
RotaryPhone can be instantiated.
MobilePhone can be instantiated.
RotaryPhone cannot be instantiated.
Neither can be instantiated since you cannot extend an abstract class.
Neither can be instantiated since they do not include constructors.
Which of the following statements is true?
A Phone object can access methods in MobilePhone.
A RotaryPhone object can access methods in MobilePhone.
RotaryPhone inherits from Phone and MobilePhone.
RotaryPhone inherits from Phone.
None of the above.
Suppose a class implements the Comparable interface. Which of the following methods must the class include?
length
charAt
substring
indexOf
compareTo
Questions 12-14 refer to the following:
public class A {
public A () {
System.out.print(“one
”);
}
public A (int z) {
System.out.print(“two
”);
}
public void doStuff() {
System.out.print(“six
”);
}
}
public class B extends A {
public B () {
super ();
System.out.print(“three
”);
}
public B (int val) {
super (val);
System.out.print(“four
”);
}
}
What is printed when the following line of code is executed?
B b = new B();
one three
two four
four two
three two
one four
What is printed when the following line of code is executed?
A a = new B(5);
four
two four
one
two
four one
Assume that variable b has been instantiated as a B object. What is printed when the following line of code is executed?
b.doStuff();
six
four
five
two
three
Which of the following is true about interfaces:
All methods in an interface must be abstract.
A class can only implement one interface.
An interface can have only non abstract methods.
Can not contain constants but can have variables.
None of the above.
What is the rule for a super reference in a constructor?
It must be in the parent class' constructor.
It must be the last line of the constructor in the child class.
It must be the first line of the constructor in the child class.
Only one child class can use it.
You cannot use super in a constructor.
Consider the following class definition.
public class WhatsIt {
private int length;
private int width;
public int getArea () {
// implementation
not shown
}
private int getPerimeter () {
// implementation
not shown
}
}
A child class Thingy that extends WhatsIt would have access to:
getArea()
getPerimeter()
width, length, getPerimeter()
width, length, getArea()
all of the above
Questions 18 - 20 pertain to the following class, Point:
public class Point {
private double x;
private double y;
public Point() {
this (0, 0);
}
public Point(double a, double b) {
/* missing code
*/
}
// ... other methods not shown
}
Which of the following correctly implements the equals method?
public boolean equals(Point p) {
return (x == Point.x && y ==
Point.y);
}
public void equals(Point p) {
System.out.println(x == p.x && y ==
p.y);
}
public boolean equals(Point p) {
System.out.println(x == p.x && y ==
p.y);
}
public boolean equals(Point p) {
return (x == p.x && y == p.y
);
}
public void equals(Point p) {
return (x == p.x && y == p.y
);
}
The default constructor sets x and y to (0, 0) by calling the second constructor. What could be used to replace /* missing code */ so that this works as intended?
a = 0;
b = 0;
this(0, 0);
this (x, y);
a = x;
b = y;
x = a;
y = b;
Which of the following correctly implements a mutator method for Point?
public double getX() {
return x;
}
public double getX() {
return a;
}
public void setCoordinates (double a, double b) {
x = a;
y = b;
}
public void setCoordinates (double a, double b) {
Point p = new Point(a,b);
}
None of the above
In: Computer Science
According to a Statistics Canada study from 2008: about 29% of women aged 18 to 24 engage in heavy drinking. (It is 47% for males.) The standard definition of heavy drinking is consuming 5 or more drinks on one occasion, 12 or more times over the past year. Assuming this to be true, if we choose a woman in this age group at random there is a probability of 0.29 of getting a heavy drinker. We can use software to simulate choosing random samples of women. (In most software, the key phrase to look for is “Binomial” This is the technical term for independent trials with “Yes/No” outcomes. Our outcomes here are “Heavy drinker” and “Not.”) a. Simulate 100 draws of 20 women and make a histogram of the percents who are heavy drinkers. Describe the shape, centre, and spread of this distribution. b. Simulate 100 draws of 500 women and make a histogram of the percents who are heavy drinkers. Describe the shape, centre, and spread of this distribution. c. In what ways are the distributions in parts (a) and (b) similar? In what ways do they differ? (Be sure to mention shape, location and spread.)
In: Statistics and Probability
The comparative balance sheets of Maynard Movie Theater Company at June 30, 2018 and 2017, reported the following:
|
June 30, |
||||
|
2018 |
2017 |
|||
|
Current assets: |
||||
|
Cash and cash equivalents |
$18,700 |
$15,000 |
||
|
Accounts receivable |
14,600 |
21,500 |
||
|
Inventories |
63,300 |
60,800 |
||
|
Prepaid expenses |
17,200 |
2,800 |
||
|
Current liabilities: |
||||
|
Accounts payable |
$57,900 |
$55,900 |
||
|
Accrued liabilities |
36,900 |
16,900 |
||
|
Income tax payable |
15,100 |
10,100 |
||
|
Acquisition of land |
Proceeds from sale of long- |
||||||
|
by issuing note payable |
$104,000 |
term investment. . . . . . |
$13,400 |
||||
|
Amortization expense. . . . . . . . |
4,300 |
Depreciation expense. . . . . . . |
16,000 |
||||
|
Payment of cash dividend. . . . |
41,000 |
Cash purchase of building. . . |
41,000 |
||||
|
Cash purchase of |
Net income. . . . . . . . . . . . . . . . |
25,000 |
|||||
|
equipment. . . . . . . . . . . . . |
50,000 |
Issuance of common |
|||||
|
Issuance of long-term note |
stock for cash. . . . . . . . |
17,000 |
|||||
|
payable to borrow cash |
43,000 |
Stock dividend. . . . . . . . . . . . . |
10,000 |
||||
1.
Prepare Maynard Movie Theater Company's statement of cash flows
for the year ended June 30, 2018, using the indirect method to
report cash flows from operating activities. Report noncash
investing and financing activities in an accompanying
schedule.
2.
Evaluate Maynard's cash flows for the year. Mention all three
categories of cash flows, and give the rationale for your
evaluation.
Requirement 1. Prepare Maynard Movie Theater Company's
statement of cash flows for the year ended June 30, 2018, using
the indirect method to report cash flows from operating activities.
Report noncash investing and financing activities in an
accompanying schedule.
Start by completing the cash flows from operating activities. Then
complete the remaining statement of cash flows and the accompanying
schedule of noncash investing and financing activities. (Use
parentheses or a minus sign for numbers to be subtracted and for a
net decrease in cash.)
|
Maynard Movie Theater Company |
|||
|
Statement of Cash Flows (Indirect Method) |
|||
|
Year Ended June 30, 2018 |
|||
|
Cash flows from operating activities: |
|||
|
Adjustments to reconcile net income to |
|||
|
net cash provided by (used for) operating activities: |
|||
|
Net cash provided by (used for) operating activities |
|||
|
Cash flows from investing activities: |
|||
|
Net cash provided by (used for) investing activities |
|
Cash flows from financing activities: |
|||
|
Net cash provided by (used for) financing activities |
|
Net increase (decrease) in cash |
|||
|
Noncash investing and financing activities: |
|||
Requirement 2. Evaluate Maynard's cash flows for the year.
Mention all three categories of cash flows, and give the rationale
for your evaluation.
Maynard Movie Theater Company's cash flows look
▼
strong
weak
.
▼
Financing activities
Investing activities
Operating activities
are the main source of cash.
Maynard Movie Theater generated a
▼
negative
positive
cash flow from investing activities largely due to the
▼
purchase
sale
of equipment and a building. It generally bodes
▼
poorly
well
for the future when a company invests in new capital assets.
Maynard Movie Theater generated a
▼
negative
positive
cash flow from financing activities. These financing activities
indicate that the Maynard Movie Theater
▼
is considered
is not considered
credit-worthy to be able to issue long-term notes. We also see
that the company has
▼
insufficient
sufficient
funds to pay cash dividends.
In: Accounting
Assume Manchester University wants to make sure, its graduates would find jobs with the highest possible wage during the job search process, because this will help the university to increase its reputation, and as a result, it will be able to increase the tuition rates. How can the university increase the average wage level of their students get after they graduate, assuming it can no longer increase their skill level? I think question is clear there is no neeed extra explanation please feel free to answer question and you can mention about both productivity and equilibrium.
In: Economics
1. Using your understanding of prenatal development, please explain what happens in the process of fertilization with conjoined twins. In your answer, please thoroughly mention and explain what happens to the egg and the sperm from conception to birth, as well as prenatal hazards and negative effects on the developing embryo.
2. In the preoperational stage of Piaget’s cognitive development theory, children experience a limitation to thinking in which they have an inability to see the world through anyone else’s except their own. Identify this term and give a real life example of a child displaying this limitation.
In: Biology
Prove Corollary 4.22: A set of real numbers E is closed and bounded if and only if every infinite subset of E has a point of accumulation that belongs to E.
Use Theorem 4.21: [Bolzano-Weierstrass Property] A set of real numbers is closed and bounded if and only if every sequence of points chosen from the set has a subsequence that converges to a point that belongs to E.
Must use Theorem 4.21 to prove Corollary 4.22 and there should be no mention of closed and bounded in the proof. The proof should start with,
[E closed and bounded] iff [E has the BW Property]
In: Advanced Math
referring to the paper "Recent insights on applications of pullulan in tissue engineering", authored by RS Singh, N Kaur, V Rana, and JF Kennedy. It was published in Carbohydrate Polymers, 2016, 153, 455-462.
Which are the physical traits of pullulan which recommend this polymer for tissue engineering ?
How injured tissues can be repaired with the help of artificially created polymeric scaffolds ?
Please mention few pullulan derivatives and explain why the derivatization was necessary for a particular type of application ?
Which are on your opinion the main challenges related to usage of pullulan in tissue engineering ?
In: Other
23 32 34 26 23 28 38 33 25 29 28
In: Statistics and Probability
While in the grocery store look at the food labels of reduced fat/ fat-free foods and compare them to the original. Compare the Calorie count and sugar content of the reduced fat version to the original version. Report here what you find. Make sure to mention the product and what exactly you found. You just might be surprised. The easiest products to do this with are candy, chips, cakes, and cookies.
The following questions will help you know what to report on. (Was there much a difference in Calories, carbohydrate, protein, between the products? Were the serving sizes different?
In: Nursing