Can you do this please: the code should be java just give me this and I...

Can you do this please: the code should be java

just give me this and I will finish the rest don't worry about infix or postfix conversion and evaluation.

just I need these two string should give value. and get a new string like this "12+34-/5".

String s = "ab+cd-/e*"

String s1 = "1232451"

I need code giving each character of String s value of strings1 ignoring operators.

example: a = 1, b = 2, c = 32, d = 4, e = 51, then give me new String like "12+324-/51*"

thank you

In: Computer Science

Based on the reading in chapter 1 in the text, what is psychology? What do psychologist...

Based on the reading in chapter 1 in the text, what is psychology? What do psychologist do/what is their function? Based on how King (2013) conceptualizes psychology and psychologists’, discuss how psychological theory and practices will be helpful in your future endeavors (professionally and personally)?

IN THE PERSPECTIVE OF A DOCTOR

In: Psychology

How did the Founding Fathers formulate the Constitution to ensure that the minority would always be...

How did the Founding Fathers formulate the Constitution to ensure that the minority would always be in charge and that power would never go from them to the masses?

In: Economics

The following reaction is a part of the TCA cycle: succinate + FAD ⇄ fumarate +...

The following reaction is a part of the TCA cycle:

succinate + FAD ⇄ fumarate + FADH2

3) The E°’ for the reduction of FAD is -0.22 V and the E°’ for the reduction of fumarate is 0.03 V. Calculate ΔE°’ for the full reaction given above. Show your work. Be mindful of units. (1 pt)

4) Use your answer from part (3) to calculate ΔG°’ for the full forward reaction given above. Use F = 96,500 J V-1 mol-1. Show your work. Be mindful of units. (1 pt)

5) The ΔG°’ for the forward reaction is positive, and yet we know the TCA cycle is able to proceed in the cell. Is this a contradiction of thermodynamic principles? In two to three sentences, briefly explain your reasoning. (2 pts)

6) Let’s look at the same reaction, but under a new set of conditions that more closely match intracellular concentrations: [FADH2] / [FAD] = 10 [succinate] = 1.7 mM [fumarate] = 100 µM Derive an equation to calculate ΔE from ΔE°’, n, R, T, F, and the concentrations provided above. n = number of electrons Use R = 8.314 J mol-1 K-1, T = 298 K, and F = 96,500 J V-1 mol -1. Simplify the equation as much as you can before calculating ΔE. Show your work. Be mindful of units. Only round at the very end and write your answer out to four decimal places. (2 pts)

I just need help on parts 5 and 6 please explain

In: Biology

1. Describe the function of the FeS04 in the KIA medium. 2. How many days does...

1. Describe the function of the FeS04 in the KIA medium.

2. How many days does it take to complete the gelatin hydrolysis test.

3. How many hours minimum must you incubate the gelatin hydrolysis test?

4. Lysine Decarboxyclase test: Give two ways to prevent the diffusion of oxygen into the medium in this test.

5. Describe the Kirby Bauer Method.

6. Why must the CAMP test be performed on a blood agar plate?

In: Biology

Cloud computing has a litany of necessary requirements. The business case needs to showcase the necessity...

Cloud computing has a litany of necessary requirements. The business case needs to showcase the necessity for moving to the cloud as well as an understanding of the cost benefit analysis. You should showcase a positive outcome for such a move outlining the overall inception and systems lifecycle process. As such, discuss the following questions in order to define what sufficient means and how to interpret a cost benefit analysis:

  • What is required for the business need to be identified and who makes the decision to move forward with a course of action?
  • What is a cost/benefit analysis and how does that factor into the decision to migrate into the cloud?
  • What sort of risks exist and how might those be mitigated?

In: Computer Science

# please answer question asap please Write a program in C to insert new value in...

# please answer question asap please

Write a program in C to insert new value in the array (unsorted list).

Use pointer notation for the array elements

.Test Data:Input the size of array: 4 Input 4 elements in the array in ascending order:

element -0: 2

element -1: 9

element -2: 7

element -3: 12

Input the value to be inserted: 5

Input the Position, where the value to be inserted: 2

Expected Output:The current list of the array:2 9 7 12

After Insert the element the new list is:2 5 9 7 12

In: Computer Science

MINIMUM MAIN.CPP CODE /******************************** * Week 4 lesson:               * *   finding the smallest number * *********************************/...

MINIMUM MAIN.CPP CODE

/********************************
* Week 4 lesson:               *
*   finding the smallest number *
*********************************/

#include <iostream>

using namespace std;

/*
* Returns the smallest element in the range [0, n-1] of array a
*/
int minimum(int a[], int n)
{
   int min = a[0];

   for (int i = 1; i < n; i++)
       if (min > a[i]) min = a[i];

   return min;
}

int main()
{
   int a[10];

   for (int i = 0; i < 10; i++)
   {
       a[i] = rand()%100;
       cout << a[i] << " ";
   }

   cout << endl << "Min = " << minimum(a, 10) << endl;

   return 0;

}

FACTORIAL MAIN.CPP CODE

/************************************************
*   implementing a recursive factorial function *
*************************************************/

#include <iostream>

using namespace std;

/*
* Returns the factorial of n
*/
long factorial(int n)
{
   if (n == 1)
       return 1;
   else
       return n * factorial(n - 1);
}

int main()
{
   int n;

   cout << "Enter a number: ";
   cin >> n;

   if (n > 0)
       cout << n << "!= " << factorial(n) << endl;
   else
       cout << "Input Error!" << endl;   return 0;
}

SORTING ALGORITHMS ARRAYLIST CODE

/********************************************
* Week 4 lesson:                           *
*   ArrayList class with sorting algorithms *
*********************************************/

#include <iostream>
#include "ArrayList.h"

using namespace std;

/*
* Default constructor. Sets length to 0, initializing the list as an empty
* list. Default size of array is 20.
*/
ArrayList::ArrayList()
{
   SIZE = 20;
   list = new int[SIZE];
   length = 0;
}

/*
* Destructor. Deallocates the dynamic array list.
*/
ArrayList::~ArrayList()
{
   delete [] list;
   list = NULL;
}

/*
* Determines whether the list is empty.
*
* Returns true if the list is empty, false otherwise.
*/
bool ArrayList::isEmpty()
{
   return length == 0;
}

/*
* Prints the list elements.
*/
void ArrayList::display()
{
   for (int i=0; i < length; i++)
       cout << list[i] << " ";
   cout << endl;
}

/*
* Adds the element x to the end of the list. List length is increased by 1.
*
* x: element to be added to the list
*/
void ArrayList::add(int x)
{
   if (length == SIZE)
   {
       cout << "Insertion Error: list is full" << endl;
   }
   else
   {
       list[length] = x;
       length++;
   }
}

/*
* Removes the element at the given location from the list. List length is
* decreased by 1.
*
* pos: location of the item to be removed
*/
void ArrayList::removeAt(int pos)
{
   if (pos < 0 || pos >= length)
   {
       cout << "Removal Error: invalid position" << endl;
   }
   else
   {
       for ( int i = pos; i < length - 1; i++ )
           list[i] = list[i+1];
       length--;
   }
}

/*
* Bubble-sorts this ArrayList
*/
void ArrayList::bubbleSort()
{
   for (int i = 0; i < length - 1; i++)
       for (int j = 0; j < length - i - 1; j++)
           if (list[j] > list[j + 1])
           {
               //swap list[j] and list[j+1]
               int temp = list[j];
               list[j] = list[j + 1];
               list[j + 1] = temp;
           }
}

/*
* Quick-sorts this ArrayList.
*/
void ArrayList::quicksort()
{
   quicksort(0, length - 1);
}

/*
* Recursive quicksort algorithm.
*
* begin: initial index of sublist to be quick-sorted.
* end: last index of sublist to be quick-sorted.
*/
void ArrayList::quicksort(int begin, int end)
{
   int temp;
   int pivot = findPivotLocation(begin, end);

   // swap list[pivot] and list[end]
   temp = list[pivot];
   list[pivot] = list[end];
   list[end] = temp;

   pivot = end;

   int i = begin,
       j = end - 1;

   bool iterationCompleted = false;
   while (!iterationCompleted)
   {
       while (list[i] < list[pivot])
           i++;
       while ((j >= 0) && (list[pivot] < list[j]))
           j--;

       if (i < j)
       {
           //swap list[i] and list[j]
           temp = list[i];
           list[i] = list[j];
           list[j] = temp;

           i++;
           j--;
       } else
           iterationCompleted = true;
   }

   //swap list[i] and list[pivot]
   temp = list[i];
   list[i] = list[pivot];
   list[pivot] = temp;

   if (begin < i - 1)
       quicksort(begin, i - 1);
   if (i + 1 < end)
       quicksort(i + 1, end);
}

/*
* Computes the pivot location.
*/
int ArrayList::findPivotLocation(int b, int e)
{
   return (b + e) / 2;
}

SORTING ALGORITHMS ARRAYLIST HEADER

/********************************************
* Week 4 lesson:                           *
*   ArrayList class with sorting algorithms *
*********************************************/

/*
* Class implementing an array based list. Bubblesort and quicksort algorithms
* are implemented also.
*/
class ArrayList
{
public:
   ArrayList ();
   ~ArrayList();
   bool isEmpty();
   void display();
   void add(int);
   void removeAt(int);
   void bubbleSort();
   void quicksort();
private:
   void quicksort(int, int);
   int findPivotLocation(int, int);
   int SIZE;       //size of the array that stores the list items
   int *list;       //array to store the list items
   int length;   //amount of elements in the list
};

SORTING ALGORITHMS MAIN.CPP CODE

/********************************************
* Week 4 lesson:                           *
*   ArrayList class with sorting algorithms *
*********************************************/

#include <iostream>
#include "ArrayList.h"
#include <time.h>

using namespace std;

/*
* Program to test the ArrayList class.
*/
int main()
{
   srand((unsigned)time(0));

   //creating a list of integers
   ArrayList numbersCopy1, numbersCopy2;


    //filling the list with random integers
    for (int i = 0; i<10; i++)
   {
       int number = rand()%100;
       numbersCopy1.add(number);
       numbersCopy2.add(number);
   }

    //printing the list
    cout << "Original list of numbers:" << endl <<"\t";
    numbersCopy1.display();

    //testing bubblesort
    cout << endl << "Bubble-sorted list of numbers:" << endl <<"\t";
    numbersCopy1.bubbleSort();
    numbersCopy1.display();

    //testing quicksort
    cout << endl << "Quick-sorted list of numbers:" << endl <<"\t";
   numbersCopy2.quicksort();
    numbersCopy2.display();

   return 0;
}

QUESTIONS

PART 1

Design and implement an algorithm that, when given a collection of integers in an unsorted array, determines the third smallest number (or third minimum). For example, if the array consists of the values 21, 3, 25, 1, 12, and 6 the algorithm should report the value 6, because it is the third smallest number in the array. Do not sort the array.

To implement your algorithm, write a function thirdSmallest that receives an array as a parameter and returns the third-smallest number. To test your function, write a program that populates an array with random numbers and then calls your function.

PART 2

The following problem is a variation of Exercise C-4.27 in the Exercises section of Chapter 4 in Data Structures and Algorithms in C++ (2nd edition) textbook.

Implement a recursive function for computing the n-th Harmonic number:

Hn=∑i=1n1i/

Here you have some examples of harmonic numbers.

H1 = 1
H2 = 1 + 1/2 = 1.5
H3 = 1 + 1/2 + 1/3 = 1.8333
H4 = 1 + 1/2 + 1/3 + 1/4 = 2.0833

PART 3

In this week's lesson, the algorithms quicksort and bubblesort are described. In Sorting Algorithms (Links to an external site.) you can find the class ArrayList, where these sorting algorithms are implemented. Write a program that times both of them for various list lengths, filling the array lists with random numbers. Use at least 10 different list lengths, and be sure to include both small values and large values for the list lengths (it might be convenient to add a parameterized constructor to the class ArrayList so the size of the list can be set at the moment an ArrayList object is declared).

Create a table to record the times as follows.

List Length Bubblesort Time
(seconds)
Quicksort Time
(seconds)

Regarding the efficiency of both sorting methods, what are your conclusions? In addition to the source code and a screenshot of the execution window, please submit a separate document with the table and your conclusions about the experiment.

Note: To time a section of your source code, you can do this.

#include <chrono>

using namespace std;

int main()
{
    start = chrono::steady_clock::now();
     //add code to time here
    end = chrono::steady_clock::now();
    chrono::duration<double> timeElapsed = chrono::duration_cast<chrono::duration<double>>(end-start);
    cout << "Code duration: "  << timeElapsed.count() << " seconds" << endl;      
}

In: Computer Science

Do you think President Eisenhower had a successful presidency?

Do you think President Eisenhower had a successful presidency?

In: Economics

Barbour Corporation, located in Buffalo, New York, is a retailer of high-tech products and is known...

Barbour Corporation, located in Buffalo, New York, is a retailer of high-tech products and is known for its excellent quality and innovation. Recently, the firm conducted a relevant cost analysis of one of its product lines that has only two products, T-1 and T-2. The sales for T-2 are decreasing and the purchase costs are increasing. The firm might drop T-2 and sell only T-1.

Barbour allocates fixed costs to products on the basis of sales revenue. When the president of Barbour saw the income statements (see below), he agreed that T-2 should be dropped. If T-2 is dropped, sales of T-1 are expected to increase by 10% next year, but the firm’s cost structure will remain the same.

T-1 T-2
Sales $ 285,000 $ 328,000
Variable costs:
Cost of goods sold 87,000 164,000
Selling & administrative 27,000 67,000
Contribution margin $ 171,000 $ 97,000
Fixed expenses:
Fixed corporate costs 77,000 92,000
Fixed selling and administrative 29,000 38,000
Total fixed expenses $ 106,000 $ 130,000
Operating income $ 65,000 $ (33,000 )

Required:

1. Find the expected change in annual operating income by dropping T-2 and selling only T-1.

2. By what percentage would sales from T-1 have to increase in order to make up the financial loss from dropping T-2? (Enter your answer as a percentage rounded to 2 decimal places (i.e. 0.1234 should be entered as 12.34).)

3. What is the required percentage increase in sales from T-1 to compensate for lost margin from T-2, if total fixed costs can be reduced by $54,000? (Enter your answer as a percentage rounded to 2 decimal places (i.e. 0.1234 should be entered as 12.34).)

1.
2. Required % increase in sales of T-1 %
3. Required % increase in sales from T-1 %

In: Accounting

C PROGRAMMIMG I want to check if my 2 input is a number or not all...

C PROGRAMMIMG

I want to check if my 2 input is a number or not

all of the input are first stored in an array if this the right way?

read = sscanf(file, %s%s%s, name, num, last_name);

if(strcmp(num, "0") != 0)

printf("Invalid. Please enter a number.")

In: Computer Science

In long paragraphs answer the questions below: Discuss the key components (where, when, what) and causes...

In long paragraphs answer the questions below:

Discuss the key components (where, when, what) and causes (internal and external) of industrialization in Western Europe.

Discuss the main characteristics of the new imperialism, along with the means and motives that drove it forward.

In: Economics

Sinkal Co. was formed on January 1, 2018 as a wholly owned foreign subsidiary of a...

Sinkal Co. was formed on January 1, 2018 as a wholly owned foreign subsidiary of a U.S. corporation. Sinkal's functional currency was the stickle (§). The following transactions and events occurred during 2018: Jan. 1 Sinkal issued common stock for §1,000,000. June 30 Sinkal paid dividends of §20,000. Dec. 31 Sinkal reported net income of §80,000 for the year. Exchange rates for 2018 were: Jan.1 § 1 = $ 0.42 June 30 § 1 = $ 0.46 Dec.31 § 1 = $ 0.48 Weighted average rate for the year § 1 = $ 0.44 What was the amount of the translation adjustment for 2018? Multiple Choice $52,000 negative translation adjustment. $62,800 negative translation adjustment. $62,800 positive translation adjustment. $440,000 negative translation adjustment. $26,000 positive translation adjustment.

In: Accounting

Larry’s best friend, Garfield, owns a lasagna factory. Garfield’s financial skills are not very strong, so...

Larry’s best friend, Garfield, owns a lasagna factory. Garfield’s financial skills are not very strong, so he asked Larry to take a look at his financials. Here is the information Garfield provided to Larry for 2019.

- Sales were $23,730

- COGS were $16,780

- Depreciation was $2,840

- Interest paid was $414

- Tax rate was 35%

- The paid dividends were $616  

Garfield also gathered some balance sheet information for 2018 and 2019. The numbers are presented in the following table. December 31, 2018 December 31, 2019 Current Assets $2,940 $3,528 Net Fixed Assets $16,560 $18,840 Current Liabilities $2,592 $2,484

December 31, 2018 December 31, 2019
Current Assets $2,940 $3,528
Net Fixed Assets $16,560 $18,840
Current Liabilities $2,592 $2,484

Because Larry is very busy following the current market developments, he asked you to help him. You must

a) Compute the net income

b) Compute the operating cash flow

c) Compute the free cash flow

d) Explain and interpret the positive or negative sign of your answer in part c.

Check point: OCF = $5,511.50

In: Finance

Redox/Oxidation lab with Metals and Halogens So basically we were testing different reactions and observing changes....

Redox/Oxidation lab with Metals and Halogens

So basically we were testing different reactions and observing changes. I want to know if my data has the "right" reactions, as the supplies used in the chemistry lab were contaminated a LOT by people who used pipettes wrong. So now I'm confused.

Part A:

Each tube had 1 mL of 6M HCl. Different pieces of metal were added in each tube. Here are my results:

Tube Metal Reaction
1 Mg bubbling
2 Fe none
3 Cu heat/steam
4 Zn bubbly
5 Sn steam (?)

Part B:

Each tube had 1 mL of a designated solution and then various metals added to them (separately)

Solution Reaction
Zinc Copper Iron Magnesium Tin
AgNO3 Foggy black none dissolved dissolved
Cu(SO4) None none red dissolved none
FeSO4 orange? none none fizzy(?) none
SnCl2 foggy? none none dissolved none
Zn(NO3)2 None none none none none

Part C:

1 mL of cyclohexane and a few mL of the element-saturated water were added to different tubes. Observing color on top and on bottom (they separated)

Br2 Cl2 I2
cyclohexane layer (top) violet clear violet
water layer (bottom) red clear red

Then comparing that with testing them with different stuff...

Part D:

1 mL of NaBr, NaI or NaCl was added to various tubes of 1 mL of either bromine, chlorine or iodine saturated water. Colors were observed as top color/bottom color:

NaBr NaCl NaI
Br2 N/A violet/red violet/red
Cl2 clear/clear N/A pink/yellow
I2 violet/red/orange violet/orange N/A

Then we're supposed to write net ionic equations for every reaction in the experiment. no idea how to do that so an example would be nice. Then we're supposed to devise an activity series of the metals (plus hydrogen) listed in order of decreasing activity.

For the halogens we're supposed to do an activity series in order of decreasing strength as oxidizing agents.

I know it's a lot to ask, but I just basically want someone who knows chemistry really well to tell me the proper reactions for this, I'm having trouble finding it online but i'll continue to search.

Thanks

In: Chemistry