Write a function called randFill that fills the entries of an array with random integers in the range from 10 to 99 (inclusive). (You should use a standard Java method to generate the values. Your solution should use no more than 6 lines of code.) For example, a program that uses the function randFill follows.
public class P4 {
public static void main(String args[]) {
int x[]; x = randFill(5);
for (int i = 0; i < 5; i++)
System.out.print(x[i] + " "); // prints 5 random numbers
System.out.println(); // such as 93 73 12 69 40
}
}
In: Computer Science
public class P2 {
public static int F(int x[], int c) {
if (c < 3) return 0; return x[c - 1] + F(x, c - 1);
}
public static int G(int a, int b) {
b = b - a;
a = b + a;
return a;
}
public static void main(String args[]) {
int a = 4, b = 1;
int x[] = { 3, 1, 4, 1, 5 };
String s = "Problem Number 2";
System.out.println(x[2 + 2] + x[2]); // line (a)
System.out.println(s.substring(2, 3)); // line (b)
System.out.println(s.substring(s.indexOf("b"))); // line (c)
System.out.println("" + G(b, a) + a + b); // line (d)
System.out.println(F(x, 5)); // line (e)
}
}
(a) What is the output at line (a)?
Answer:
(b) What is the output at line (b)?
Answer:
(c) What is the output at line (c)? Answer:
(d) What is the output at line (d)? Answer:
(e) What is the output at line (e)? Answer:
In: Computer Science
Discuss the concept of relating rewards to performance. Should companies base rewards to performance only? What might be the consequences – good and bad if all rewards were tied to performance? Should group performance also be part of the rewards received? What might be the pros and cons of group rewards?
In: Operations Management
This is a networking essentials class. I need the correct answer.
Which of the following allows data to transmit more quickly from node to node on a network?
Simplex |
||
Half duplex |
||
Full duplex |
||
No difference |
In: Computer Science
Research and answer the following questions:
Your Discussion posts should be a minimum of 250 words in length and not more than 750 words. Use APA citations and references for the textbook and any other sources used.
In: Operations Management
Crimson Tide Company uses a job-order costing system. At Crimson Tide, overhead costs are applied to jobs on the basis of machine-hours.
For the current year, Crimson Tide estimated that its machines would work for a total of 26,000 machine-hours. Tide also estimated for the current year that it would incur $124,800 in manufacturing overhead cost.
The following transactions occurred during the year:
a. Raw materials requisitioned for use in production, $300,000 (80% direct and 20% indirect).
b. The following costs were incurred for employee services:
Direct labor | $ | 171,000 | |
Indirect labor | $ | 29,000 | |
Sales commissions | $ | 21,000 | |
Administrative salaries | $ | 36,000 | |
|
c. Total insurance costs were $21,000 Note: Of the total insurance cost, 90% relates to factory operations, and 10% relates to selling and administrative activities.
d. In the factory only, heat, power, and water costs incurred in the factory totalled $60,000.
e. Total depreciation recorded for the year was $71,000 Note: Of the total depreciation recorded 85% relates to factory operations, and 15% relates to selling and administrative activities.
f. Advertising costs incurred was $61,000.
g. According to their job cost sheets, goods that cost $491,000 to manufacture were transferred to the finished goods warehouse.
h. Sales for the year totaled $722,000. The total cost to manufacture these goods according to their job cost sheets was $486,000.
i. The company actually used 51,000 machine-hours during the year.
Required:
1. Determine the underapplied or overapplied overhead for the year. (Round predetermined overhead rate to 2 decimal places.).
2. Prepare an income statement for the year. (Hint: No calculations are required to determine the cost of goods sold before any adjustment for underapplied or overapplied overhead.) (Round predetermined overhead rate to 2 decimal places.)
In: Accounting
Assume that you purchased a share of the Company at the beginning of 2018 for $54.58. One year later the stock was worth $53.53, but during 2018 you received a cash dividend of $2.32
Calculate the following:
1. Income
2. Capital gain (loss)
3. Total return – a. in dollars; b. as a percent
In: Finance
heat transfer question, show equations, assumptions, calculations and steps clearly. will give thumbs up rating if solved correctly in 50 minutes
part a:
What is the Lumped Capacitance Method, what does it assume, and for which criteria is it valid?
part b:
When part of a system is perfectly insulated, how do we translate this mathematically as a boundary condition?
part c:
State three important assumptions that must be respected for the thermal resistance concept to be valid in a plane wall.
In: Mechanical Engineering
Give an example of a program that uses the nongeneric version of a class from the STL and the equivalent program that uses the generic version. How do the two implementations differ? Why is having the syntax of generics better?
In: Computer Science
Consider the natural join of the relation R(A,B) and S(A,C) on attribute A. Neither relations have any indexes built on them. Assume that R and S have 80,000 and 20,000 blocks, respectively. The cost of a join is the number of its block I/Os accesses. If the algorithms need to sort the relations, they must use two-pass multi-way merge sort.
QUESTION:
Assume that there are 10 blocks available in the main memory. What is the fastest join algorithm for computing the join of R and S? What is the cost of this algorithm?
In: Advanced Math
Recursion is a technique for breaking down a complex problem into smaller pieces and then combining the results to obtain the desired answer. The most common example of recursion is calculating factorials. Describe another problem that can be solved using recursion and outline the approach using Java or Pseudo-Code. Discuss the Big-Oh run time performance of your example. (Make sure to use your own words – do not cut and paste someone else's solution.)
In: Computer Science
In 100 words describe Two Kinds “by Amy Tan. Please Type
1. Why do you think the narrator’s mother wanted to live the “American Dream” and leave her family and home in China?
2 Why is so much pressure put on the narrator? 3 Do we also put to much pressure on our kids?
In: Psychology
Gilbert Moss and Angela Pasaic spent several summers during
their college years working at archaeological sites in the
Southwest. While at those digs, they learned how to make ceramic
tiles from local artisans. After college they made use of their
college experiences to start a tile manufacturing firm called
Mossaic Tiles, Ltd. They opened their plant in New Mexico, where
they would have convenient access to a special clay they intend to
use to make a clay derivative for their tiles. Their manufacturing
operation consists of a few relatively simple but precarious steps,
including molding the tiles, baking, and glazing. Gilbert and
Angela plan to produce two basic types of tile for use in home
bathrooms, kitchens, sunrooms, and laundry rooms. The two types of
tile are a larger, single-colored tile and a smaller, patterned
tile. In the manufacturing process, the color or pattern is added
before a tile is glazed. Either a single color is sprayed over the
top of a baked set of tiles or a stenciled pattern is sprayed on
the top of a baked set of tiles. The tiles are produced in batches
of 100. The first step is to pour the clay derivative into
specially constructed molds. It takes 18 minutes to mold a batch of
100 larger tiles and 15 minutes to build a mold for a batch of 100
smaller tiles. The company has 60 hours available each week for
molding. After the tiles are molded, they are baked in a kiln: 0.27
hour for a batch of 100 larger tiles and 0.58 hour for a batch of
100 smaller tiles. The company has 105 hours available each week
for baking. After baking, the tiles are either colored or patterned
and glazed. This process takes 0.16 hour for a batch of 100 larger
tiles and 0.20 hour for a batch of 100 smaller tiles. Forty hours
are available each week for the glazing process. Each batch of 100
large tiles requires 32.8 pounds of the clay derivative to produce,
whereas each batch of smaller tiles requires 20 pounds. The company
has 6,000 pounds of the clay derivative available each week.
Mossaic Tiles earns a profit of $190 for each batch of 100 of the
larger tiles and $240 for each batch of 100 smaller patterned
tiles. Angela and Gilbert want to know how many batches of each
type of tile to produce each week to maximize profit. In addition,
they have some questions about resource usage they would like
answered.
k. The kiln for glazing had to be shut down for 3 hours, reducing the available kiln hours from 40 to 37. What effect will this have on the solution? l. What are the reduced costs for larger and smaller tiles? Explain.
I don’t know how to do part l
In: Operations Management
2. Find the optimal allocation of demand to production facilities for the data given in the following table. (Hint: Use the model for allocating demand to existing facilities. First, formulate the problem and then use Excel Solver to find the optimal results.)
Supply Location |
Demand Location |
Monthly Capacity (Ki) |
||
Production and Transportation Cost ($per unit) |
||||
1 |
2 |
3 |
||
1 |
2.0 |
1.0 |
1.7 |
17,000 |
2 |
0.9 |
2.0 |
1.3 |
20,000 |
3 |
1.8 |
2.4 |
1.6 |
29,000 |
Monthly Demand (Dj) |
11,000 |
8,500 |
15,00 |
In: Operations Management
Write an inline assembly program that initializes a 100 byte area of memory to 0xFF using the STOS instruction with REP using DWORD transfers.
In: Computer Science