Answer:
Algorithm:
1. Declare and initialize variable one_dog_year=7.
2.Ask user to give dog age.
2.1 Read the dog age and assign it to variable "dog_age".
3.Create a variable "human_age" to store the equivalent human age.
3.1 Calculate equivalent human age as "human_age=one_dog_year*dog_age".
4.Print the equivalent human age of dog age.
7. End the program.
// here is algorithm implemented in c++
#include <bits/stdc++.h>
using namespace std;
int main()
{
// initialize one dog year
int one_dog_year=7;
int dog_age;
int equi_h_age;
cout<<"Enter the dog age:";
// read the dog age
cin>>dog_age;
//calculate the equivalent human age
equi_h_age=dog_age*one_dog_year;
cout<<"equivalent human age is : "<<equi_h_age<<endl;
return 0;
}
Output:
Enter the dog age:2
equivalent human age is : 14