Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class KnowlesPPP1
  4. {
  5. public static void main(String[] args)
  6. {
  7. PPP5();
  8. }
  9.  
  10. public static void PPP1()
  11. {
  12. Scanner console = new Scanner(System.in);
  13.  
  14. System.out.println("Please enter a single word.");
  15. String s = console.nextLine();
  16.  
  17. for(int i = 0; i < s.length(); i++)
  18. {
  19. System.out.println(i + " " + s.charAt(i));
  20. }
  21. }
  22.  
  23. public static void PPP2()
  24. {
  25. Scanner console = new Scanner(System.in);
  26.  
  27. System.out.println("Please enter your email.");
  28. String email = console.nextLine();
  29. System.out.println("Please enter your email again to verify");
  30. String verify = console.nextLine();
  31.  
  32. if(email.equals(verify))
  33. {
  34. System.out.println("That emails entered are a match!");
  35. }
  36. else
  37. {
  38. System.out.println("The emails entered don't match");
  39. }
  40. }
  41.  
  42. public static void PPP3()
  43. {
  44. Scanner console = new Scanner(System.in);
  45.  
  46. System.out.println("Please input the number of gallons");
  47. int gallons = console.nextInt();
  48.  
  49. System.out.println("Pounds - " + gallons * 8.35);
  50. System.out.println("Cubic Feet - " + gallons * 0.13368);
  51. System.out.println("Cubic Meters - " + gallons / 264.17);
  52. }
  53.  
  54. public static void PPP4()
  55. {
  56. Scanner console = new Scanner(System.in);
  57.  
  58. System.out.println("On a scale of 0-100, what is your WiFi signal strength?");
  59. int strength = console.nextInt();
  60.  
  61. if(strength < 0 || strength > 100)
  62. {
  63. System.out.println("Strength must be between 0 and 100!");
  64. return;
  65. }
  66.  
  67. if(strength >= 0 && strength <= 25)
  68. {
  69. System.out.println("Signal: |");
  70. }
  71.  
  72. if(strength >= 26 && strength <= 50)
  73. {
  74. System.out.println("Signal: ||");
  75. }
  76.  
  77. if(strength >= 51 && strength <= 75)
  78. {
  79. System.out.println("Signal: |||");
  80. }
  81.  
  82. if(strength >= 76 && strength <= 100)
  83. {
  84. System.out.println("Signal: ||||");
  85. }
  86. }
  87.  
  88. public static void PPP5()
  89. {
  90. Scanner console = new Scanner(System.in);
  91.  
  92. System.out.println("Enter the number of inches");
  93.  
  94. int inches = console.nextInt();
  95.  
  96. System.out.println("Centimeters - " + inches * 2.54);
  97. System.out.println("Meters - " + inches * 0.0254);
  98. System.out.println("Kilometers - " + inches * 0.0000254);
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement