Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Add a Blank Line oin JAVA output

Avatar of Robert Ehinger
Robert EhingerFlag for United States of America asked on
JavaWeb Servers
3 Comments1 Solution1144 ViewsLast Modified:
Here is my current code for a currency conversion program. I would like to add a blank line between each of the output statements. How can I do that?



Chapter 3:      Bill's Burgers Sales Tax Calculator
Programmer:      Robert Ehinger
Date:            February 19, 2010
Filename:      CurrencyConversion.java
Purpose:       This projects calculates the sales tax on orders placed at Bill's Burger Front Counter.


import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class CurrencyConversionApplet extends Applet implements ActionListener

            //construct components
            Label welcomeLabel = new Label("Welcome to the Currency Conversion Calculator");
            Label costDollarsLabel = new Label("Please enter the number of dollars you want to convert: ");
                  TextField costDollarsField = new TextField (5);

            Button calcButton = new Button("Calculate");
            Label poundsLabel = new Label("Click the Calculate button to display the converted values.");
            Label eurosLabel = new Label();
            Label rublesLabel= new Label();
            //declare variables
      Image logo; //declare an image object

            public void init()
                  logo = getImage(getDocumentBase(), "logo.gif");
            public void actionPerformed(ActionEvent e)
double costDollars=Double.parseDouble(costDollarsField.getText());

//Declare variable

            double Dollars;
            double pounds;
            double euros;
            double rubles;

poundsLabel.setText("Your currency is equivalent to " + Math.round(Dollars*0.646329) + " pounds.");

eurosLabel.setText("Your currency is equivalent to " + Math.round(Dollars*0.735673) + " euros.");

rublesLabel.setText("Your currency is equivalent to " + Math.round(Dollars* 29.950) + " rubles.");

Avatar of robthewolf
robthewolfFlag of Israel image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers