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
Write a function to do the following:
Display all the month names
Display all of the day numbers
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
Prompt for your birthday month number
Prompt for your birthday day of month
Call on the function in number
Display results.
nd part of instructions: in C
Copy the coded arrays lines from the SpanishMonthsDays belowinto the program as global data.
Create a size constant for the number of months array. Put thisbconstant in the for the months array.
Create a size constant for the number of dayNames array. Put this constant in the for the dayNames array.
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 EnhancedRange based FOR loop to display the contents of the
dayNames. No index display is expected.
In the second function.
Subtract 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 dayNamesdayOfMonthIndex de monthNamesmonthIndex;
SpanishMonthsDays:
static string monthNamesMONTHSIZE "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto",
"septiembre", "octubre", "noviembre", "diciembre" ;
static string dayNamesDAYSIZE "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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
