Response:
Procedure:
1. Define and set the variable one_dog_year to 7.
2.Request the user to input the dog's age.
2.1 Capture the entered dog age and store it in variable "dog_age".
3.Generate a variable "human_age" for the corresponding human age.
3.1 Compute the equivalent human age using the formula "human_age=one_dog_year*dog_age".
4.Display the calculated human age that corresponds to the dog's age.
7. Conclude the program.
// following is the algorithm executed in c++
#include <bits/stdc++.h>
using namespace std;
int main()
{
// set one dog year
int one_dog_year=7;
int dog_age;
int equi_h_age;
cout<<"Enter the dog age:";
// get the dog age
cin>>dog_age;
//determine the corresponding human age
equi_h_age=dog_age*one_dog_year;
cout<<"equivalent human age is: "<<equi_h_age<<endl;
return 0;
}
Result:
Enter the dog age:2
equivalent human age is: 14