Questions
Code Using Arrays in Java There is a new ruling for the only elevator located at...

Code Using Arrays in Java

There is a new ruling for the only elevator located at Block B. Students who need to ride the elevator, must line up in a queue. The rated load in pounds for the elevator is based on the inside net platform areas. The maximum load for the elevator is 500 pound.

Write a program to read the students weight (in pound) in the line and calculate the number of students that are allowed to enter the elevator before it makes a loud noise.

Input

The first line of input is T (1 ≤ T ≤ 100) which is the number of test case. This is followed by T lines of input. Each line starts with X (X ≤ 100) which is the number of students who want to ride the elevator. This is then followed by a list of X data which is the students’ weight in the line.

Output

For each test case, the output contains a line in the format "Case #x: y", where x is the case number (starting from 1) and y indicates the number of students in the line that are allowed to ride the elevator.

Sample Input

3
9 45 25 50 46 10 55 50 83 68
5 66 155 93 101 90 
8 64 70 50 45 85 74 110 95 

Sample Output

Case #1: 9
Case #2: 4
Case #3: 7


In: Computer Science

In a USA Today article about an experimental vaccine for children the data found in the...

In a USA Today article about an experimental vaccine for children the data found in the table below was presented. Using the technique of Chi Square use a .05 significance level to test if there is an association between treatment type and outcome of flu. Does the vaccine appear to be effective? (Is there an association?)

Developed flu?

yes no

vaccine 14 656

placebo 95 137

In: Math

1. Will a rising parcel of air always expand? Why? Does this expansion cause air temperature...


1. Will a rising parcel of air always expand? Why? Does this expansion cause air temperature to increase or decrease? Why?
2. Label the latent heat diagram and indicate whether or not energy is absorbed or released in each process.
3. Describe and give examples of the various ways that heat can be transported in the atmosphere.
4. Describe the atmospheric greenhouse effect. Is there any difference between the way the atmospheric greenhouse effect works on a clear night and on a cloudy night?

In: Other

Describe in 2-3 sentences about fundalmental analysis and techniqual analysis of forecasting

Describe in 2-3 sentences about fundalmental analysis and techniqual analysis of forecasting

In: Other

Do out-of-state motorists violate the speed limit more frequently than in-state motorists? This vital question was...

Do out-of-state motorists violate the speed limit more frequently than in-state motorists? This vital question was addressed by the highway patrol in a large eastern state. A random sample of the speeds of 2,500 selected cars was categorized according to whether the car was registered in the state or in some other state and whether or not the car was violating the speed limit. The data follow.

In state speeding cars: 521

Out of state speeding cars: 328

In state not speeding cars: 1141

Out of state not speeding cars: 510

a.) Do these data provide enough evidence to support the highway patrol's claim at the 5% significance level? Your conclusion must be in terms of the P-Value. Show all necessary work.

b). What type of error is possible and describe this error in terms of the problem?

c). Estimate the difference in the actual percentage of In State and Out of State speed limit violators using a 95% confidence interval. Show all necessary work. Using this interval estimation, is there sufficient evidence to support the highway patrol's claim? Explain Carefully.

d). Carefully interpret the confidence interval estimation.

Use non-parametrics/Mann-Whitney test if the problem calls for it- Does it?

In: Math

Robert has just bought a new model rocket, and is trying to measure its flight characteristics....

Robert has just bought a new model rocket, and is trying to measure its flight characteristics. The rocket engine package claims that it will maintain a constant thrust of 13.8 N until the engine is used up. Robert launches the rocket on a windless day, so that it travels straight up, and uses his laser range-finder to meaure that the height of the rocket when the engine cuts off is 21.2 m. He also measures the rocket\'s peak height, which is 25.7 m. If the rocket has a mass of 0.763 kg, how much work is done by the drag force on the rocket during its ascent?

In: Physics

find the multiplicative inverse of 32(mod 101). answer must range from 0 to 100

find the multiplicative inverse of 32(mod 101). answer must range from 0 to 100

In: Math

The excess Gibbs energy of solutions of methylcyclohexane (MCH) and tetrahydrofuran (THF) at 303.15 K was...

The excess Gibbs energy of solutions of methylcyclohexane (MCH) and tetrahydrofuran (THF) at 303.15 K was found to fit the expression
G E = RTx(1- x)[0.4857 – 0.1077(2x -1) + 0.0191(2x – 1)2 ]

where x is the molar fraction of the methylcyclohexane. Calculate the Gibbs energy of mixing when a mixture of 1.00 mol of MCH and 3.00 mol of THF is prepared.

In: Chemistry

Work from the Brown and Goldstein lab provided insights into cholesterol homeostasis that were used to...

Work from the Brown and Goldstein lab provided insights into cholesterol homeostasis that were used to develop several of the LDL cholesterol-lowering therapies, including statins that remain in use today. However, in some patients, statins were not as effective as expected, suggestive of additional mechanisms regulating the LDL receptor. Investigate other LDL cholesterol-lowering therapies (other than PCSK-9 inhibitors), select 1, and compare and contrast the mechanisms of action between the class of drug you select and statins. Include side effects for both types of drugs and information on their efficacy.


In: Biology

I am wanting to know how to write guessing game program in java that prompts the...

I am wanting to know how to write guessing game program in java that prompts the use to enter a capital for a each of 50 states, one state at a time. Upon receiving the user input, the program reports whether the answer is correct or incorrect. Assume 50 states and their capitals are stored in a two-dimensional array. Attached is a copy of the two-dimensional array that can be copied into your program. The user's answer is not case sensitive.

Sample run:

What is the capital of Alabama? Phoenix

Your answer is incorrect.

What is the capital of Alaska? Juneau

Your answer is correct.

What is the capital of Arizona? phoenix

Your answer is correct.

statecapitals.txt

String[][] stateCapital = {
      {"Alabama", "Montgomery"},
      {"Alaska", "Juneau"},
      {"Arizona", "Phoenix"},
      {"Arkansas", "Little Rock"},
      {"California", "Sacramento"},
      {"Colorado", "Denver"},
      {"Connecticut", "Hartford"},
      {"Delaware", "Dover"},
      {"Florida", "Tallahassee"},
      {"Georgia", "Atlanta"},
      {"Hawaii", "Honolulu"},
      {"Idaho", "Boise"},
      {"Illinois", "Springfield"},
      {"Indiana", "Indianapolis"},
      {"Iowa", "Des Moines"},
      {"Kansas", "Topeka"},
      {"Kentucky", "Frankfort"},
      {"Louisiana", "Baton Rouge"},
      {"Maine", "Augusta"},
      {"Maryland", "Annapolis"},
      {"Massachusettes", "Boston"},
      {"Michigan", "Lansing"},
      {"Minnesota", "Saint Paul"},
      {"Mississippi", "Jackson"},
      {"Missouri", "Jefferson City"},
      {"Montana", "Helena"},
      {"Nebraska", "Lincoln"},
      {"Nevada", "Carson City"},
      {"New Hampshire", "Concord"},
      {"New Jersey", "Trenton"},
      {"New York", "Albany"},
      {"New Mexico", "Santa Fe"},
      {"North Carolina", "Raleigh"},
      {"North Dakota", "Bismarck"},
      {"Ohio", "Columbus"},
      {"Oklahoma", "Oklahoma City"},
      {"Oregon", "Salem"},
      {"Pennsylvania", "Harrisburg"},
      {"Rhode Island", "Providence"},
      {"South Carolina", "Columbia"},
      {"South Dakota", "Pierre"},
      {"Tennessee", "Nashville"},
      {"Texas", "Austin"},
      {"Utah", "Salt Lake City"},
      {"Vermont", "Montpelier"},
      {"Virginia", "Richmond"},
      {"Washington", "Olympia"},
      {"West Virginia", "Charleston"},
      {"Wisconsin", "Madison"},
      {"Wyoming", "Cheyenne"}
    };

In: Computer Science

Prepare the journal entries for these transactions. 1) Dur Company purchased equipment on January 2, 2013,...

Prepare the journal entries for these transactions.

1) Dur Company purchased equipment on January 2, 2013, for $112,000. The equipment had an estimated useful life of 5 years with an estimated salvage value of $12,000. Dur uses straight-line depreciation on all assets. On January 2, 2017, Dur exchanged this equipment plus $12,000 in cash for newer equipment. The old equipment has a fair value of $50,000. (Assume that the exchange has commercial substance.)

2) Same transaction except (The exchange lacks commercial substance).

3) Cheng Company traded a used truck for a new truck. The used truck cost $30,000 and has accumulated depreciation of $27,000. The new truck is worth $37,000. Cheng also made a cash payment of $36,000. Prepare Cheng's entry to record the exchange. (The exchange lacks commercial substance.)

4) Slaton Corporation traded a used truck for a new truck. The used truck cost $20,000 and has accumulated depreciation of $17,000. The new truck is worth $35,000. Slaton also made a cash payment of $33,000. Prepare Slaton's entry to record the exchange. (The exchange lacks commercial substance.)

In: Accounting

How do we build a Smart Basket for a customer? Can we rank the products customers...

  1. How do we build a Smart Basket for a customer? Can we rank the products customers buy based on what they keep buying in different baskets and how do products appear together in different baskets?

In: Math

a. The initial cost of the extraction equipment is $2,500,000. In addition to this cost, the...

a. The initial cost of the extraction equipment is $2,500,000. In addition to this cost, the equipment will require a large concrete foundation at a cost of $300,000. The vendor has quoted an additional cost of $200,000 to install and test the equipment. These costs are all considered part of the cost of acquiring the equipment.

b.The useful life of the equipment is 10 years with no salvage value at the end of this period. However, for tax purposes, the equipment will be classified as 7year property and use the following MACRS depreciation allowances (half year convention) for computing tax depreciation deductions:

Percentage Of Original Year Cost

1 . . . . . . . . . . 14.3%

2 . . . . . 24.5

3 . . . . . . . . . . 17.5

4 . . . . . . . . . . 12.5

5 . . . . . . . . . . 8.9

6 . . . . . . . . . .8.9

7 . . . . . . . . . . 8.9

8 . . . . . . . . . .4.5

100.0%

c. Using the new equipment, 250 pounds of platinum can be extracted annually for the next 10 years from the previously inaccessible area of the mine.

d.The cost to extract and separate platinum from the ore is $4,000 per pound of platinum. After separation, the platinum must undergo further processing and testing that costs $1900 per pound of platinum. These are all out of pocket, variable costs.

e.Two skilled technicians will be hired to operate the new equipment. The total salary and fringe benefit expense for these two employees will be $200,000 annually over the 10 years.

f.Periodic maintenance on the equipment is expected to cost $175,000 per year.

g.The project requires an investment in additional working capital of $300,000. This working capital would be released for use elsewhere at the conclusion of the project in 10 years.

h.Environmental and safety regulations require that the mine be extensively restored and toxic substances be safely disposed at the conclusion of the project. The cost of environmental remediation work is expected to be $4,500,000

i.The current market price of platinum is 12,800 per pound

j.The tax rate is 21% and it uses an 18% after tax discount rate (minimum required rate of return)

Question:

2. Capital investment evaluation
Determine the following for the proposed extractoin equipment investment and specify whether or not the investment is acceptable under each of the following approaches. Assume a minimum payback period of 2 years is required
a. Net Present Value (NPV)
b. Internal rate of return (IRR) [Under TOOLS select GOAL SEEK and SET CELL for NPV equal to "0" - by changing after-tax discount rate 18%
c. Payback (in years) - round to nearest whole year

2.

After-tax Present Value of
Description Year(s) Ending Amount ($) Tax effect (%) Cash Flows ($) Discount Factor Cash Flows ($)
Equipment cost Now
Working capital Now
Revenue 1-10        3,200,000 79%          2,528,000 4.4941
Processing & Testing 1-10
Salaries & benefits 1-10
Maintenance 1-10
PV of depr shield 1-8               365,342
Release of W.C. 10                      - 0.1911
Site Remediation 10
(a) NPV ($) =
check figure: 1236370

In: Accounting

What are five events from the Pentateuch that shape the biblical story and maintain a central...

What are five events from the Pentateuch that shape the biblical story and maintain a central theme throughout?

In: Psychology

Create a JUNIT test program in Java for this program: package edu.odu.cs.cs350; import java.util.Arrays; /** *...

Create a JUNIT test program in Java for this program:

package edu.odu.cs.cs350;


import java.util.Arrays;


/**
 * A duration represents a period of elapsed time, e.g., 4 hours, 23 minutes, 2 seconds.
 * This is differentiated from a point in time (e.g., 4:23:02AM). A meeting that
 * has a duration of 2 hours has that same duration no matter where it was held. A 
 * starting time (point) for that of 2:00PM EST can be unambiguous only if the time
 * zone is added.
 * 
 * <p>
 * Because durations are often used in calculations, both positive and
 * negative values are possible.
 * 
 * <p>
 * Most of the accessor functions for this class will respond with normalized
 * values, where the normalization rules are as follows:
 * <ul>
 *   <li>The seconds and minutes components will have an absolute
 *       value in the range 0..59, inclusive.</li> 
 *   <li>The hours component will have an absolute value in the 
 *       range 0..23, inclusive.</li>
 *   <li>The sign of each component matches the sign of the 
 *       overall duration.  A duration of -61 seconds, for example,
 *       has normalized components of -1 seconds and -1 minutes.</li>
 * </ul>
 * Inputs to the member functions are not, however, required to 
 * be normalized. new Duration(0,0,3,-61) and new Duration(0,0,1,59)
 * are both acceptable (and the resulting Duration objects are equal).  
 * 
 * @author zeil
 *
 */
public class Duration implements Cloneable {



  /**
   * Construct a new duration, equivalent to
   * Duration(0,0,0,0).
   */
  public Duration() {
      //ToDo
  }

  /**
   * Create a new duration.
   * 
   * @param totalSeconds total number of seconds in duration
   */
  public Duration(long totalSeconds) {
      //ToDo
  }

  /**
   * Create a new duration.
   * 
   * @param days  number of days in duration
   * @param hours number of hours in duration
   * @param minutes number of minutes in duration
   * @param seconds number of seconds in duration
   */
  public Duration(int days, int hours, int minutes, int seconds) {
      //ToDo
  }

  
  /**
   * Get the total seconds of this duration, including the contributions
   * of the days, hours, minutes, & seconds components.
   *  
   * @return the total seconds
   */
  public long getTotalSeconds() {
      //ToDo
      return 0;
  }

  /**
   * Set the total seconds of this duration, potentially altering
   * the days, hours, minutes, & seconds components.

   * @param totalSeconds the total seconds to set
   */
  public void setTotalSeconds(long totalSeconds) {
      //ToDo
  }

  /**
   * How many days in this duration?.
   * 
   * @return the normalized days component
   */
  public int getDays() {
      //ToDo
      return 0;
  }
  
  private static final long secondsPerHour = 60 * 60; 

  /**
   * How many hours in this duration?.
   * 
   * @return the normalized hours component
   */
  public int getHours() {
      //ToDo
      return 0;
  }

  
  /**
   * How many minutes in this duration?.
   * 
   * @return the normalized minutes component
   */
  public int getMinutes() {
      //ToDo
      return 0;
  }
  

  /**
   * How many seconds in this duration?.
   * 
   * @return the normalized seconds component
   */
  public int getSeconds() {
      //ToDo
      return 0;
  }

  /**
   * Add another duration to this one.
   * @param dur a duration
   */
  public void add(Duration dur) {
      //ToDo
  }

  /**
   * Subtract another duration from this one.
   * @param dur a duration
   */
  public void subtract(Duration dur) {
      //ToDo
  }

  /**
   * Multiply this duration by a scaling factor,
   * rounding to the closest second.
   * @param factor a scaling factor
   */
  public void scale(double factor) {
      //ToDo
  }

  /**
   * Render the duration as
   *     d:h:m:s
   * (preceded by a '-'if the duration is negative)
   * where the four components are normalized non-negative
   * integer values. The final three components are always rendered 
   * in 2 digits. The two leading components and their 
   * associated ':' delimiters are omitted if the leading values
   * are zero.  E.g., Duration(0,-1,-59,-61) would be rendered as
   * "-02:00:01".
   */
  public String toString() {
      //ToDo
      return "";
  }
  
  

  // Comparison and hashing

  /**
   * Compares two durations for equality. They are considered equal if
   * their getTotalSeconds() values are equal.
   *
   * @param obj object to be compared for equality with this duration
   * @return <tt>true</tt> if the specified object is equal to this one
   */
  public boolean equals(Object obj) {
      //ToDo
      return false;
  }

  /**
   * Returns the hash code value for this object.
   *
   * @return the hash code value for this duration
   */
  public int hashCode() {
      //ToDo
      return 0;
  }

  /**
   * Return a (deep) copy of this object.
   */
  @Override
  public Object clone()  {
      //ToDo
      return null;
  }


}

*This is the template to fill in for the solution - please fill in these functions to complete the JUNIT Test Class*

/**
*
*/
package edu.odu.cs.cs350;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
* @author Colten Everitt
*
*/
public class DurationClassTest {

   /**
   * @throws java.lang.Exception
   */
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
   }

   /**
   * @throws java.lang.Exception
   */
   @AfterClass
   public static void tearDownAfterClass() throws Exception {
   }

   /**
   * @throws java.lang.Exception
   */
   @Before
   public void setUp() throws Exception {
   }

   /**
   * @throws java.lang.Exception
   */
   @After
   public void tearDown() throws Exception {
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#hashCode()}.
   */
   @Test
   public final void testHashCode() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#Duration()}.
   */
   @Test
   public final void testDuration() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#Duration(long)}.
   */
   @Test
   public final void testDurationLong() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#Duration(int, int, int, int)}.
   */
   @Test
   public final void testDurationIntIntIntInt() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#getTotalSeconds()}.
   */
   @Test
   public final void testGetTotalSeconds() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#setTotalSeconds(long)}.
   */
   @Test
   public final void testSetTotalSeconds() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#getDays()}.
   */
   @Test
   public final void testGetDays() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#getHours()}.
   */
   @Test
   public final void testGetHours() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#getMinutes()}.
   */
   @Test
   public final void testGetMinutes() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#getSeconds()}.
   */
   @Test
   public final void testGetSeconds() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#add(edu.odu.cs.cs350.Duration)}.
   */
   @Test
   public final void testAdd() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#subtract(edu.odu.cs.cs350.Duration)}.
   */
   @Test
   public final void testSubtract() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#scale(double)}.
   */
   @Test
   public final void testScale() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#toString()}.
   */
   @Test
   public final void testToString() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#equals(java.lang.Object)}.
   */
   @Test
   public final void testEqualsObject() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link edu.odu.cs.cs350.Duration#clone()}.
   */
   @Test
   public final void testClone() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#Object()}.
   */
   @Test
   public final void testObject() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#getClass()}.
   */
   @Test
   public final void testGetClass() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#equals(java.lang.Object)}.
   */
   @Test
   public final void testEqualsObject1() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#clone()}.
   */
   @Test
   public final void testClone1() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#toString()}.
   */
   @Test
   public final void testToString1() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#notify()}.
   */
   @Test
   public final void testNotify() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#notifyAll()}.
   */
   @Test
   public final void testNotifyAll() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#wait(long)}.
   */
   @Test
   public final void testWaitLong() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#wait(long, int)}.
   */
   @Test
   public final void testWaitLongInt() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#wait()}.
   */
   @Test
   public final void testWait() {
       fail("Not yet implemented"); // TODO
   }

   /**
   * Test method for {@link java.lang.Object#finalize()}.
   */
   @Test
   public final void testFinalize() {
       fail("Not yet implemented"); // TODO
   }

}

In: Computer Science