All pastes #2047164 Raw Edit

Someone

public java v1 · immutable
#2047164 ·published 2011-04-16 14:27 UTC
rendered paste body
import java.util.Scanner;public class Main {public static void main(String args[]) {	Scanner input = new Scanner(System.in);                   System.out.println("Enter input string");        String Full_String = input.nextLine();                // Create two substrings        int posfirstvalue = Full_String.indexOf('&'); // Either 14 or 8        String first_value = Full_String.substring(0, posfirstvalue);        System.out.println(first_value);        //int possecondvalue = Full_String.indexOf(posfirstvalue + 1);        String second_value = Full_String.substring(posfirstvalue + 1);        System.out.println(second_value);        //Find out which string is the paint cost and which is the paint cost        String area = "";        String paintcost = "";                if (first_value.substring(0, 4).equals("area")) {            area = first_value.substring(5);            paintcost = second_value.substring(10);        }        else {            area = second_value.substring(5);            paintcost = first_value.substring(10);        }                //Parse the paint cost string to get the value        double Paint_Price = Double.parseDouble(paintcost);                //Parse the Total_Square_Feet string to get the value        int Total_Square_Feet = Integer.parseInt(area);	System.out.println("Area: " + Total_Square_Feet + ".  PaintPrice: " + Paint_Price);}}