Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct month{
char monthEng[10];
char monthSpan[11];
int orders;
int numberDays;
};
// put your function declarations here
int find_day(struct month *m, char *user, int day);
void intoStruct(struct month m[]);
int main(void) {
struct month months[12];
intoStruct(months);
int enter_day;
char enter_month;
int monthLeng[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const char monthschar[12][10] = { "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" };
int i=0;
// code starts here for me.
printf("What month: "); //asking for month
fflush(stdout);
scanf("%s", &enter_month);
printf("What day: "); //asking for day
fflush(stdout);
scanf("%d", &enter_day);
if(enter_day > 31 || enter_day < 1)
{
printf("The entered day of month does not exist. Which was %d", enter_day);
fflush(stdout);
}
// Checking to see if the enter_month is == to english or spanish
for(i = 0; i < 12; i++)
{
if(strcmp(enter_month, monthschar[i]) == 0)
{
strcpy(monthschar[i], enter_month);
printf("The month %s", enter_month);
fflush(stdout);
}
else if(strcmp(enter_month, monthschar[i]) == 0)
{
printf("The month %s", enter_month);
}
else
{
printf("That month cannot be found either in english or in spanish, please check your spelling.");
fflush(stdout);
}
}
// Calling the functions
int findDayCount(m, enter_month, enter_day);
/* English to Spanish
*
*/
return EXIT_SUCCESS;
}
int find_day(struct month *m, char *user, int day){
}
void intoStruct(struct month m[]){
}
So what i'm trying to do is type in a month, i.e. january, and then make sure they typed in write, but then i gotta see if they typed it in spanish and see if they got it write, but if it typed it in a totally weird word like "NoMonth", then it will say "There is no month by "NoMonth" in English or in Spanish." or smething like that.... then my friend proposed that i should also say something... "January 31st the 31st day of the whole year.".... I dunno, been working on this for a bit, but I can't get around it. Can anyone help me?
Thanks