Hi peeples,
I am happy to sat that i have developed a program in which you can do what you are desiring,
But i am sorry to say that i could not find you here because i forgot your name and topic.
I have programmed it a week ago but due to forgetting your name, I am sending it to you now:
Here is the code,
Copy it,
Then,
Execute it and enjoy:
/* Hey, This is the program which will give you an Exact Dynamic Output */
/* You will enter the inputs of HH MM SS and then enter the time you want */
/* to add in HH MM SS and then you will get your required output */
import java.util.*;
class TimeAddition
{
public static void main (
String[] args)
{
TimeAddition timeAddObj = new TimeAddition();
timeAddObj.insertTime();
}
public void insertTime()
{
double hoursInserted,minutesInserted,secondsInserted;
System.out.println("Please enter the time:\n");
Scanner s = new Scanner(System.in);
hoursInserted = s.nextDouble();
minutesInserted = s.nextDouble();
secondsInserted = s.nextDouble();
TimeAddition timeAddObj = new TimeAddition();
timeAddObj.addTime(hoursInserted,minutesInserted,secondsInserted);
}
public void addTime(double hoursInserted, double minutesInserted, double secondsInserted)
{
double hoursAdded,minutesAdded,secondsAdded;
System.out.println("Please enter the Time you want to add:\n");
Scanner s = new Scanner(System.in);
hoursAdded = s.nextDouble();
minutesAdded = s.nextDouble();
secondsAdded = s.nextDouble();
TimeAddition timeAddObj = new TimeAddition();
timeAddObj.resultantTime(hoursInserted,minutesInserted,secondsInserted,hoursAdded,minutesAdded,secondsAdded);
}
public void resultantTime(double hoursInserted,double minutesInserted,double secondsInserted,double hoursAdded,double minutesAdded,double secondsAdded)
{
double resultedHours;
double resultedMinutes;
double resultedSeconds;
resultedHours = hoursInserted+hoursAdded;
resultedMinutes = minutesInserted+minutesAdded;
resultedSeconds = secondsInserted+secondsAdded;
TimeAddition timeAddObj = new TimeAddition();
timeAddObj.decimalTime(resultedHours,resultedMinutes,resultedSeconds);
}
public void decimalTime(double resultedHours, double resultedMinutes, double resultedSeconds)
{
double decTime;
decTime = resultedHours+(resultedMinutes/60)+(resultedSeconds/60/60);
System.out.println("Your Required Added Time in Decimal is:\n"+decTime+" Hours...");
}
}