Guest User

Untitled

a guest
Jan 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Scanner;
  3. import java.lang.String;
  4.  
  5. public class Hardware {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Scanner in = new Scanner(System.in);
  10.  
  11. String[][] hardware = new String[2][6];
  12. int sentinel;
  13.  
  14. sentinel = 0;
  15.  
  16. do
  17. {
  18. System.out.println ("Please enter the part: ");
  19. hardware[1][sentinel+1] = in.next();
  20. System.out.println ("Please enter the coresponding part number: ");
  21. hardware[0][sentinel+1] = in.next();
  22. sentinel = sentinel + 1;
  23. }
  24. while (sentinel < 5);
  25.  
  26. System.out.println ("Part No. Item Name");
  27. System.out.println ("******** *********");
  28.  
  29. sentinel = 0;
  30. do
  31. {
  32. System.out.println (hardware[0][sentinel+1] + " " + hardware[1][sentinel+1]);
  33. sentinel = sentinel + 1;
  34. }
  35. while (sentinel < 5);
  36. }
  37. }
Add Comment
Please, Sign In to add comment