angle - seconds:"); deg1 = input.nextInt();...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package angles; import javax.swing.*; // For JFrame import java.awt.*; // For Color and Container import java.util.Scanner; /** * * @author */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int deg1, min1, sec1, deg2, min2, sec2, totaldeg, totalmin, totalsec, carrymin, carrydeg; final String DEGREE_SYMBOL = "º"; //<html>º</html>"; Scanner input = new Scanner(System.in); System.out.println("Enter the first angle in degrees, minutes, and
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: seconds:&quot;); deg1 = input.nextInt(); min1 = input.nextInt(); sec1 = input.nextInt(); System.out.println(&quot;Enter the second angle in degrees, minutes, and seconds:&quot;); deg2 = input.nextInt(); min2 = input.nextInt(); sec2 = input.nextInt(); totalsec=(sec1+sec2)%60; carrymin=(sec1+sec2)/60; totalmin=(min1+min2+carrymin)%60; carrydeg=((min1+min2)/60)+carrymin; totaldeg=(deg1+deg2+carrydeg)%360; System.out.println(&quot;The sum of your angle is: &quot;+totaldeg +DEGREE_SYMBOL +&quot; &quot;+totalmin +&quot;\' &quot;+totalsec+&quot;\&quot;&quot;); } }...
View Full Document

This homework help was uploaded on 04/07/2008 for the course CSCI 161 taught by Professor Webster during the Spring '08 term at Millersville.

Ask a homework question - tutors are online