Explain how to use a Scanner object to read
information from a page on the internet. Give an example.
Explain what a wrapper classes are and how they are used in
Java. Give an example.
What is an ArrayList object? How does is it
similar to and how does it differ from a traditional
array.
What is inheritance? How is it useful in software projects. How
is the is-a test related to inheritance?
What is an exception? Explain how to use try/catch blocks to
prevent a program from crashing.
What is refactoring? What are some of the ways that Eclipse can
help you with refactoring?
What is the output? Explain how you obtain this answer by hand, not using a computer.
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for(int i = 1; i <= 26; i *= 2) {
System.out.print(alphabet.charAt(i - 1));
}
What is the output? Explain how you obtain this answer by hand, not using a computer.
int n = 500;
int count = 0;
while (n > 1) {
if (n % 2 == 0) {
n /= 3;
}
else {
n /= 2;
}
count++;
}
System.out.println(count);
A Java Swing application contains this paintComponent method for a panel. Sketch what is drawn by this method.
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.black);
g.fillRect(100, 100, 200, 100);
g.fillRect(300, 200, 200, 100);
g.fillRect(500, 100, 200, 100);
}
In: Computer Science
An aqueous solution of magnesium oxalate is prepared by
dissolving 4.46 g of magnesium oxalate in 1.51×102 g of
water. The density of the solution is 1.01 g mL-1.
a) Determine the mass percent of magnesium oxalate in the
solution.
b) Determine the mole fraction of magnesium oxalate in the
solution.
An aqueous solution of nickel(II) chloride is prepared by
dissolving 5.61 g of nickel(II) chloride in 4.53×102 g
of water. The density of the solution is 1.34 g
mL-1.
Determine the molarity (in mol/L) of nickel(II) chloride in the
solution.
In: Chemistry
Freight Terms
Determine the amount to be paid in full settlement of each of two invoices, (a) and (b), assuming that credit for returns and allowances was received prior to payment and that all invoices were paid within the discount period. If required, round the answers to the nearest dollar.
| Merchandise | Freight Paid by Seller |
Freight Terms | Returns and Allowances |
|||||
| a. | $8,200 | $300 | FOB destination, 1/10, n/30 | $1,600 | ||||
| b. | 3,400 | 600 | FOB shipping point, 2/10, n/30 | 900 | ||||
| a. | $fill in the blank 1 |
| b. | $fill in the blank 2 |
In: Accounting
a)At a distance of 0.216cm from the center of a charged conducting sphere with radius 0.100cm, the electric field is 440N/C . What is the electric field 0.604cm from the center of the sphere?
b)At a distance of 0.216cm from the axis of a very long charged conducting cylinder with radius 0.100cm, the electric field is 440N/C . What is the electric field 0.608cm from the axis of the cylinder?
c)At a distance of 0.180cm from a large uniform sheet of charge, the electric field is 440N/C . What is the electric field 1.23cm from the sheet?
In: Physics
With reference to Sweezy’s model of the kinked demand curve, explain the reasons why we might expect price to be unresponsive to small variations in cost in the case of oligopoly. What are the main limitations of the kinked demand curve model?
b. Quote real world examples of oligopolistic firms that have benefited from a first-mover advantage.
In: Economics
Companies are expected to act ethically and ensure their employees are also acting ethically. However, as we know the level of ethics expected and those practiced are not always the same. Take a moment to share your thoughts on the following questions about ethics.
In: Economics
A convergent-divergent nozzle operates under out-of-design
conditions, resulting in
formation of a normal shock wave in the diverging section. A large
reservoir
supplies air to the nozzle at 400 kPa and 800 K. The throat of the
nozzle is 0.2 m2. The number
Mach upstream of the shock wave is M1 = 2.44. The nozzle area at
the exit is
0.7 m2. Calculate the area of the nozzle at the location of the
shock wave and the temperature of the
air when leaving the nozzle
In: Mechanical Engineering
JAVA
Personal Information Class
Design a class that hold the personal data: name, address, age and phone number. Write appropriate methods (constructor, getters ad setters. Demonstrate the class by writing a program that creates three instances of the class. You can populate information in each object using Scanner class.
In: Computer Science
Sauer Food Company has decided to buy a new computer system with
an expected life of three years. The cost is $430,000. The company
can borrow $430,000 for three years at 13 percent annual interest
or for one year at 11 percent annual interest. Assume interest is
paid in full at the end of each year.
a. How much would Sauer Food Company save in
interest over the three-year life of the computer system if the
one-year loan is utilized and the loan is rolled over (reborrowed)
each year at the same 11 percent rate? Compare this to the 13
percent three-year loan.
b. What if interest rates on the 11 percent loan
go up to 16 percent in year 2 and 19 percent in year 3? What would
be the total interest cost compared to the 13 percent, three-year
loan?
In: Finance
I am a physics undergrad and thinking of exploring quantum information theory. I had a look at some books in my college library. What area in QIT, is the most mathematically challenging and rigorous? From what I saw in the books, most topics was just simple linear algebra. I am looking for an area which is mathematically more rich, and uses maybe more concepts from theoretical computer science, number theory, discrete maths, algebra etc. Classical cryptography is an area on the interface of maths and TCS which uses many areas of maths such as number theory, algebra, ellptical curves. Is the quantum cryptography also rich in mathematics? What are the prerequisites? If not, please could you suggest some areas that I are mathematically rich in QIT?
In: Physics
java - Write a method that sums all the numbers in the major diagonal in an n x n matrix of double values using the following header:
public static double sumMajorDiagonal(double [][]
m)
Write a test program that first prompts the user to enter the
dimension n of an n x n matrix, then asks them to enter the matrix
row by row (with the elements separated by spaces). The program
should then print out the sum of the major diagonal of the
matrix.
SAMPLE RUN:
Enter dimension n of nxn matrix:Enter row·0:Enter row 1:Enter·row 2:Enter row 3:17.1
(can have 3 or 4 rows)
In: Computer Science
Present Values
Use Present Value Tables or your calculator to complete the requirements below.
You have an opportunity to purchase a government security that will pay $217,000 in 5 years.
Required:
Round your answers to the nearest cent, if rounding is required.
1. Calculate what you would pay for the
security if the appropriate interest (discount) rate is 6%
compounded annually.
$
2. Calculate what you would pay for the
security if the appropriate interest (discount) rate is 10%
compounded annually.
$
3. Calculate what you would pay for the
security if the appropriate interest (discount) rate is 6%
compounded semiannually.
$
In: Accounting
Tasman Products, Ltd., of Australia has a Maintenance Department that services the equipment in the company’s Forming Department and Assembly Department. The cost of this servicing is charged to the operating departments on the basis of machine-hours. Cost and other data relating to the Maintenance Department and to the other two departments for the most recent year are presented below. Data for the Maintenance Department follow: Budget Actual Variable costs for lubricants $ 331,800 * $ 425,340 Fixed costs for salaries and other $ 204,000 $ 219,400 *Budgeted at $21 per machine-hour. Data for the Forming and Assembly Departments follow: Percentage of Peak-Period Capacity Required Machine-Hours Budget Actual Forming Department 75% 10,500 12,500 Assembly Department 25% 5,300 4,300 Total 100% 15,800 16,800 The level of fixed costs in the Maintenance Department is determined by peak-period requirements. Required: Management would like data to assist in comparing actual performance to planned performance in the Maintenance Department and in the other departments. 1. How much Maintenance Department cost should be charged to the Forming Department and to the Assembly Department? 2. How much, if any, of the actual Maintenance Department costs for the year should be treated as a spending variance and not charged to the Forming and Assembly departments?
In: Accounting
A stone is catapulted at time t = 0, with an initial velocity of magnitude 24.0 m/s and at an angle of 46.0° above the horizontal. (Neglect air resistance.) Find its horizontal and vertical displacements from the catapult site at the following times after launch.
(a) 0.80 s
m (horizontal)
m (vertical)
(b) 1.80 s
m (horizontal)
m (vertical)
(c) 3.53 s
m (horizontal)
m (vertical)
In: Physics