All pastes #777072 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-16 14:24 UTC
rendered paste body
import java.util.*;
import java.text.*;

public class algorithm
{
         public static void main (String [] args)
         {
             Scanner sc = new Scanner(System.in);
             DecimalFormat df = new DecimalFormat("£##.##");
             String name;
             String purpose;
             int journey;
             int mileage = 0;
             
             System.out.print("What is your name? ");
             name = sc.next();
             System.out.print("Helololoooo " + name);
             System.out.print("\nWhat is the purpose of your journey? :\n(either student or other)");
             purpose = sc.next();
             if(purpose.equalsIgnoreCase("student"))
             {
                 System.out.print("What is the total mileage of your journey? ");
                 mileage = sc.nextInt();
                 System.out.print("\nYour allowance is £" + (mileage*90));
             }else
             
                {
                    
                    if(purpose.equalsIgnoreCase("other"))
                    {
                         System.out.print("What is the total mileage of your journey? ");
                         mileage = sc.nextInt();
                         System.out.print("\nYour allowance is £" + (mileage*80));
                    }
                    else
                    {
                        System.out.print("\nJourney does not qualify for allowance.");
                    }
               
                
                
                
               
                }
              
             
             
            }
            
        }