fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. // Import each required Java class
  8. import java.util.Scanner;
  9.  
  10. /**
  11.  * Week2Homework1
  12.  */
  13. public class Week2Homework1.java;
  14. {
  15. public static void main(String[] args)
  16. {
  17. // Variables to hold values
  18. int studentEMPLID = 0;
  19. double quiz1score = 0.0;
  20. double quiz2score = 0.0;
  21. double quiz3score = 0.0;
  22. int yourage = 0;
  23. double currenttempC = 0.0;
  24. double currenttempF = (9*(currenttempC/5)+32);
  25.  
  26. // Use the Scanner class to perform the same functionality
  27. Scanner scannerIn = new Scanner(System.in);
  28.  
  29. // Prompt the user to enter birth year
  30. System.out.println("Enter your Student EMPLID (0 - 999999):");
  31. // the nextInt() method scans the next int value
  32. studentEMPLID = scannerIn.nextInt();
  33.  
  34. // Prompt the user to enter birth month
  35. System.out.println("Enter your quiz1 percentage score (0.0 – 100.0): ");
  36. // the nextInt() method scans the next int value
  37. quiz1score = scannerIn.nextInt();
  38.  
  39.  
  40. // Prompt the user to enter another day of the month of birth
  41. System.out.println("Enter your quiz2 percentage score (0.0 – 100.0): ");
  42. // the nextInt() method scans the next int value
  43. quiz2score = scannerIn.nextInt();
  44.  
  45. // Prompt the user to enter latitude of home
  46. System.out.println("Enter your quiz3 percentage score (0.0 – 100.0) ");
  47. // the nextDouble() method scans the next double value
  48. quiz3score = scannerIn.nextDouble();
  49.  
  50. // Prompt the user to enter longitude of home
  51. System.out.println("Enter your age in months (0-1440): ");
  52. // the nextDouble() method scans the next double value
  53. quiz3score = scannerIn.nextDouble();
  54.  
  55. // Prompt the user to enter a GPA
  56. System.out.println("Enter the current Temperature in degrees Celsius: ");
  57. // the nextDouble() method scans the next double value
  58. currenttempC = scannerIn.nextDouble();
  59.  
  60.  
  61.  
  62. // Print the results to verify your data
  63. System.out.println("*********Thank you for entering your information ***************");
  64. System.out.println("You have entered the following data:");
  65. System.out.println("Your Student EMPLID: " + studentEMPLID );
  66. System.out.println("Quiz 1 score: " + quiz1score );
  67. System.out.println("Quiz 2 score: " + quiz2score );
  68. System.out.println("Quiz 3 score: " + quiz3score );
  69. System.out.println("Temperature in Celsius: " + currenttempC );
  70. System.out.println("Temperature in Fahrenheit: " + currenttempF );
  71.  
  72. }
  73. }
  74.  
  75.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:13: error: '{' expected
public class Week2Homework1.java;
                           ^
1 error
stdout
Standard output is empty