Covert age from days to years Write the pseudocode for a pro
Covert age from days to years
Write the pseudocode for a program logic that will prompts the user to enter his age in days (for example the user will enter an integer number such as 2345 or any number he/she wishes to enter).
Pass the age to a method named Convertage( ) that will convert the age from days to years and will return the result back to module main(). Assume each year is 365 days and user enters a number that is greater than 365. Module main() should display the following message:
You are …… days old that is…..years
plese do it by only pseudocode process
Solution
algorithm convertdatToyear is
input:days(number of days taken from user)
output:years(from the given days converted to years)
void function main()
{
print \"enter age in days\";
read days(integer);
while (days<365)
{
print \"enter days again greater than 365\";
read days;
}
//call the Convertage(days)
year=convertage(days);
print \"you are\" days \"days old that is \" years \"years\";
}
int function convertage(days)
{
return (days/365);
}
