Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ thank you If you do any of the above, you will be asked to stop your test and you will have to re-take it

c++ thank you

image text in transcribed

If you do any of the above, you will be asked to stop your test and you will have to re-take it at another time. PROBLEM 1 Write a function called DogAgelnHumanYears that will take one parameter: .Dog Age The function should calculate and return the age of a dog in human years using the following rules: 15 human years equals the first year of a medium-sized dog's life. Year two for a dog equals about nine years for a human. And after that, each human year would be approximately five years for a dog. Write a main program where you will create two arrays, one for dog names (strings), one for dog ages. Store the following values in the arrays: Dog Names: Max, Bolt, Cooper, Buddy, Rocky, Bear, Duke, Tucker, Bella, Luna, Lola, Sadie, Bailey, Abby. Dog Ages: 12, 1, 2, 7, 8, 16, 11, 15, 2, 3, 6, 6, 10, 4 The values stored in these arrays correspond to names and ages of some dogs. Your program should loop through the arrays to calculate the estimated age of each dog in human years (using the DogAgelnHumanYears function) and it should display the name and result, one per line. For example, the first two lines of output of your program should be: Max is 12 years old. But in human years, Max is approximately 74 years old. Bolt is 1 years old. But in human years, Bolt is approximately 15 years old

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago