1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tester [92]
3 years ago
8

Create an algorithm that will convert dog years to human years using the assumption that 1 dog year = 7 human years. Prompt the

user to enter the dog’s age in years. Multiply the dog’s age by 7 to calculate the human age equivalent of the dog’s age. For example, if a dog’s age is 2, the calculation should be human age equivalent = 2 * 7, which evaluates to the human equivalent of 14 years old. Output the result to the screen. Write the algorithm using pseudocode, and create a desk check using at least one set of test data.
Computers and Technology
1 answer:
matrenka [14]3 years ago
4 0

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

You might be interested in
Which among the following is a fraudulent or deceptive act designed to trick individuals into spending time or money for little
ivanzaharov [21]

Answer:

A. Internet scams.

Explanation:

Internet scams is a fraudulent or deceptive act designed to trick individuals into spending time or money for little or no return through the use of a cloud service or the internet. Some examples of an internet scam are phishing scams, email spams, credit card scam, etc. It is simply centred around the provision of false information or misrepresentation of another party for the sole purpose of theft.

Hence, an internet scam is an illegal means of obtaining things from people and such is a cyber crime that is punishable by law.

6 0
3 years ago
When you pass an array to a method, the method receives ________?
lianna [129]
The Reference of the array.
4 0
3 years ago
Where is NumPy used?
Svetradugi [14.3K]

Explanation:

The ndarray (NumPy Array) is a multidimensional array used to store values of same datatype. These arrays are indexed just like Sequences, starts with zero.

7 0
4 years ago
Read 2 more answers
I'm new to Brainly can i get a brief explanation as to how to answer questions
Evgesh-ka [11]

Answer:you need to create an accoun. Then you can ask and answer question.

Explanation:

6 0
4 years ago
Read 2 more answers
What are some of the risks of using social networking sites?
lana66690 [7]
You face the risk of a stalker and or someone finding out your personal information and using it against you. Be careful on social media
6 0
4 years ago
Other questions:
  • Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The me
    8·2 answers
  • In a digital drawing program, when an object is highlighted, boxes appear at the sides and corners. These boxes can be grabbed a
    13·1 answer
  • What feature would be used to collect how many times users downloaded a product catalog?
    11·1 answer
  • 5. How is shutter speed generally measured? What do the measurements mean?
    7·2 answers
  • Which statement regarding socializers is true?
    10·2 answers
  • True or false? pressing Ctrl and S is a shortcut for saving
    15·2 answers
  • LILLE VIC LUNCUL ANCI.
    5·1 answer
  • What gonna happened if you put rice water in your hair
    8·1 answer
  • Write a static method that takes a String and returns an integer. Return the number of characters in the passed in, String param
    6·1 answer
  • What two solutions address lack of human access to clean water
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!