Exercise 1: Dogs mature at a faster rate than human beings. If you own a dog, you might've heard this rule: one year for Snoopy equals seven years for you. Turns out, the math isn't that simple. Dogs mature more quickly than we do early on. Here's how we can convert your dog's age into human years. The first two years of a dog's life count as 21 human years. ● Each following year counts as 4 human years. So, a one-year-old dog is 10.5 years old in human years, and a two-year-old dog is 21 years old in human years. How to write a C++ program called dog_years.cpp to calculate the age, in human years, of any dog older than 2. ● ●
Exercise 1: Dogs mature at a faster rate than human beings. If you own a dog, you might've heard this rule: one year for Snoopy equals seven years for you. Turns out, the math isn't that simple. Dogs mature more quickly than we do early on. Here's how we can convert your dog's age into human years. The first two years of a dog's life count as 21 human years. ● Each following year counts as 4 human years. So, a one-year-old dog is 10.5 years old in human years, and a two-year-old dog is 21 years old in human years. How to write a C++ program called dog_years.cpp to calculate the age, in human years, of any dog older than 2. ● ●
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image Text:Homework
Instructions: For each Exercise below, write your code in an IDE and run your code within the
IDE as well. Once you have satisfied the Exercise requirements, paste your code below under
the corresponding Exercise.
Exercise 1:
Dogs mature at a faster rate than human beings. If you own a dog, you might've heard this rule:
one year for Snoopy equals seven years for you. Turns out, the math isn't that simple. Dogs
mature more quickly than we do early on.
Here's how we can convert your dog's age into human years.
The first two years of a dog's life count as 21 human years.
●
Each following year counts as 4 human years.
So, a one-year-old dog is 10.5 years old in human years, and a two-year-old dog is 21 years old
in human years.
How to write a C++ program called dog_years.cpp to calculate the age, in human years,
of any dog older than 2.
Exercise 2:
The Pythagorean Theorem states that the hypotenuse (c) is the sum of the squares of the other
two sides (a and b). This can be written as c² = a² + b², or, since we want to extract c we
-
Va² + b²
can write C= V
●
How to Write a C++ program that will let the user input a value for the two sides (a, b),
then it calculates the hypotenuse based on the numbers it is fed, and finally outputs it
to the screen for the user to read.
Exercise 3:
The mad scientist Kelvin has mastered predicting the weather in his mountain-side meteorology
lab.
Recently, Kelvin began publishing his weather forecasts on his website, however, there's a
problem: All of his forecasts describe the temperature in Fahrenheit degrees.
How to Write a C++ program that will convert a temperature from Fahrenheit (F) to
Celsius (C). The formula is the following:
C = (F-32)* (5/9)
Where, F is temperature in Fahrenheit and C is temperature in Celsius.
Expert Solution

Introduction
As per bartleby guidelines, only one question can be answered. Please post other question separately.
This C++ program called "dog_years.cpp" calculates the age of a dog in human years based on the dog's age in dog years. It is commonly known that dogs mature at a faster rate than human beings and the conversion of dog years to human years is not a simple one-to-one ratio. The program follows the conversion formula where the first two years of a dog's life count as 21 human years and each following year counts as 4 human years. The user is prompted to enter the age of their dog in dog years and the program calculates and outputs the equivalent age in human years.
Step by step
Solved in 4 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY