fork(1) download
  1. package Homework1;
  2.  
  3. import java.io.InputStream;
  4.  
  5. /**
  6.  * Homework 1
  7.  * Sean Roberts
  8.  * 3/25/2017
  9.  */
  10. public class Homework1.java{
  11.  
  12. public static void main(String[] args) {
  13. int EMPLID, ageInMonths;
  14. double quiz1, quiz2, quiz3, average, temperatureInFahrenheit = 0;
  15. Scanner input = new Scanner(System.in);
  16. System.out.print("Enter your Student EMPLID :");
  17. EMPLID = input.nextInt();
  18. if (EMPLID <= 0 || EMPLID > 999999) {
  19. do {
  20. System.out.println("must be between 0-999999");
  21. System.out.print("Enter your Student EMPLID :");
  22. EMPLID = input.nextInt();
  23.  
  24. } while (EMPLID <= 0 || EMPLID > 999999);
  25. }
  26.  
  27. System.out.print("Enter your quiz1 score :");
  28. quiz1 = input.nextDouble();
  29. if (quiz1 <= 0 || quiz1 > 100) {
  30. do {
  31. System.out.println("Score must be between 0-100");
  32. System.out.print("Enter your quiz1 score :");
  33. quiz1 = input.nextDouble();
  34.  
  35. } while (quiz1 <= 0 || quiz1 > 100);
  36. }
  37. System.out.print("Enter your quiz2 score :");
  38. quiz2 = input.nextDouble();
  39. if (quiz2 <= 0 || quiz2 > 100) {
  40. do {
  41. System.out.println("Score must be between 0-100");
  42. System.out.print("Enter your quiz2 score :");
  43. quiz2 = input.nextDouble();
  44.  
  45. } while (quiz2 <= 0 || quiz2 > 100);
  46. }
  47. System.out.print("Enter your quiz3 score :");
  48. quiz3 = input.nextDouble();
  49. if (quiz3 <= 0 || quiz3 > 100) {
  50. do {
  51. System.out.println("Score must be between 0-100");
  52. System.out.print("Enter your quiz3 score :");
  53. quiz3 = input.nextDouble();
  54.  
  55. } while (quiz3 <= 0 || quiz3 > 100);
  56. }
  57. System.out.print("Enter your age :");
  58. int age = input.nextInt();
  59. if (age <= 0 || age > 120) {
  60. do {
  61. System.out.println("must be between 0-120");
  62. System.out.print("Enter your age :");
  63. age = input.nextInt();
  64.  
  65. } while (age <= 0 || age > 120);
  66.  
  67. }
  68. System.out.print("Enter the current Temperature in degrees Fahrenheit :");
  69. double temperatureInDegrees = input.nextDouble();
  70.  
  71. average = (quiz1 + quiz2 + quiz3) / 3.0;
  72. ageInMonths = (age * 12);
  73. temperatureInDegrees = ((temperatureInFahrenheit - 32) * 5) / 9;
  74.  
  75. System.out.println("***Thank you***");
  76. System.out.println("Student EMPLID: " + EMPLID);
  77. System.out.println("Quiz 1 Score: " + quiz1);
  78. System.out.println("Quiz 2 Score: " + quiz2);
  79. String quiz = null;
  80. System.out.println("Quiz 3 Score: " + quiz3);
  81. System.out.println("Average quiz score: " + average);
  82. System.out.println("Age in months: " + ageInMonths);
  83. System.out.println("Age in years: " + age);
  84. System.out.printf("Temperature in Celsius: " + temperatureInDegrees);
  85. System.out.printf("Temperature in Fahrenheit: " + temperatureInFahrenheit);
  86.  
  87. }
  88.  
  89. private static class Scanner {
  90.  
  91. public Scanner(InputStream in) {
  92. }
  93.  
  94. private int nextInt() {
  95. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  96. }
  97.  
  98. private double nextDouble() {
  99. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  100. }
  101. }
  102.  
  103. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:10: error: '{' expected
public class Homework1.java{
                      ^
1 error
stdout
Standard output is empty