answer.
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
Triss
22 days 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:
amid [951]22 days ago
4 0

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

You might be interested in
Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWin
amid [951]

Answer:

Explanation:

public class Team {

   private String teamName;

   private int teamWins;

   private int teamLosses;

   public String getTeamName() {

       return teamName;

   }

   public void setTeamName(String teamName) {

       this.teamName = teamName;

   }

   public int getTeamWins() {

       return teamWins;

   }

   public void setTeamWins(int teamWins) {

       this.teamWins = teamWins;

   }

   public int getTeamLosses() {

       return teamLosses;

   }

   public void setTeamLosses(int teamLosses) {

       this.teamLosses = teamLosses;

   }

   public double getWinPercentage() {

       return teamWins / (double) (teamWins + teamLosses);

   }

}

7 0
1 month ago
Kathy is a senior teacher in her school. She is conducting a group discussion between parents and teachers. Her role is to ensur
Amiraneli [1052]
She facilitates the discussion.
3 0
23 days ago
Read 2 more answers
Write the state of the elements of each of the following arrays after each pass of the outermost loop of the selection sort algo
Natasha_Volkova [1026]

Answer:

Below is the explanation provided.

Elaboration:

In the first array => 8, 5, -9, 14, 0, -1, -7, 3.

  • 8, 5, -9, 14, 0, -1, -7, 3 For the first iteration, find the smallest from the first to the eighth and reposition the third element in the first place.
  • -9, 8, 5, 14, 0, -1, -7, 3 In the second round, identify the smallest from the second to eighth and adjust the penultimate element in the second slot.
  • -9, -7, 8, 5, 14, 0, -1, 3 For the third pass, find the least from third to eighth and move the second last item from that segment.
  • -9, -7, -1, 8, 5, 14, 0, 3 For the fourth pass, find the minimum from the fourth to eighth and shift the last second item from that section.
  • -9, -7, -1, 0, 8, 5, 14, 3 For the fifth pass, seek for the smallest from the fifth to eighth and place the last element from that portion.
  • -9, -7, -1, 0, 3, 8, 5, 14 For the sixth pass, identify the smallest from the sixth to eighth and shift the last second element from that group.
  • -9, -7, -1, 0, 3, 5, 8, 14 are in order now.

In the second array => 15, 56, 24, 5, 39, -4, 27, 10.

  • 15, 56, 24, 5, 39, -4, 27, 10 In the first iteration, identify the smallest item from the first to the eighth and reposition the last third item in that section.
  • -4, 15, 56, 24, 5, 39, 27, 10 In the second round, find the minimum item from second to eighth and interchange the last fourth item in that segment.
  • -4, 5, 15, 56, 24, 39, 27, 10 For the third pass, select the smallest from the third to eighth and shift the last item from that set.
  • -4, 5, 10, 15, 56, 24, 39, 27 For the fourth stage, determine the smallest from the fourth to eighth and do not shift its position as it is already sorted.
  • -4, 5, 10, 15, 56, 24, 39, 27 For the fifth iteration, check for the smallest from the fifth to the eighth and intersperse the last third item from that section.
  • -4, 5, 10, 15, 24, 56, 39, 27 For the sixth phase, find the smallest from the sixth to the eighth and exchange the last item in the sixth.
  • -4, 5, 10, 15, 24, 27, 56, 39 are in order now.
4 0
15 days ago
You have configured your firewall to authenticate a group of 100 users who are in your company. You set up the database of users
zubka84 [1067]
Network Access Control (NAC) is essential to ensure that the network is accessed only by authenticated users. It verifies the identity of users, granting network access solely to those who are verified. Various NAC solutions such as Impulse SafeConnect, Extreme Networks, ExtremeControl, Auconet BICS, ForeScout CounterACT, and Pulse Policy Secure can be integrated into the system. By implementing basic profiling, these solutions ensure that only authenticated users engage with the network. Additionally, employing encryption-decryption algorithms can enhance security. Algorithms like RSA and DES can be utilized for encrypting data from the database effectively. Once the information reaches the network component, it can be decrypted by generating the necessary key through the same algorithm. This method ensures that only authorized users can access sensitive information while also preventing data leaks during transmission due to encryption.
4 0
15 days ago
You've been given a new cell phone with a 2 gigabyte data plan. You plan to use your phone for text messages, images,
Natasha_Volkova [1026]
The correct option is "video". This is because video formats are more compact compared to text or songs, which are also subjected to lossy compression. The advantages of video encoding are more effective in handling lossy compression, and since text and audio require less information, they compress better. Videos and images necessitate high quality, therefore they are also more suitable for lossy compression.
5 0
19 days ago
Other questions:
  • In cell F15, insert a function that will automatically display the word Discontinue if the value in cell D15 is less than 1500,
    6·1 answer
  • Strlen("seven"); what is the output?
    14·1 answer
  • Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename
    6·2 answers
  • Assume that getPlayer2Move works as specified, regardless of what you wrote in part (a) . You must use getPlayer1Move and getPla
    14·1 answer
  • When performing actions between your computer and one that is infected with a virus which of the following offers no risk becomi
    5·1 answer
  • On the planet Sigma, robots excavate chunks of a very precious cristaline. These chunks can be divided into smaller part only on
    15·1 answer
  • The position of a runner in a race is a type of analog data. The runner’s position is tracked using sensors. Which of the follow
    8·1 answer
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • JAVA Write a program that first asks the user to type a letter grade and then translates the letter grade into a number grade. L
    9·1 answer
  • Although it is not a term Excel uses, how do most people think of Excel?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!