InputString - String lastName = wordin.next(); S...

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

View Full Document Right Arrow Icon
// File: InputString.java // Course: CSC 211 // Author: Greg Ware // Date: January 31, 2011 // Purpose: Module 3 Program / import java.util.*; i public class InputString { public static void main(String[] args) { //int age is already defined in main string. //double gross annual salary already defined in main string. / final double GWS_GAS = 52.0; double year, weeks; double grossannualsalary; double grossweeklysalary; final int YTR = 65; int retirementage; int age; i Scanner wordin = new Scanner(System.in); S // Input User Information System.out.print("Input Your First Name: "); String firstName = wordin.next(); System.out.print("Input Your Last Name: ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: String lastName = wordin.next(); S System.out.print("Input Your Gross Annual Salary (in dollars): "); S grossannualsalary = wordin.nextDouble(); grossweeklysalary = grossannualsalary / GWS_GAS; g System.out.print("Input your age: "); S age = wordin.nextInt(); retirementage = YTR - age; r // Output User Information System.out.println(lastName + "," + " "+ firstName); System.out.println("Gross Weekly Salary:" + " " + "$" + grossweeklysalary); System.out.println("Number of years until retirement:" + " " + retirementage ); r } }...
View Full Document

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

Ask a homework question - tutors are online