fork download
  1. import java.util.Scanner;
  2.  
  3. public class DavisStevenscanners
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner stdIn = new Scanner(System.in);
  8. double manufacturer;
  9. double inRadius;
  10. double outRadius;
  11. double density;
  12. double smallCircumference;
  13. double bigCircumference;
  14. double surfaceArea;
  15. double volume;
  16. double crossArea;
  17. double weight;
  18. String ymanufacturer;
  19. String sCircumference;
  20. String bCircumference;
  21. String sArea;
  22. String vol;
  23. String cArea;
  24. String wght;
  25.  
  26. System.out.println("Please enter the doughnuts manufacturer?:");
  27. manufacturer=stdIn.nextDouble();
  28. System.out.println("Please enter the internal radius of the doughnut in inches?:");
  29. inRadius=stdIn.nextDouble();
  30. System.out.println("Please enter the external radius of the doughnut in inches?:");
  31. outRadius=stdIn.nextDouble();
  32. System.out.println("Please enter the density of the doughnut?:");
  33. density=stdIn.nextDouble();
  34.  
  35. ymanufacturer="Your doughnut has the following dimensions from manufacture:"+manufacturer;
  36. System.out.println(ymanufacturer);
  37. sCircumference="The small circumference is:"+(2*3.14159265359*inRadius);
  38. System.out.println(sCircumference);
  39. bCircumference="The big circumference is:"+(2*3.14159265359*outRadius);
  40. System.out.println(bCircumference);
  41. sArea="The Surface area is:"+Math.pow(3.14159265359,2)*Math.pow(outRadius,2)-Math.pow(inRadius,2);
  42. System.out.println(sArea);
  43. vol="The Volume is:"+Math.pow(3.14159265359,2)*(inRadius+outRadius)*Math.pow(outRadius-inRadius,2)/4;
  44. System.out.println(vol);
  45. cArea="The Cross area is:"+(3.14159265359*Math.pow(outRadius-inRadius,2)/4);
  46. System.out.println(cArea);
  47. wght="The Weight is:"+(0.03609485*density*volume);
  48. System.out.println(wght);
  49. }
  50. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class DavisStevenscanners is public, should be declared in a file named DavisStevenscanners.java
public class DavisStevenscanners
       ^
Main.java:41: error: bad operand types for binary operator '-'
            sArea="The Surface area is:"+Math.pow(3.14159265359,2)*Math.pow(outRadius,2)-Math.pow(inRadius,2);
                                                                                        ^
  first type:  String
  second type: double
2 errors
stdout
Standard output is empty