Enter no of hours days months years contains pattern , Programming Languages

Assignment Help:

Enter number of hours and find days, months and years.

 

echo -e "Enter Hours: \c"

read hr

echo "hour=$hr"

day=0

mon=0

yr=0

yr=`echo "$hr/365" | bc `

tmp=`echo "$hr%365" | bc`

mon=`echo "$tmp/30" |bc`

day=`echo "$tmp%30" | bc`

echo -e "$hr hours =  $yr years and  $mon months and  $day days"

 

Output

sh cnthour.sh

Enter Hours: 450

hour=450

450 hours =  1 years and  2 months and  25 days

 

sh cnthour.sh

Enter Hours: 370

hour=370

370 hours =  1 years and  0 months and  5 days

 


Related Discussions:- Enter no of hours days months years contains pattern

3-Tier Architecture in asp.net, I am getting error at business layer object...

I am getting error at business layer object in code behind page.

String cost, A string S is said to be "Super ASCII", if it contains the cha...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

C language code, Go to the following link and please do Problem 6. This is ...

Go to the following link and please do Problem 6. This is in C language. http://wikisend.com/download/304748/hw%206.pdf The code I need must be in C language and not C++ . Thank

What are program visible and invisible resisters, What are program visible ...

What are program visible and invisible resisters? A4) Program visible is those registers that can be programmed by the users, or which are customizable, whereas Program invisible

Develop an html document with a nested list, 1. Develop a Web page, indicat...

1. Develop a Web page, indicating an ordered list of the names of your five friends. 2. Develop an HTML document with a nested list indicating the content page of any book 3.

Asp.net and c#, The method should call getAllCities() and return the index ...

The method should call getAllCities() and return the index of the City that has the shortest (euclidian) distance to the. longitude and latitude passed as parameters

Algorithm for sorting lists, In this question we will de ne a function for ...

In this question we will de ne a function for sorting lists based upon the algorithm selection sort. First, de ne a function smallest which takes as input a list of integers and r

Python (using os.walk), Using os.walk, write a script that will print the f...

Using os.walk, write a script that will print the filenames of zero length files. It should also print the count of zero length files.

Transform to xhtml, While working in the eHealth Applied Research lab at Mo...

While working in the eHealth Applied Research lab at Mohawk College, you are asked to transform an xml file into an XHTML representationusing XSLT for display in a browser.The xml

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd