Computer Science, asked by nupur4567, 1 year ago

Use the get_seconds function to work out the amount of seconds in 2 hours and 30 minutes, then add this number to the amount of seconds in 45 minutes and 15 seconds. Then print the result.

Answers

Answered by prashantrohilla32
1

public class Main

{ static int s;

   public static int get_seconds(int a,int b,int c)

   {  int seconds;

       seconds=(3600*a)+(60*b)+c;

       return seconds;

   }

   

   public static int add_seconds(int d,int e,int f)

   {  int secondss;

       secondss=(3600*d)+(60*e)+f;

       return secondss;

   }

 

public static void main(String[] args) {

 

s=get_seconds(2,30,0)+add_seconds(0,45,15);

System.out.println(s+" Seconds");

 

}

}

Attachments:
Answered by shoumiksam
14

Answer:

def get_seconds(hours, minutes, seconds):

 return 3600*hours + 60*minutes + seconds

amount_a = get_seconds(2, 30,0)

amount_b = get_seconds(0,45,15)

result = amount_a + amount_b

print(result)

Explanation:

Crash Course on Python>  Week 2>  Returning Values.

Similar questions