Write a method that displays every other element of an array.
Write a program that generates 100 random integers between 0 and 9 and displays the count for each number. (Hint: Use an array of ten integers, say counts, to store the counts for the number of 0s, 1s, . . . , 9s.)
Write two overloaded methods that return the average of an array with the following headers:
public static int average(int[] intArray)
public static double average(double[] dArray)
Also, write a test program that prompts the user to enter ten double values, invokes the correct method, and displays the average value.
Given this array, write the code to find the smallest value in it:
int[] myList = new myList[n];
In: Computer Science
UNIX
1. Compile and run shell0.c file
2. Design and implement shell1.c program to handle "exit"
command to terminate the program.
That is, if the user input-string is "exit", then the program
terminates.
3.Design and Implement shell2.c to implement a signal handler to handle ctrl+C (SIGINT) as listed below
void sig_int(int signo) { printf("\nCaught SIGINT!\n"); }
Here is shell0.c file
shell0.c
/* * shell0.c * running in loop to read input string (command) to be processed * To exit, type EOF (ctlr+D) or ctlr+C */ #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> #include <unistd.h> char *getinput(char *buffer, size_t buflen) { printf("$$ "); return fgets(buffer, buflen, stdin); } int main(int argc, char **argv) { char buf[1024]; pid_t pid; int status; while (getinput(buf, sizeof(buf))) { buf[strlen(buf) - 1] = '\0'; if((pid=fork()) == -1) { fprintf(stderr, "shell: can't fork: %s\n", strerror(errno)); continue; } else if (pid == 0) { /* child */ execlp(buf, buf, (char *)0); fprintf(stderr, "shell: couldn't exec %s: %s\n", buf, strerror(errno)); exit(EX_DATAERR); } if ((pid=waitpid(pid, &status, 0)) < 0) fprintf(stderr, "shell: waitpid error: %s\n", strerror(errno)); } exit(EX_OK); }
In: Computer Science
In: Computer Science
A certain weak acid, HA, with a Ka value of 5.61×10−6, is titrated with NaOH.
A solution is made by titrating 8.00 mmol (millimoles) of HA and 1.00 mmol of the strong base. What is the resulting pH?
More strong base is added until the equivalence point is reached. What is the pH of this solution at the equivalence point if the total volume is 46.0 mL ?
No idea how to do this! Please explain..thanks!
In: Chemistry
Java
Q1: Create a class named Triangle, the class must contain:
Q2: Write a Java program that creates a two-dimensional array of type integer of size x by y (x and y must be entered by the user). The program must fill the array with random numbers from 1 to 100. The program must prompt the user to enter a search key between 1 and 100. Then, the program must check whether the search key is available in the array and print its location.
Here is a sample run:
Enter the number of rows: 5
Enter the number of columns: 5
Enter a search key between 1-100: 27
The key you entered is available at row 3, column 2.
Here is another sample run:
Enter the number of rows: 5
Enter the number of columns: 5
Enter a search key between 1-100: 33
The key you entered is not available in the array.
In: Computer Science
In: Computer Science
In: Operations Management
In December 2016, Learer Company’s manager estimated next year’s
total direct labor cost assuming 30 persons working an average of
2,500 hours each at an average wage rate of $30 per hour. The
manager also estimated the following manufacturing overhead costs
for 2017.
Indirect labor | $ | 323,200 | |
Factory supervision | 262,000 | ||
Rent on factory building | 144,000 | ||
Factory utilities | 92,000 | ||
Factory insurance expired | 72,000 | ||
Depreciation—Factory equipment | 280,000 | ||
Repairs expense—Factory equipment | 64,000 | ||
Factory supplies used | 72,800 | ||
Miscellaneous production costs | 40,000 | ||
Total estimated overhead costs | $ | 1,350,000 | |
At the end of 2017, records show the company incurred $1,566,000 of
actual overhead costs. It completed and sold five jobs with the
following direct labor costs: Job 201, $608,000; Job 202, $567,000;
Job 203, $302,000; Job 204, $720,000; and Job 205, $318,000. In
addition, Job 206 is in process at the end of 2017 and had been
charged $21,000 for direct labor. No jobs were in process at the
end of 2016. The company’s predetermined overhead rate is based on
direct labor cost.
Required
1-a. Determine the predetermined overhead rate for
2017.
1-b. Determine the total overhead cost applied to
each of the six jobs during 2017.
1-c. Determine the over- or underapplied overhead
at year-end 2017.
2. Assuming that any over- or underapplied
overhead is not material, prepare the adjusting entry to allocate
any over- or underapplied overhead to Cost of Goods Sold at the end
of 2017.
In: Accounting
NCAA
Please provide a citation for each response; you can not simply cite the textbook because textbook have many contributors.
In: Operations Management
Design a multiplexed communication system that can be used for 1 of 4 senders (sources) to send 3 bits to 1 of 2 receivers (destinations) using a 3-bit 4×1 multiplexer and a 2-bit 1×2 demultiplexer. Assume that the most significant of the 3 bits denotes the header containing the destination ID and that the 2 less significant bits denote the message. Represent both the 3-bit 4×1 multiplexer and a 2-bit 1×2 demultiplexer using block diagrams with all inputs and outputs labeled. Show which outputs of the multiplexer connect to which inputs of the demultiplexer!
In: Computer Science
After paying $3 million for a feasibility study, Stanley wrote a proposal with the following cash flow estimates for a 25-year capital project.
Equipment cost: $34 million, Shipping costs: $1 million, Installation: $19 million, Salvage: $4, Working capital investment: $2 million, Revenues are expected to increase by $20 million per year and cash operating expenses by $9 million per year.
The firm’s marginal tax rate is 40 percent, its weighted average cost of capital is 9%, and the firm requires a 3 year payback. Assume straight-line depreciation.
Evaluate the project using NPV, IRR, PI, and PB.
Answers:
IO = $56 million
Δ D = $2 million
NCF1-25 = $7.4 million
NCF25 = $6 million
NPV = $17.38 million > 0, so Accept
IRR = 12.60% > 9%, so Accept
PI = 1.31 > 1, so Accept
PB = 7.57 years > 3 so Reject
ACCEPT the project
Please show work and formula while avoiding Excel/spreadsheet programs. Thank you
In: Finance
Draw an ER diagram and write a database design outline for the following prompt:
You run a coaching service to help high school students prepare for the SAT exam. You have a staff of coaches, each of which has an employee ID, an hourly rate (such as $20 per hour), and personal information consisting of their first name, last name, middle name/initial, address information, phone number, mobile phone number, and e-mail address. For each high school student, you want to keep similar personal information and a student ID number, date of birth, and expected date of graduation from high school. Coaching takes place in sessions, to each of which you assign a unique ID number. Each session consists of one coach and one student. In addition to being able to identify the coach and student involved in each session, you want to store its start date/time and end date/time.
In: Computer Science
Using the seven primary characteristics that capture an organization’s culture, list each and what you see Macomb Community College doing in each from a student view, to create the organization’s culture. Please be sure to give examples. here is the following characteristics.
1- Innovation and risk taking, which is the degree to which employees are encouraged to be both innovative and take risks.
2- Attention to detail, or the degree to which employees are expected to exhibit precision, analysis, and attention to detail.
3- Outcome orientation, or the degree to which management focuses on results rather than on processes used to achieve them.
4- People orientation, the degree to which management decisions consider the effect of outcomes on people within the organization.
5- Team orientation, described as the degree to which work activities are organized around teamsrather than individuals.
6- Aggressiveness, or the degree to which people are aggressive and competitive.
7- Stability, or the degree to which activities emphasize maintaining the status quo.
In: Operations Management
NOK Plastics is considering the acquisition of a new plastic injection-molding machine to make a line of plastic fittings. The cost of the machine and dies is $125,000. Shipping and installation is another $8,000. NOK estimates it will need a $10,000 investment in net working capital initially, which will be recovered at the end of the life of the equipment. Sales of the new plastic fittings are expected to be $350,000 annually. Cost of goods sold are expected to be 50% of sales. Additional operating expenses are projected to be $115,000 per year over the machine’s expected 5-year useful life. The machine will depreciated using a 5-year MACRS class life. The equipment will be sold at the end of its useful life (5 years) for $35,000. The tax rate is 25% and the relevant discount rate is 15%. Calculate the net present value (NPV), internal rate of return (IRR), payback period (PB), and profitability index (PI) and state whether the project should be accepted.
Please explain how you get After-tax Salvage Value
In: Finance
A ground state hydrogen atom absorbs a photon of λ = 94.91 nm, exciting the electron to a higher energy (quantum) level. The electron then decays to a lower, intermediate energy level, emitting a photon of λ = 1281 nm. From that intermediate energy level the electron decays back to the ground state, emitting another photon. a) What is the highest energy level attained by the electron?
b) What was the intermediate energy level of the electron?
c) What was the λ of the second photon?
In: Chemistry