1 answer

Trying to write this in java code but I'm running into a lot of errors. package...

Question:

Trying to write this in java code but I'm running into a lot of errors.

package receipt;

public class Receipt {

   {
     
   int quantity=2, tax=7,i;
   String item="0010", description="Paper";
   double amt=1.99, amount=4.26, total=12.78,
   ("\t\t\t\t", "Receipt");
   ("Item#\t", "Description\t", "Amt\t", "Quantity\t", "Tax\t", "Amount\t");
   for(i=1;i<=3;i++)
   {
   cout<<item<<"\t"<<description<<"\t\t"<<amt<<"\t"<<quantity<<"\t\t"<<tax<<"%\t"<<amount<<endl;
   }
   cout<<"\n\t\t\t\t\t\tTotal\t"<<total<<endl;
   return;
   }}

The end result would look like this.

Receipt Item# Description Amt Quantity Tax Amount 0010 Paper 0010 Paper 0010 Paper 1.99 1.99 1.99 7% 4.26 790 4.26 7% 4.26 To

Receipt Item# Description Amt Quantity Tax Amount 0010 Paper 0010 Paper 0010 Paper 1.99 1.99 1.99 7% 4.26 790 4.26 7% 4.26 Total 12.78 Page 3

Answers

The corrected program is

package receipt;
public class Receipt {

    public static void main(String[] args)
    {
    int quantity=2, tax=7,i;
    String item="0010", description="Paper";
    double amt=1.99, amount=4.26, total=12.78;
    System.out.println("\t\t\t\tReceipt");
    System.out.println("Item#\tDescription\tAmt\tQuantity\tTax\tAmount\t");
    for(i=1;i<=3;i++)
    {
    System.out.println(item+"\t"+description+"\t\t"+amt+"\t"+quantity+"\t\t"+tax+"%\t"+amount);
    }
    System.out.println("\n\t\t\t\t\t\tTotal: \t"+total);
}
    }
   

Output

.

Similar Solved Questions

1 answer
1. What actions are being taken in your residential area regarding COVID-19? 2. What has been...
1. What actions are being taken in your residential area regarding COVID-19? 2. What has been a "look-back" you think the country, state, or your corner of the world will think twice about in the future? 3. How has COVID-19 impacted you and your family/friends? 4. What are your biggest conce...
2 answers
Arrange the haloalkanes in order of increasing reactivity in an Sn2 reaction with NaI in acetone...
Arrange the haloalkanes in order of increasing reactivity in an Sn2 reaction with NaI in acetone (least first). a. Methyl bromide b Isopropyl chloride t-butyl iodide d. Isobutyl chloride aus CH3 cиз C. Arrange the haloalkanes in order of increasing reactivity in an SN2 reaction with Nal ...
1 answer
1. If a company’s production rate (supply) exceeds the demand by customers, the company would most...
1. If a company’s production rate (supply) exceeds the demand by customers, the company would most likely from the following: Hire more production employees Purchase more production machinery Increase the price of the product Increase promotion 2. If a company’s production rate (supply...
1 answer
A firm uses capital and labor to produce output according to the production q = 4VLK...
A firm uses capital and labor to produce output according to the production q = 4VLK (a) Find the marginal product of labor (MPL) and marginal product of capital (MPK). (b) If the wage w=$1/labor-hr. and the rental rate of capital r-$4/machine-hr., what is the least expensive way to produce 16 units...
1 answer
CH 203 Organic Chemistry Infrared Spectroscopy Experiment Name 10 points Based on the following IR and...
CH 203 Organic Chemistry Infrared Spectroscopy Experiment Name 10 points Based on the following IR and NMR spectra and using the given molecular formula, formulate the structure of the compound. Identify regions of your structure that correspood to the peaks that you see in the graph below. Show you...
1 answer
Fund life & health insurance Explain carefully why this statement is true As an absolute figure,...
Fund life & health insurance Explain carefully why this statement is true As an absolute figure, the amount of an insurer’s capital and surplus has little meaning....
1 answer
O Question 19 2 s Ally Gator has an IRA with a current balance of 532.500....
O Question 19 2 s Ally Gator has an IRA with a current balance of 532.500. Ally plans to continue depositing ST.000 which earns 8%. After 40 years, what will the balance of Ally's IRA be? y who is $3,225,490 $2,519.443 $1,813,396 $ 706,047...
1 answer
Stemine the moments et and c tan laud tha momant dingram or the bcam, All conrachi...
Stemine the moments et and c tan laud tha momant dingram or the bcam, All conrachi ens ssume a rMacHons ane 8) Soline usinn mei ed3E/ Jer beam sgant monh 12 kN/m 4 nm B 4 m 12 kN/m...
1 answer
What are the zeros of f(x) = 2x2 - 2x -220?
What are the zeros of f(x) = 2x2 - 2x -220?...
1 answer
What is the equation of a line with Slope=-5 Passing through (-4,-2)?
What is the equation of a line with Slope=-5 Passing through (-4,-2)?...
1 answer
Com University at Albany MyLAlbany Portal The budgeted unit sales of Weller Company for the upooming...
com University at Albany MyLAlbany Portal The budgeted unit sales of Weller Company for the upooming fiscal year are provided below Budgeted unit sales 17,000 20,000 16,000 15,000 The company's variable selling and administrative expense per unit is $1.60. Fxed selling and administrative expense...
1 answer
D 9. The accuracy of a regression equation is based primarily on the range of the...
D 9. The accuracy of a regression equation is based primarily on the range of the values for the variables. corresponding scales of the two variables. difference in the means of the two variables. strength of association between the two variables 10. Given the regression equation Y'=5.00X+4.00, ...
1 answer
Solve the problem. Show your work and equations! Please do not show screenshots of Excel as...
Solve the problem. Show your work and equations! Please do not show screenshots of Excel as your work shown. 4. The company yesterday paid their annual dividend of $2.00 and the expected price in 2 years is $100. The dividend payment is expected to grow at 7%. i) What is the stock's required ...
1 answer
Discussion #1- SHOW YOUR WORK USING DIMENSIONAL ANALYSIS 6.) 500 ml NS IV run 75mL/h. How...
Discussion #1- SHOW YOUR WORK USING DIMENSIONAL ANALYSIS 6.) 500 ml NS IV run 75mL/h. How many milliliters will infuse in 3 hours? Discussion #3-SHOW YOUR WORK USING DIMENSIONAL ANALYSIS 1.) An IV is infusing at 80mL/h. The concentration in the IV bag is 40 mg in 200ml NS. What is the dosage rate in...
1 answer
Michelle is a 78 year old woman. she has returned to the health care center from...
michelle is a 78 year old woman. she has returned to the health care center from the hospital where she had surgery for a fractured hip. michelle is incontnent of urine, and comes back with an indwelling catheter that will remaine in place until her incision heals. you are assigned to care for her: ...
1 answer
How does the field of Public Health impact an individual personally and professionally? *Please answer in...
How does the field of Public Health impact an individual personally and professionally? *Please answer in DETAIL*...
1 answer
You have to purchase particulate emissions equipment for your fleet vehicles to meet new state regulations....
You have to purchase particulate emissions equipment for your fleet vehicles to meet new state regulations. This is a big expense to be phased in over the next 4 years. Your purchase of these pieces and their installation are financed over that time at 3.5% interest compounded quarterly. What is you...
1 answer
Score: 0 of 1 pt 4.2.9 7 of 21 (0 complete Use the data in the...
Score: 0 of 1 pt 4.2.9 7 of 21 (0 complete Use the data in the following table, which lists drive-thru order accuracy at popular fast food chains. Assume that orders are randomly selected from those included in the table Drive-thru Restaurant А с D Order Accurate 318 236 146 Order Not Ac...