Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Question1 {
  4.     public static void main(String args[]){
  5.        
  6.         Scanner spamDetails = new Scanner(System.in);
  7.        
  8.         System.out.println("Enter full name:");
  9.         String firstName = spamDetails.next();
  10.         String lastName = spamDetails.next();
  11.        
  12.         spamDetails.nextLine();
  13.  
  14.        
  15.         System.out.println("Enter sum of money in USD:");
  16.         int amountOfMoney = spamDetails.nextInt();
  17.        
  18.  
  19.         spamDetails.nextLine();
  20.        
  21.         System.out.println("Enter country name:");
  22.         String cntryName = spamDetails.nextLine();
  23.        
  24.        
  25.        
  26.        
  27.         //Variable to calculate 15% of money.
  28.         int fifteenPercent = (int) (0.15 * amountOfMoney);
  29.        
  30.         //Printing the output message.
  31.         System.out.println("Dearest "+ firstName);
  32.         System.out.println("It is with a heavy heart that I inform you of the death of my father,");
  33.         System.out.println("General Fayk " + lastName + ", your long lost relative from Mapsfostol.");
  34.         System.out.println("My father left the sum of " + amountOfMoney + "USD for us, your distant cousins.");
  35.         System.out.println("Unfortunately, we cannot access the money as it is in a bank in " + cntryName + ".");
  36.         System.out.println("I desperately need your assistance to access this money.");
  37.         System.out.println("I will even pay you generously, 15% of the amount - " + fifteenPercent + "USD,");
  38.         System.out.println("for your help.  Please get in touch with me at this email address asap.");
  39.         System.out.println("Yours sincerely");
  40.         System.out.println("Arnrial " + lastName);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement