Questions
How to solve it by wolfram mathematica: The fraction 49/98 is a curious fraction, as an...

How to solve it by wolfram mathematica:

The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s.
We shall consider fractions like, 30/50 = 3/5, to be trivial examples.
There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.
You have to identify these four fractions.

(This is "almost" Problem 33 from Euler project, with only the requirement modified).

In: Advanced Math

Discusses how you would find out how to keep an outfielder on a baseball team if...

Discusses how you would find out how to keep an outfielder on a baseball team if you had to cut two players of three. The averages of the three players are: Player 1: 333, Player 2: 301, Player 3: 296. Player one hit 6 home runs, player 2 hit 4 home runs, and player three hit 16 home runs. Which statistic is a better evaluation of player performance why? How did you determine this by statistical testing?

In: Statistics and Probability

1. What are two different ways to estimate the cost of equity for a firm? 2....

1. What are two different ways to estimate the cost of equity for a firm?

2. Lewis runs an outdoor adventure company and wants to know what effect a tax change will have on his company’s WACC. Currently Lewis has the following financing pattern:

            Equity: 35% and cost of 14%

            Preferred stock: 15% and cost of 11%

            Debt: 50% and cost of 10% before taxes

      What is the WACC for Lewis if the tax rate is
a. 30%?

      b. 40%?

In: Finance

You will create a program that runs in one of two modes, interactive mode and test...

You will create a program that runs in one of two modes, interactive mode and test mode. The mode will determined by the command line, passing in a "-i" flag for interactive or "-t" for test mode. Require the user to pass in a flag.

$> ./lab02 -i
Make a selection:
1) Insert value at position
2) Remove at position
3) Replace value at position
4) Print length
5) Print list
6) Exit
Choice: 
$> ./lab02 -t
<output from your test class automatically prints>

LinkedList Header File

#ifndef LINKED_LIST_H
#define LINKED_LIST_H

#include "Node.h" //Gone over in class
#include <stdexcept> //For runtime_error
class LinkedList
{
     private:
     Node* m_front;
     int m_length;
    
     public:
     LinkedList();
     LinkedList(const LinkedList& original);
     ~LinkedList();
     LinkedList& operator=(const LinkedList& original);
     bool isEmpty() const;
     int getLength() const;
     void insert(int position, int entry); 
     void remove(int position); 
     void clear();
     int getEntry(int position) const;

     /** Here's an example of a doxygen comment block. Do this for all methods
     * @pre The position is between 1 and the list's length
     * @post The entry at the given position is replaced with the new entry
     * @param position:  1<= position <= length
     * @param newEntry: A new entry to put in the list
     * @throw std::runtime_error if the position is invalid.
     **/
     void replace(int position, int newEntry);
};
#endif

Method Descriptions

  • LinkedList()
    • Creates an empty list
  • Copy Constructor
    • Creates a deep copy
  • ~LinkedList
    • deletes all nodes (note, this could just call clear...)
  • isEmpty
    • Returns true if empty, false otherwise
  • getLength
    • Returns the length
  • insert
    • adds a node containing the entry at that position (so the number of nodes is increased by 1)
    • positions range from 1 to length+1
    • NOTE: The reason for length+1 is to insert at the back of the list
    • if the position is out of range, it throws an exception
  • remove
    • deletes the node at that position (so the number of nodes is decreased by 1)
    • positions range from 1 to length
    • if the position is out of range, it throws an exception
  • clear
    • deletes all nodes in the list
  • getEntry
    • Returns the entry at a given position
    • positions range from 1 to length
    • if the position is out of range, it throws an exception
  • replace
    • replaces the entry at a given position
    • The number of nodes is unchanged
    • positions range from 1 to length
    • if the position is out of range, it throws an exception

Notes

  • You may add private helper functions as you see fit, but their responsibility should be in line with that of a List
  • Never expose private member to other scopes
  • LinkedLists ARE NOT in charge of printing themselves
  • Note: you'll also need to make a Node implementation

LinkedListTester class

  • Runs a battery of tests to verify that our Linked List is working
  • Has a single entry point called runTests()
  • Each test prints what test is currently running and if the List Passed or failed
  • Each test method should work in a vacuum, meaning each test

Sample LinkedListTester.h

class LinkedListTester
{   
    public: 

    LinkedListTester();

    //This will call all your test methods
    void runTests();
     
    private:

    /**
    * @brief Creates an empty list and verifies isEmpty() returns true
    **/
    void test01();

    /**
    * @brief Creates an empty list adds 1 value, verifies isEmpty() returns false
    **/
    void test02();

    /**
    * @brief Creates an empty list and verifies getLength() returns 0
    **/
    void test03();

    //more test methods as needed
};

Tests

I am provided you with some starter tests that you must implement. You will also be required to add new tests for methods not mentioned here

Each test should be ran in isolation, meaning the tests could be run in any order and they don't share any objects/data.

Size tests

  1. size of empty list is zero
  2. size returns correct value after inserting at front of list
  3. size returns correct value after inserting at back of list
  4. size returns correct value after inserting in middle of list
  5. size returns correct value after adds and removing from front of list
  6. size returns correct value after adds and removing from back of list
  7. size returns correct value after adds and removing from middle of list

Insert tests

  1. insert throws exception if given an invalid position

Sample Test Output

$>./lab02 -t
Test #1: size of empty list is zero  PASSED
Test #2: size returns correct value after inserting at front of list addFront PASSED
Test #3: size returns correct value after inserting at back of list FAILED
$>

In: Computer Science

Sara’s Salsa Company produces its condiments in two types: Extra Fine for restaurant customers and Family...

Sara’s Salsa Company produces its condiments in two types: Extra Fine for restaurant customers and Family Style for home use. Salsa is prepared in department 1 and packaged in department 2. The activities, overhead costs, and drivers associated with these two manufacturing processes and the company’s production support activities follow. Process Activity Overhead cost Driver Quantity Department 1 Mixing $ 7,000 Machine hours 2,900 Cooking 16,200 Machine hours 2,900 Product testing 114,500 Batches 500 $ 137,700 Department 2 Machine calibration $ 350,000 Production runs 700 Labeling 18,500 Cases of output 140,000 Defects 9,500 Cases of output 140,000 $ 378,000 Support Recipe formulation $ 89,000 Focus groups 50 Heat, lights, and water 58,000 Machine hours 2,900 Materials handling 85,000 Container types 10 $ 232,000 Additional production information about its two product lines follows. Extra Fine Family Style Units produced 40,000 cases 100,000 cases Batches 400 batches 100 batches Machine hours 1,250 MH 1,650 MH Focus groups 32 groups 18 groups Container types 5 containers 5 containers Production runs 310 runs 390 runs 4. Using ABC, compute the total cost per case for each product type if the direct labor and direct materials cost is $11 per case of Extra Fine and $7 per case of Family Style. (Round your intermediate calculations to 2 decimal places. Round "Activity Rate" and "Overhead cost per unit" answers to 2 decimal places.)

In: Accounting

Sara’s Salsa Company produces its condiments in two types: Extra Fine for restaurant customers and Family...

Sara’s Salsa Company produces its condiments in two types: Extra Fine for restaurant customers and Family Style for home use. Salsa is prepared in department 1 and packaged in department 2. The activities, overhead costs, and drivers associated with these two manufacturing processes and the company’s production support activities follow.

Process Activity Overhead cost Driver Quantity
Department 1 Mixing $ 6,000 Machine hours 2,400
Cooking 10,800 Machine hours 2,400
Product testing 114,000 Batches 750
$ 130,800
Department 2 Machine calibration $ 325,000 Production runs 650
Labeling 18,000 Cases of output 160,000
Defects 6,000 Cases of output 160,000
$ 349,000
Support Recipe formulation $ 84,000 Focus groups 50
Heat, lights, and water 42,000 Machine hours 2,400
Materials handling 80,000 Container types 10
$ 206,000


Additional production information about its two product lines follows.

Extra Fine Family Style
Units produced 35,000 cases 125,000 cases
Batches 350 batches 400 batches
Machine hours 1,000 MH 1,400 MH
Focus groups 34 groups 16 groups
Container types 4 containers 6 containers
Production runs 260 runs 390 runs

Problem 17-5A Part 4

4. Using ABC, compute the total cost per case for each product type if the direct labor and direct materials cost is $7 per case of Extra Fine and $6 per case of Family Style. (Round your intermediate calculations to 2 decimal places. Round "Activity Rate" and "Overhead cost per unit" answers to 2 decimal places.)

In: Accounting

Write a method that displays every other element of an array. Write a program that generates...

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

Hank’s Hamburger Palace operates in the perfectly competitive hamburger business. The fixed costs for the business...

Hank’s Hamburger Palace operates in the perfectly competitive hamburger business. The fixed costs for the business are $50. Each hamburger sells for $1 and the cost of hiring a new worker is $30. The first two columns in the table below show how many workers it takes to produce a certain number of hamburgers.

  

Quantity of Labor

Quantity of Output

Fixed Costs

Variable Cost

Total Cost

Marginal Cost

Average Cost

1

40

50

30

80

80

2

75

50

60

110

30

55

3

105

50

90

140

30

46.66667

4

130

50

120

170

30

42.5

5

150

50

150

200

30

40

a. Use the derived demand approach to calculate what quantity of labor will be hired.

  

b. Calculate the marginal revenue product and determine what quantity of labor to hire.

  

c. Do your answers match from parts b and c? Would you expect the answers to match?

In: Economics

In 10 test runs, a truck operated for 8, 10, 10, 7, 9, 12, 10, 8,...

In 10 test runs, a truck operated for 8, 10, 10, 7, 9, 12, 10, 8, 7, and 9 miles with one gallon of a certain gasoline. Is this evidence at the 0.05 level of signifcance that the truck is not operating at an average of 11.5 miles per gallon with this gasoline? What assumptions must be satised in order for the procedure you used to analyze these data to be valid?

In: Statistics and Probability

A bakery runs a Groupon campaign. $3 cost for $8 value 50/50 split with Groupon 70%...

A bakery runs a Groupon campaign. $3 cost for $8 value 50/50 split with Groupon 70% of coupons redeemed 1,200 coupons sold Average ticket value: $11 Bakery’s gross margin: 45%

A. Calculate the revenue from the campaign

B. Calculate the restaurant expenses associated with the Groupon customers.

C. Assume that the campaign generated 75 new customers. Calculate the breakeven sales revenue for a new customer.

In: Accounting