Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you solve this question in c++??? CSCI 259 Problem Statement How old are you? In this lab, we will design a program to calculate

Can you solve this question in c++??? image text in transcribed
CSCI 259 Problem Statement How old are you? In this lab, we will design a program to calculate a person's age. Write a function age to calculate the age. Also write how this function would be called in your main function. Input Data Current year, 4-digit . Current month Birth year, 4-digit Birth month Output Data .Number of years and months old Getting Started 1. 2. Name your project Age Include header comments formatted as shown below (you may want to copy and paste the header from a previous lab assignment and edit it, do not forget to include the program "Course: CSCI 259, Section 1 Student Name:Jane Doe Student ID: 12345678 Lab 6 in class Due Date In keeping with the Honor Code of the School of Engineering I have neither given nor received assistance from anyone other than the instructor Program Description: 1. If you use Visual Studio, leave the line #include "stdatch-there, below it type #ncludeiostream finclude using namespace std: lyou use this since the function returns multiple values 2. In the main function, declare variables needed for the program. 3. Prompt the user for current year, current month, birth year, and birth month 4. Call the calculateAge function to get the age. 5. Define the calculateAge function Do not forget to put the function prototype at the beginning of your program Sample Output Enter today's 4-digit year: 2018 Enter today's month number: 4 Enter the 4-digit year of your birth: 1997 Enter the month number of your birth: 9 You are 20 years and 7 months old Cont'd on next page Enter today's 4-digt year: 2018 Enter today's month number: 4 Enter the 4-digit year of your birth: 1995 Enter the month number of your birth: 12 You are 22 years and 4 months 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_2

Step: 3

blur-text-image_3

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

Students also viewed these Databases questions