3) Write code in a language of your choice that checks a source file (input file in plain text format) that separates lexemes by white space and special characters. This lexical analyzer will only have tokens for special characters and alphanumeric strings. Ie: 2345 6tgbsauhd9sa67*I{OPKDSl;jaklhl Would be 2345 6tgbsauhd9sa67 * I { OPKDSl ; jaklhl

Answers

Answer 1
Answer:

Answer:

Explanation:

CODE:

import java.io.*;

class Test

{

  public static void main(String[] args) {

      File file = new File("input.txt");

 

      try{

      BufferedReader b = new BufferedReader(new FileReader(file));

     

      String line;

      while ((line = b.readLine()) != null)

      {

          for(int i=0;i<line.length();i++)

          {

              char c=line.charAt(i);

              if((c>='A' && c<='Z') || (c>='a' && c<='z') || (c>='0' && c<='9'))   //check if char is digit or alphabet

                  System.out.print(c);

              else

                  System.out.println("\n"+c);

          }

      }

      }

      catch(Exception e)

      {

          System.out.println(e);

      }

     

}

 

}


Related Questions

The risk premium for exposure to aluminum commodity prices is 4%, and the firm has a beta relative to aluminum commodity prices of .6. The risk premium for exposureto GDP changes is 6%, and the firm has a beta relative to GDP of 1.2. If the risk-free rate is 4%, what is the expected return on this stock?A.14.4 percentB.10.0 percentC.13.6 percentD.11.5 percent Please show work
McBride and Associates employs two professional appraisers, each having a different specialty. Debbie specializes in commercial appraisals and Tara specializes in residential appraisals. The company expects to incur total overhead costs of $378,210 during the year and applies overhead based on annual salary costs. The salaries and billable hours of the two appraisers are estimated to be as follows:Debbie Tara Annual Salary $ 150,000 $ 81,000 Billable Hours 2,000 1,800 The accountant for McBride and Associates is computing the hourly rate that should be used to charge clients for Debbie and Tara’s services. The hourly billing rate should be set to cover the total cost of services (salary plus overhead) plus a 20 percent markup.Required:(1) Compute the predetermined overhead rate.(2) Compute the hourly billing rate for Debbie and Tara. (Do not round your intermediate calculations.)
Which of the following is an example of a middle manager?Teller at a bankO Director of marketingO Chief executive officerO Salesperson in a retail store
Gilberto Company currently manufactures 65,000 units per year of one of its crucial parts. Variable costs are $1.95 per unit, fixed costs related to making this part are $75,000 per year, and allocated fixed costs are $62,000 per year. Allocated fixed costs are unavoidable whether the company makes or buys the part. Gilberto is considering buying the part from a supplier for a quoted price of $3.25 per unit guaranteed for a three-year period. Calculate the total incremental cost of making 65,000 and buying 65,000 units. Should the company continue to manufacture the part, or should it buy the part from the outside supplier?
What relationship exists between financial institutions and financial markets? g

Clayborn Company deposits all cash receipts on the day they are received and makes all cash payments by check. At the close of business on May 31, its Cash account shows a debit balance of $24,525. Clayborn's May bank statement shows $21,800 on deposit in the bank. Determine the adjusted cash balance using the following information: Deposit in transit $ 7,450 Outstanding checks $ 6,100 Bank service fees, not yet recorded by company $ 100 A NSF check from a customer, not yet recorded by the company $ 1,275 The adjusted cash balance should be:

Answers

Answer:

Clayborn Company

The adjusted cash account balance (debit) should be:

$23,150

Explanation:

a) Data and Calculations:

Cash account balance (debit) $24,525

Bank Statement balance $21,800

Reconciliation issues:

Deposit in transit $ 7,450

Outstanding checks $ 6,100

Bank service fees, not yet recorded by company $ 100

A NSF check from a customer, not yet recorded by the company $ 1,275

b) Adjusted Cash balance:

Cash account balance (debit)  $24,525

NSF check                                     (1,275)

Bank service fees                           (100)

Adjusted cash balance (debit) $23,150

c) Adjusted Bank Statement balance:

Bank Statement balance   $21,800

Deposit in transit                   7,450

Outstanding checks             (6,100)

Adjusted bank statement $23,150

Final answer:

The adjusted cash balance is calculated by adjusting the company's book balance for deposits in transit and outstanding checks, and then subtracting the bank service fees and the amount of the NSF check. The final adjusted cash balance for Clayborn Company on May 31 is $24,500.

Explanation:

To determine the adjusted cash balance for Clayborn Company, we must consider the cash balance according to the company's books, the deposit in transit, the outstanding checks, the bank service fee, and the NSF check. The books report a debit balance of $24,525, but we need to adjust this amount for the deposit in transit and the outstanding checks. Adding the deposit in transit of $7,450 gives us $31,975. Subtracting the outstanding checks of $6,100 results in an adjusted balance of $25,875.

Next, we have to account for the bank service fees and the NSF check from a customer, both of which were not yet recorded by the company. The bank service fees of $100 and the NSF check of $1,275 decrease our balance, so subtracting these from the $25,875 gives us the final adjusted cash balance of $24,500.

Learn more about Adjusted Cash Balance here:

brainly.com/question/33452685

#SPJ3

Parent company X and subsidiary company Y file a calendar year consolidated federal income tax return. Company X reported a $120,000 tax loss, which included a $10,000 dividend from Y. Company Y reported $140,000 of taxable income, which included $30,000 of dividends received from less than 20% owned stock investments. Neither company took into account any applicable dividends received deduction. What is the group's consolidated tax loss for the year

Answers

Answer:

The adjusted tax loss of the group is $11000

Find detailed computation in the attached spreadsheet.

Explanation:

The the tax loss of the of parent company X needs to be adjusted for inter-company dividends of $10000.By eliminating the dividends,the loss becomes $130,000.

On other hand,the profit of company Y needs to be adjusted as well for 70% dividends-received deduction,by eliminating 70% of $30000 dividends received, which amounts to $21000.

By deducting the $21000 from $140000 taxable income,taxable income drops to $119000.

On aggregation, the adjusted tax loss of parent and adjusted taxable income of subsidiary gives $11000 tax loss.

Beamish Inc., which produces a single product, has provided the following data for its most recent month of operations: Number of units produced 6,400 Variable costs per unit: Direct materials $ 60 Direct labor $ 54 Variable manufacturing overhead $ 4 Variable selling and administrative expense $ 17 Fixed costs: Fixed manufacturing overhead $ 236,800 Fixed selling and administrative expense $ 492,800 There were no beginning or ending inventories. The absorption costing unit product cost was:

Answers

Answer:

$155 per unit

Explanation:

Calculation for what The absorption costing unit product cost was:

Using this formula

Absorption costing unit product cost = Direct material + Direct labour + Variable manufacturing overheads + (Fixed manufacturing overheads / Number of units produced)

Let plug in the formula

Absorption costing unit product cost = $60+ $54+ $4 + ( $ 236,800/6,400 )

Absorption costing unit product cost =$60+ $54+ $4 + $37

Absorption costing unit product cost = $155 per unit

Therefore The absorption costing unit product cost was:$155 per unit

A project with an initial cost of $51,400 is expected to generate annual cash flows of $16,910 for the next 5 years. What is the project's internal rate of return

Answers

Answer:

19.27%

Explanation:

Internal rate of return is the discount rate that equates the after tax cash flows from an investment to the amount invested

IRR can be calculated with a financial calculator  

Cash flow in year 0 =  $-51,400

Cash flow each year from year 1 to 5 = $16,910

IRR = 19.27%

To find the IRR using a financial calculator:

1. Input the cash flow values by pressing the CF button. After inputting the value, press enter and the arrow facing a downward direction.

2. After inputting all the cash flows, press the IRR button and then press the compute button.  

Depletion is: Multiple Choice The process of allocating the cost of natural resources to the period when it is consumed. Calculated using the double-declining balance method. Also called amortization. An increase in the value of a natural resource when incurred. oo The process of allocating the cost of intangibles to periods when they are used.

Answers

Depletion is the process of allocating the cost of natural resources to the period when it is consumed.

What is the significance of depletion?

Depletion can be regarded the lowering down in the level of quantity of a thing or an element, generally due to consumption, in such a way that a few costs are incurred upon such lowered quantity-levels.

In simple words, depletion can be regarded as the incurring of costs upon the reduction of a quantity of something. In the above case, the quantity of natural resources is reduced, causing depletion.

Hence, option A holds true regarding depletion.

Learn more about depletion here:

brainly.com/question/11318086

#SPJ2

The Silver Corporation uses a predetermined overhead rate to apply manufacturing overhead to jobs. The predetermined overhead rate is based on labor cost in Department A and on machine-hours in Department B. At the beginning of the year, the Corporation made the following estimates: Department A Department B Direct labor cost $ 60,000 $ 40,000 Manufacturing overhead $ 90,000 $ 45,000 Direct labor-hours 6,000 9,000 Machine-hours 2,000 15,000 What predetermined overhead rates would be used in Department A and Department B, respectively?

Answers

Answer:

Instructions are below.

Explanation:

Giving the following information:

Department A:

Direct labor cost= $60,000

Manufacturing overhead= $90,000

Department B:

Manufacturing overhead= $45,000

Machine-hours= 2,000

To calculate the predetermined manufacturing overhead rate we need to use the following formula:

Predetermined manufacturing overhead rate= total estimated overhead costs for the period/ total amount of allocation base

Department A:

Predetermined manufacturing overhead rate= 90,000/60,000

Predetermined manufacturing overhead rate= $1.5 per direct labor dollar

Department B:

Predetermined manufacturing overhead rate= 45,000/2,000= $22.4 per machine-hour

Other Questions