Questions
this is java code package calculator; import java.util.Scanner; import java.lang.Math; public class Calculator { public static...

this is java code

package calculator;

import java.util.Scanner;

import java.lang.Math;

public class Calculator {

public static void main(String[] args) {

   double numx, numy;

Scanner scanner = new Scanner(System.in);

System.out.println(" Enter an operation :");

System.out.println("1: Addition");

System.out.println("2: Subtraction");

System.out.println("3: Multiplication");

System.out.println("4: Division");

System.out.println("5: Modulus");

System.out.println("6: Power");

System.out.println("7: Square");

System.out.println("8: Factorial");

System.out.println("9: Log");

System.out.println("10: Sin");

System.out.println("11: Absolute value");

System.out.println("12: Average Of Array Elements");

String operator = scanner.next();

System.out.println();

double output;

switch(operator)

{

case "1":

    System.out.print("Enter first number:");

/* We are using data type double so that user

* can enter integer as well as floating point

* value

*/

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

   output = sum( numx, numy);

break;

case "2":

    System.out.print("Enter first number:");

/* We are using data type double so that user

* can enter integer as well as floating point

* value

*/

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

   output = Subtraction( numx, numy);

break;

case "3":

    System.out.print("Enter first number:");

/* We are using data type double so that user

* can enter integer as well as floating point

* value

*/

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

   output = Multiplication( numx,numy);

break;

case "4":

    System.out.print("Enter first number:");

/* We are using data type double so that user

* can enter integer as well as floating point

* value

*/

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

   output = Division( numx, numy );

break;

case "5":

    System.out.print("Enter first number:");

/* We are using data type double so that user

* can enter integer as well as floating point

* value

*/

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

output =Modulus( numx,numy);

   break;

case "6":

    System.out.print("Enter first number:");

numx = scanner.nextDouble();

System.out.print("Enter second number:");

numy = scanner.nextDouble();

   output = power( numx, numy);

   break;

case "7":

   System.out.print("Enter first number:");

numx = scanner.nextDouble();

   output= Square_root( numx);

   break;

case "8":

    System.out.print("Enter first number:");

numx = scanner.nextDouble();

output=factorial( numx);

break;

case "9":

       System.out.print("Enter first number:");

     numx = scanner.nextDouble();

   output=log1( numx); // log function

   break;

case "10":

     System.out.print("Enter first number:");

     numx = scanner.nextDouble();

   output=sin1( numx); //sin finction

   break;

case "11":

     System.out.print("Enter first number:");

     numx = scanner.nextDouble();

   output=absolute( numx); //absolute function

   break;

case "12":

      

  

output= average( );

   break;

/* If user enters any other operator apart from

* then display an error message to user

*

*/

default:

System.out.printf("You have entered wrong operator");

return;

}

System.out.println(output);

}

public static double sum(double numx, double numy)

{

double sum=0;

return sum=numx+numy;

}

public static double Subtraction(double numx, double numy)

{

double sub=0;

return sub=numx-numy;

}

public static double Multiplication(double numx, double numy)

{

double Mul=0;

return Mul=numx*numy;

}

public static double Division(double numx, double numy)

{

double Division=0;

return Division=numx/numy;

}

public static double Modulus(double numx, double numy)

{

double Mod=0;

return Mod=numx%numy;

}

public static double power(double numx, double numy)

{

double output = Math.pow(numx, numy);

return output;

}

public static double Square_root(double numx)

{

double output = Math.sqrt(numx);

return output;

}

public static double factorial(double numx)

{

double factorial=1;  

for(int i = 1; i <= numx; ++i) //loop for calculation of factorial

{

// factorial = factorial * i;

factorial *= i;

}

return factorial;

}

public static double log1(double numx)

{

    double output=1;

return output=Math.log(numx);

}

public static double absolute(double numx)

{

    double output=1;

return output=Math.abs(numx);

}

public static double sin1(double numx)

{

double output=1;

return output=Math.sin(numx);

}

public static double average( )

{

    int n =1;

    Scanner scanner = new Scanner(System.in);

double total = 0;

   System.out.println("Enter size of array");

   n=scanner.nextInt();

   int i=0;

   double[] arr = new double[n];

   while(i<arr.length) // while loop for getting elements in array

   {

       System.out.print("Enter Element No."+(i+1)+": ");

   arr[i] = scanner.nextDouble();

   i++;

   }

   for(int j=0; j<arr.length; j++){ // loop to calculate sum of array

    total = total + arr[j];

}

   double average = total / arr.length;

   return average;

}

}

for this code draw High level flowchart.

In: Computer Science

Part A: A calorimeter contains 17.0 mL of water at 12.0 ?C . When 2.50 g...

Part A: A calorimeter contains 17.0 mL of water at 12.0 ?C . When 2.50 g of X (a substance with a molar mass of 42.0 g/mol ) is added, it dissolves via the reaction

X(s)+H2O(l)?X(aq)

and the temperature of the solution increases to 25.5 ?C .

Calculate the enthalpy change, ?H, for this reaction per mole of X.

Assume that the specific heat of the resulting solution is equal to that of water [4.18 J/(g??C)], that density of water is 1.00 g/mL, and that no heat is lost to the calorimeter itself, nor to the surroundings.

Express the change in enthalpy in kilojoules per mole to three significant figures.

Part B: Consider the reaction

C12H22O11(s)+12O2(g)?12CO2(g)+11H2O(l)

in which 10.0 g of sucrose, C12H22O11, was burned in a bomb calorimeter with a heat capacity of 7.50 kJ/?C. The temperature increase inside the calorimeter was found to be 22.0 ?C. Calculate the change in internal energy, ?E, for this reaction per mole of sucrose.

Express the change in internal energy in kilojoules per mole to three significant figures.

In: Chemistry

Problem 7-72BExpenditures After Acquisition Objective 3Understand the concept of depreciation. 4Compute depreciation expense using various depreciation...

Problem 7-72BExpenditures After Acquisition

Objective 3Understand the concept of depreciation.

4Compute depreciation expense using various depreciation methods.

5Distinguish between capital and revenue expenditures.

Murray’s Fish Market, a store that specializes in providing fresh fish to the Nashville, Tennessee, area, installed a new refrigeration unit in January 2018 at a cost of $27,500. The refrigeration unit has an expected life of 8 years and a residual value of $500 when installed. As the fish market’s business increased, it became apparent that renovations were necessary so that the capacity of the refrigeration unit could be increased. In January 2020, Murray’s spent $18,785 to install an additional refrigerated display unit (that was connected to the original unit) and replace the refrigeration coils. After this addition and renovation, Murray’s Fish Market estimated that the remaining useful life of the original refrigeration unit was 12 years and that the residual value was now $1,000.

Required:

  1. Compute 1 year’s straight-line depreciation expense on the refrigeration unit before the addition and renovations.

  2. Assume that 2 full years of straight-line depreciation expense were recorded on the refrigeration unit before the addition and renovations were made. Compute the book value of the refrigeration unit immediately after the renovations were made.

    Answer
  3. Compute 1 year’s straight-line depreciation expense on the renovated refrigeration unit. Round your answer to the nearest dollar.

    Answer

Problem 7-74BDisposition of Operating Assets

Objective 7Describe the process of recording the disposal of a fixed asset.

Salva Pest Control disposed of four assets recently. Salva’s accounting records provided the following information about the assets at the time of their disposal:

Asset

Cost

Accumulated Depreciation

Pump

$ 6,200

$ 4,800

Truck

18,600

17,500

Furniture

4,200

3,850

Chemical testing apparatus

6,800

4,000

The truck was sold for $2,450 cash, and the chemical testing apparatus was donated to the local high school. Because the pump was contaminated with pesticides, $500 in cash was paid to a chemical disposal company to decontaminate the pump and dispose of it safely. The furniture was taken to the local landfill.

Required:

  1. Prepare a separate journal entry to record the disposition of each of these assets.

    Answer
  2. CONCEPTUAL CONNECTION Explain how the disposals of the fixed assets would affect the current period financial statements.

In: Accounting

A glass tube (open at both ends) of length L is positioned near an audio speaker...

A glass tube (open at both ends) of length L is positioned near an audio speaker of frequency f = 600 Hz. For what values of L will the tube resonate with the speaker? (Assume that the speed of sound in air is 343 m/s.)
m (lowest possible value)
m (second lowest possible value)
m (third lowest possible value)

In: Physics

How do I stop the comma from printing at the end of Neptune? #include <iostream> using...

How do I stop the comma from printing at the end of Neptune?

#include <iostream>

using namespace std;

int main() {

string planets[] = {"Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"};

cout << "Contents in the array: ";

for(int i = 0; i < 8 ; i++) {

cout << *(planets + i) << ", ";

}

cout << endl;

return 0;

}

In: Computer Science

a) The ASCII code for the letter A is 1000001, and the ASCII code for the...

a) The ASCII code for the letter A is 1000001, and the ASCII code for the letter a is 1100001. Given that the ASCII code for the letter G is 1000111, without looking at Table 2.7, what is the ASCII code for the letter g?

b) The EBCDIC code for the letter A is 1100 0001, and the EBCDIC code for the letter a is 1000 0001. Given that the EBCDIC code for the letter G is 1100 0111, without looking at Table 2.7, what is the ASCII code for the letter g?

c) The ASCII code for the letter A is 1000001, and the ASCII code for the letter a is 1100001. Given that the ASCII code for the letter Q is 1010001, without looking at Table 2.7, what is the ASCII code for the letter q?

In: Computer Science

In my hydrolysis lab, I had to add a few drops of 6M of NaOH into...

In my hydrolysis lab, I had to add a few drops of 6M of NaOH into the .1M Fe(NO3)3 and it turned solid orange. What formula would come from that observation? Then I had to add 5mL of 6M NaOH into same solution and it was still solid orange but just more because of more NaOH added. What formula would come out of this?

Also in my hydroylis lab I had to add a few drops of 6 M NaOH into .1M AlCl3 and it turned into a solid. What would be the formula for this? After that I added 5 mL of the 6 M NaOH into the same solution and it dissolved and was clear. What formula do I write for this?

In: Chemistry

Two neutron stars are separated by a distance of 1.0x1010 m. They each have a mass...

Two neutron stars are separated by a distance of 1.0x1010 m. They each have a mass of 1.0x1030 kg and a radius of 500000 m. They are initially at rest with respect to each other. As measured from the rest frame, how fast are they moving when their separation has decreased to one-half its initial value?

___________  m/s (The correct answer for this is 81663.94319)

How fast are they moving when they collide?
___________  m/s (I can't figure out this answer.)

Please use my numbers to work out the solution. Thanks!

In: Physics

A lead pellet with a mass of 26.47 g and at an initial temperature of 89.98...

A lead pellet with a mass of 26.47 g and at an initial temperature of 89.98 °C was dropped into a beaker containing 100.0 g of water at an initial temperature of 22.50 °C. Given the sp heat capacity of water = 4.184 J/gK and of lead = 0.158 J/gK, calculate the final temperature of both the lead and the water?

In: Chemistry

what are the principal e-commerce business models Name and describe the principal e-commerce business models

what are the principal e-commerce business models

Name and describe the principal e-commerce business models

In: Operations Management

The mass of carbon in an animal bone fragment found in an archeology site is 200...

The mass of carbon in an animal bone fragment found in an archeology site is 200 g. If the bone registers an activity of 16 Bq, what is its age? Note: 12.0 g of C126 contains 6.02 x 1023 atoms and C146 / C126 ~ 1.3x10-12

In: Physics

Expected Return: Discrete Distribution A stock's return has the following distribution: Demand for the Company's Products...

Expected Return: Discrete Distribution

A stock's return has the following distribution:

Demand for the
Company's Products
Probability of This
Demand Occurring
Rate of Return if This
Demand Occurs (%)
Weak 0.1 -50 %
Below average 0.2 -8
Average 0.4 15
Above average 0.2 20
Strong 0.1 60
1.0

Calculate the stock's expected return. Round your answer to two decimal places.

  %

Calculate the standard deviation. Do not round intermediate calculations. Round your answer to two decimal places.

  %

In: Finance

What is a NOSQL database? For what types of applications would be a NOSQL database preferred...

What is a NOSQL database? For what types of applications would be a NOSQL database preferred over a relational database. Provide the name of a NOSQL database used in the real world.

In: Computer Science

1. What are the names of the parts of a UNIX command? list them, and give...

1. What are the names of the parts of a UNIX command? list them, and give a brief description of each.

2. Can multiple UNIX commands be typed on the same single command line? Explain how

3. How can you find out which utilities are available on your system for editing files? Which utilities are available for editing on your system?

4. What does the following command do? What is $PATH and echo $PATH?

5. What is the result of giving the which utility the name of a command that resides in a directory that is nor in your search path?

In: Computer Science

Section 1 How far from a -7.40 μC point charge must a 2.00 μC point charge...

Section 1

How far from a -7.40 μC point charge must a 2.00 μC point charge be placed in order for the electric potential energy of the pair of charges to be -0.500 J ? (Take the energy to be zero when the charges are infinitely far apart.)

d = ____ m   (The Answer Is Not 0.52 m)

Section 2

A point charge has a charge of 2.50×10−11 C .

Part A

At what distance from the point charge is the electric potential 84.0 V ? Take the potential to be zero at an infinite distance from the charge.

d = ___ m

Part B

At what distance from the point charge is the electric potential 25.0 V ? Take the potential to be zero at an infinite distance from the charge.

d = ___ m

In: Physics