GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Basic-Java/ExBasicIO3.java at main · kavya-7777/Basic-Java Expand file tree/ Copy pathExBasicIO3.javaMore file actions 35 lines (29 loc) · 1.41 KB / Copy pathExBasicIO3.javaFile metadata and controls35 lines (29 loc) · 1.41 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 import java.util.Scanner; public class ExBasicIO3{ public static void main(String[] args){ Scanner obj = new Scanner(System.in); int sec = obj.nextInt(); //read the total seconds and print time format Example :hr:min:sec int hours = sec/(60*60); sec=sec%(60*60); int minutes = sec/60; int seconds = sec%60; System.out.printf("%02d:HOUR %02d:MIN %02d:SEC",hours,minutes,seconds); long Day = obj.nextLong(); //calculate number of years,weeks,remaining days for the given total days long year = Day / 365; Day = Day % 365; long week = Day / 7; long days = Day % 7; System.out.println("Number of Years:"+year); System.out.println("Number of Week:"+week); System.out.println("Number of Days:"+days); double celsius = obj.nextDouble(); //convert Celsius into Fahrenheit double fahrenheit = ((celsius * 9) / 5) + 32; System.out.printf("%.2fF", fahrenheit); double degree = obj.nextDouble(); //Convert Degree into Radian double radian = degree * (Math.PI / 180.0); System.out.printf("%.2f", radian); double inches = obj.nextDouble(); //Covert Inches into feet double feet = inches * 0.08333; System.out.printf("%.2f", feet); } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |