Name: B.
Latha Sagar
RegNo: 12204652
Roll No: 42
Section: D2212
Course Code: CAP680
Codehs link:
[Link]
source code:
package assignment;
import [Link].*;
public class Time
float hours;
float mins;
float secs;
static float totaltime2;
void callDur()
[Link]("enter call duration :");
Scanner sc=new Scanner([Link]);
[Link]("enter starting time duration :");
int callStart=[Link]();
[Link]("enter ending time duration :");
int callEnd=[Link]();
int totalTime=callEnd-callStart;
totaltime2=totalTime*60;
[Link]("Total time is :"+totalTime);
float startTime=[Link]();
float endTime=[Link]();
if(startTime==9 && endTime==11)
float callRate=totaltime2*9;
[Link]("call rate for 9-11 is :"+callRate);
else
float callRate = totalTime*10;
[Link]("call rate for other then 9-11 is :"+callRate);
public static void main(String[]args)
Time t=new Time();
[Link]();
Hours h=new Hours();
[Link]();
Min m=new Min();
[Link]();
sec s=new sec();
[Link]();
class Hours extends Time
public void hourCon()
hours= totaltime2/60;
[Link]("totalhour is :"+hours);
class Min extends Time
public void minCon()
mins=totaltime2*60;
[Link]("totalminsis :"+mins);
class sec extends Time
public void secCon()
{
secs= (totaltime2*60*60);
[Link]("totalsecs :"+secs);
Output: