5. (20%) Suppose we have an array int a [8] = {1, 2, 3, 5, 6};
and we also have a linked list L of 5 entries 1 -> 2 -> 3
-> 5 -> 6, where 1 is the first in the linked list L,
followed by 2 etc. We want to put a new item 4 between 3 and 5 in
the array a and in the linked list L
(a) Explain in plain English how you do that in the array a. You
may have to shift items right (or left?) Do you use a loop like a
for loop? You can write some C / C++ / C# / Java code etc. to
convince me, but the code does not have to run.
(b) Explain in plain English how you do that in the linked list L.
How do you change the link from 3 to 5 in the original list L? You
can write some code or pseudo code to convince me.
In: Computer Science
You are provided with an array of Strings and a list of Strings. Sort the elements (1) in natural order, (2) in reverse natural order and (3) by the length of each String. You can fill in the details by using the following stub file:
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Midterm01 {
public static void main(String[] args) {
String[] arrayOfCities = { "Atlanta", "Savannah", "New York", "Dallas", "Rio" };
List<String> listOfCities = Arrays.asList("Atlanta", "Savannah", "New York", "Dallas", "Rio");
System.out.print("\nSorting a String array in natural order...");
// your work here
System.out.print("\nSorting a String array in reverse natural order...");
// your work here
System.out.print("\nSorting a String array by length of the Strings...");
// your work here
System.out.print("\nSorting a String list in natural order...");
// your work here
System.out.print("\nSorting a String list in reverse natural order...");
// your work here
System.out.print("\nSorting a String list by length of Strings...");
// your work here
}
}
In: Computer Science
Using Java. The following is a constructor I need to implement but I am not sure how. It also must pass the Junit test. Please give reasoning while answering.
public class LZWDictionary {
// FIELDS
// map (for ease of checking existence of entries)
// list (ease of recall of an entry)
LinkedHashMap<String, Integer> map;
List<String> list;
/**
* Initializes the LZWDictionary to have an initial set of entries taken from
* the set of unique characters in a provided string
*
*
*
* Unique characters are added to a map as they are encountered in the provided
* input string, with an increasing index value (beginning at index 0). At the same
* time, the characters are added to a list. The indices associated with each
* dictionary entry in the map thus relate to their index (position) in the list
*
*
*
*
* @param characters a string of initial characters that may include duplicates
*
* @throws an IllegalArgumentException if the characters string is empty
*
*/
public LZWDictionary(String characters) {
// NOTE: Complete the accessors getMap() and getList() first before running
// your tester on this ctor
}
Must pass this Junit Test
In: Computer Science
21. BUS 320 Survivor Ms. Elaine Taylor owned a farm. Disgusted with all the foul by-products of farming, Elaine and U.C. Santa Clara graduate, Frank Lee Gullible, negotiated for the sale of Elaine’s 100-acre Sutter County, California farm. On July 3, 2020, the day after excelling on her second BUS 320 midterm, Elaine orally agreed with Mr. Gullible on a price of $100,000, one-half in cash payable at closing and the remainder 90 days later. Two days later on July 4th, Elaine sells the farm to someone twice as oblivious as Mr. Gullible, my really Dumb Cousin, for $200,000. On July 8th, Mr. Gullible sends Elaine a letter in which all the terms are included and is signed by Mr. Gullible. Elaine never responds. When the closing date arrives, Elaine tells Mr. Gullible that she sold the property to my Dumb Cousin. Frank Lee Gullible sues. A court would likely find that:
a. This contract is enforceable because Frank Lee Gullible had partly performed the contract by
sending the letter to the Seller, Elaine.
b. Elaine is a real slick operator and Mr. Gullible should have taken BUS 320 at SFSU because this
contract is unenforceable, there is no writing signed by Elaine and my really Dumb Cousin now owns a farm.
c. This contract is unenforceable because the mirror image rule applies.
d. The contract is enforceable under the res ipsa loquitor doctrine.
ANSWER: __________
In: Operations Management
Required information
Problem 6-10 (Algo) Long-term contract; revenue recognition over time [LO6-8, 6-9]
[The following information applies to the questions
displayed below.]
In 2021, the Westgate Construction Company entered into a contract
to construct a road for Santa Clara County for $10,000,000. The
road was completed in 2023. Information related to the contract is
as follows:
| 2021 | 2022 | 2023 | |||||||
| Cost incurred during the year | $ | 2,044,000 | $ | 2,628,000 | $ | 2,890,800 | |||
| Estimated costs to complete as of year-end | 5,256,000 | 2,628,000 | 0 | ||||||
| Billings during the year | 2,170,000 | 2,502,000 | 5,328,000 | ||||||
| Cash collections during the year | 1,885,000 | 2,600,000 | 5,515,000 | ||||||
Westgate recognizes revenue over time according to percentage of
completion.
Problem 6-10 (Algo) Part 4
4. Calculate the amount of revenue and gross
profit (loss) to be recognized in each of the three years assuming
the following costs incurred and costs to complete information.
(Do not round intermediate calculations and round your
final answers to the nearest whole dollar amount. Loss amounts
should be indicated with a minus sign.)
| 2021 | 2022 | 2023 | |||||||
| Costs incurred during the year | $ | 2,044,000 | $ | 3,885,000 | $ | 3,285,000 | |||
| Estimated costs to complete as of year-end | 5,256,000 | 3,185,000 | 0 | ||||||
Solve for "X"
| 2021 | 2022 | 2023 | |
| Revenue | $2,800,000 | X | X |
| Gross profit (loss) | $756,000 | X | X |
Please show you work, I've tried finding the answers to year 2022 and 2023 but nothing is working
In: Accounting
The Bureau of the Census in the United States attempted to count every U.S. resident. Suppose that the counts in the table are obtained for four counties in one region. (Give all answers to four decimal places.)
| County | Race/Ethnicity | ||||
| Caucasian | Hispanic | Black | Asian | American Indian |
|
| Monterey | 163,000 | 140,000 | 25,000 | 39,000 | 5,000 |
| San Luis Obispo | 190,000 | 38,000 | 7,000 | 9,000 | 3,000 |
| Santa Barbara | 230,000 | 121,000 | 12,000 | 24,000 | 5,000 |
| Ventura | 430,000 | 231,000 | 19,000 | 50,000 | 8,000 |
C. If one Hispanic person is selected at random from this region, what is the estimated probability that the selected individual is from Ventura?
(e) If one person is selected at random from this region, what
is the estimated probability that the person is either Asian or
from San Luis Obispo County?
(f) If one person is selected at random from this region, what is
the estimated probability that the person is Asian or from San Luis
Obispo County but not both?
(g) If two people are selected at random from this region, what is
the estimated probability that both are Caucasians?
(h) If two people are selected at random from this region, what is
the estimated probability that neither is Caucasian?
(i) If two people are selected at random from this region, what is
the estimated probability that exactly one is a Caucasian?
(j) If two people are selected at random from this region, what is
the estimated probability that both are residents of the same
county?
(k) If two people are selected at random from this region, what is
the estimated probability that both are from different
racial/ethnic groups?
In: Statistics and Probability
2.
In industries that process joint products, the costs of the raw materials inputs and the sales values of intermediate and final products are often volatile. Change the data area of your worksheet to match the following:
| hapter 07: Applying Excel | |||
| 2 | |||
| 3 | Data | ||
| 4 | Exhibit 7-6 Santa Maria Wool Cooperative | ||
| 5 | Cost of wool | $192,000 | |
| 6 | Cost of separation process | $40,000 | |
| 7 | Sales value of intermediate products at split-off point: | ||
| 8 | Undyed coarse wool | $110,000 | |
| 9 | Undyed fine wool | $168,000 | |
| 10 | Undyed superfine wool | $51,000 | |
| 11 | Costs of further processing (dyeing) intermediate products: | ||
| 12 | Undyed coarse wool | $50,000 | |
| 13 | Undyed fine wool | $60,000 | |
| 14 | Undyed superfine wool | $10,000 | |
| 15 | Sales value of end products: | ||
| 16 | Dyed coarse wool | $149,000 | |
| 17 | Dyed fine wool | $234,000 | |
| 18 | Dyed superfine wool | $90,000 |
If your formulas are correct, you should get the correct answers to the following questions.
a. What is the overall profit if all intermediate products are processed into final products?
overall profit from processing all intermediate prducts _______________
b. What is the residual income?
Coarse_______
Fine_______
Superfine_____-
c-1. With these new costs and selling prices, what recommendations would you make concerning the company’s operations?
c-2. If your recommendation in part (c-1) is followed, what would be the company’s overall profit?
In: Accounting
Situated in the heart of a 3,000-acre Florida paradise, the Bayside Inn Golf and Beach Resort offers gracious hospitality and beautiful accommodations. Its restaurant, Dolphin Watch, overlooks the scenic Choctawhatchee Bay, a perfect place to spy dolphins. As a server at the Dolphin Watch, you enjoy working in this resort setting—except for one thing. You have occasionally been “stiffed” by a patron who left no tip. You know your service is excellent, but some customers just don’t get it. They seem to think that tips are optional, a sign of appreciation. For servers, however, tips are 80 percent of their income.
In a recent New York Times article, you learned that some restaurants—like the famous Coach House Restaurant in New York—automatically add a 20% tip to the bill. In Santa Monica the Lula restaurant prints “gratuity guidelines” on checks, showing customers what a 20 percent tip would be. You also know that American Express recently developed a gratuity calculation feature on its terminals. Cardholders don’t even have to do the math!
Because they know you have been studying letter writing, your fellow servers have asked you to write a seriously persuasive memo to Nicholas Ruiz, General Manager.
Ruiz Nicholas
General Manager
1123 West London St
Las Vegas, NV
Use your name and address for the letterhead and signature block.
Persuade him to adopt mandatory tipping guidelines in the restaurant. Develop logical persuasive arguments, and write the letter. UseModified block with open punctuation.
In: Accounting
An uncharged capacitor and a resistor are connected in series to a source of emf. If e m f = 10.0 V, C = 21.0 µF, and R = 100 Ω, find the following.
(a) the time constant of the circuit
(b) the maximum charge on the capacitor
(c) the charge on the capacitor at a time equal to one time
constant after the battery is connected
In: Physics
An R-C circuit with R = 100 ohm and C = 3 mF is connected to a 90 V source of emf. At t = 0 the switch is closed and the capacitor begins to charge.
a) How much energy (in J) is stored in the capacitor at t = 0.7 s?
b) What is the largest amount of energy that can be store in the capacitor?
In: Physics