JOptionPaneSalary - dollars" weeklySalary =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// File: // Author: Amber Settle // Course: CSC 211 // Purpose: A program to demonstrate formatting output for // dialog boxes / import javax.swing.JOptionPane; i public class JOptionPaneSalary { public static void main(String[] args) { final int WEEKS_IN_YEAR = 52; String firstName, lastName, sString; double weeklySalary, annualSalary; d firstName = JOptionPane.showInputDialog("Please enter your first name: "); lastName = JOptionPane.showInputDialog("Please enter your last name: "); " sString = JOptionPane.showInputDialog("Enter your weekly salary in
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dollars:"); weeklySalary = Double.parseDouble(sString); w annualSalary = weeklySalary * WEEKS_IN_YEAR; a JOptionPane.showMessageDialog(null, "Employee: " + lastName + ", " + firstName + "\n" + String.format("Weekly salary: $%10.2f\n", weeklySalary) + String.format("Annual salary: $%10.2f\n", annualSalary)); a JOptionPane.showMessageDialog(null, "Thank you for using the salary calculator."); c System.exit(0); } }...
View Full Document

This note was uploaded on 03/05/2011 for the course CSCI 384 taught by Professor Drchan during the Spring '11 term at CA Health Sciences.

Ask a homework question - tutors are online