Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Temperature
  3. {
  4.  
  5.  
  6. static int[] x = new int[7];
  7.  
  8. public static void main(String[] Args) {
  9. Scanner scan = new Scanner(System.in);
  10.  
  11. System.out.println("Enter Temperatures for the past week (seven days), one at a time");
  12.  
  13. for (int count = 0; count < x.length; count++) {
  14. x[count] = scan.nextInt();
  15. }
  16.  
  17. String[] y = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
  18. String temp = "The temperature for ";
  19.  
  20. for (int count2 = 0; count2 < x.length; count2++) {
  21. System.out.println(temp + y[count2] + " is: " + x[count2] + " degrees");
  22. }
  23. //System.out.println("dis shee werken. we code now " + one);
  24.  
  25. }
  26.  
  27. public static int belowFrezing(){
  28. int count3;
  29. for (count3 = 0; count3 < x.length; count3++) {
  30. if (x[count3] < 33) {
  31. System.out.println("The temperatures below freezing are: " + x[count3]);
  32. }
  33. }
  34. return x[count3];
  35. }
  36. /*
  37. public static int aboveHundred(){
  38. int count4;
  39. for (count4 = 0; count4 < x.length; count4++) {
  40. if (x[count4] > 100) {
  41. System.out.println("The temperatures above 100 degrees are: " + x[count4]);
  42. }
  43. }
  44. return x[count4];
  45. }
  46. /*
  47. public static int twoDays() {
  48.  
  49. }
  50. /*
  51. public static int descendTemp() {
  52.  
  53. }
  54. */
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement