Question: OVERVIEW: IN C + + - Create a program that will display your birthday in Spanish. Do the following tasks: C + + 1 .

OVERVIEW:
IN C++- Create a program that will display your birthday in Spanish. Do the following tasks: C++
1. Write a function to do the following:
Display all the month names
Display all of the day numbers
2. Write a function that has a month number and a day number as formal parameters.
Do the math necessary.
Generate Unknown if any parameters are out of range
Generate the combined day and month names.
In your driver code, do the following:
Call on the function in number 1
Prompt for your birthday month number
Prompt for your birthday day of month
Call on the function in number 2
Display results.
2nd part of instructions: in C++
1. Copy the coded arrays (2 lines) from the SpanishMonthsDays (below)into the program as global data.
2. Create a size constant (12) for the number of months array. Put thisbconstant in the [] for the months array.
3. Create a size constant (31) for the number of dayNames array. Put this constant in the [] for the dayNames array.
4. The constants above need to be defined before the array declarations.
In the first function.
Use a regular FOR loop to display all the months with index and month name.
Display a couple blank lines then do the following:
Use an Enhanced/Range based FOR loop to display the contents of the
dayNames. No index display is expected.
In the second function.
Subtract 1 from each of the passed parameters.
Check the month parameter to be greater or equal to zero and also less than the Months array size constant.
If the passed number is out of range - return "Unknown"
Check the day of month parameter to be greater or equal to zero and
also less than the dayNames size constant.
If the passed number is out of range - return "Unknown"
If passed data is good then return "El "+dayNames[dayOfMonthIndex]+" de "+ monthNames[monthIndex];
SpanishMonthsDays:
static string monthNames[MONTH_SIZE]={ "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto",
"septiembre", "octubre", "noviembre", "diciembre" };
static string dayNames[DAY_SIZE]={ "uno","dos","tres","cuatro","cinco","seis","siete","ocho","nueve", "diez","once",
"doce","trece","catorce","quince","dieciseis","diecisiete","dieciocho","diecinueve","veinte","veintiuno","veintidos",
"veintitros","veinticuatro","veinticinco","veintisois","veintisiete","veintiocho","veintinueve","treinta", "treinta y uno" };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!