climate temperature

I don't know where went wrong can somebody help me

my menu.c
#include <stdio.h>
#include <conio.h>
extern int Jan13Max,Jan13Min,Jan13Mean,Jun13Max,Jun13Min,Jun13Mean,Dec13Max,Dec13Min,Dec13Mean[];

void showMenu(void)
{
puts("A: Enter the selected month and day:\n");
puts("B: Display lowest temperature of the selected month:\n");
puts("C: Display number of "hot" days for the selected month:\n");
puts("D: Display mean temperature for the selected month.\n");
puts("E: Display the month with the most "hot" days:\n");
puts("F: Display the maximum, minimum and mean temperatures for any selected day:\n");
puts("G: Display the highest range temperature in the month selected:\n");
puts("H: Display the hottest day for the selected month:\n");
puts("Q: Exit selected month records.\n");
putch('\n');
}
void displowestTemp(void)
{
int i;
int day;
int month;
{
printf("Lowest temperature of the selected month:");
printf("%5d",month)
}putch('\n');
}
void dispHighestRangeTemp(void)
{
int i;
int day;
int month;
{
float highest temperature;
float lowest temperature;
highest range=0;
for(i=0;i<31;i++) highest range=highest temperature[i]-lowest temperature[i]; //display in one line 5 spaces per value
printf("Class highest range temp = %.1f\n", highest range);
}putch('\n');
}
void disphottestDay(void)
{
int i;
int month;
int day;
{

printf("the hottest day for the selected month:");
printf("%5d",day);

}putch('\n');
}

void dispMeanTemp(void)
{
int i;
int day;
int month;
{
printf("Mean temperature for the selected month:");
printf("%5d",month);

}putch('\n');
}
void dispMostHotDays(void)
{
int i;
int day;
int month;
{
printf("The month with the most "hot" days:");
printf("%5d",month);
}putch('\n');
}

void dispnumberOfHotDays(void)
{
int i;
int day;
int month;
{
printf("Number of "hot" days for the selected month:");
printf("%5d",day);
}putch('\n');
}
void enterMonthDay(void)
{
int i;
int day=0;
int month=0;

{
printf("What Month do you want to display\n"); // 1. prompt -- ask user what month he wants
scanf("%d",&month); // 2. read the month that the user enters into a variable.

printf("What day do you want to display (1-31)\n"); // 3. prompt -- ask user what day he wants to display
scanf("%d",&day); // 4. read the day that the user enters into a variable.

} putch('\n');
}
void dispMaxMinMean(void)
{
int i;
int day=0;
int month=0;
{
printf("Max, Min and Mean the temperatures are :"); // 5. use the day, read the Max, Min and Mean array to extract temperatures.
printf("%5d",month); // 6. print out the temperatures.
}putch('\n');
}
my main.c
#include <stdio.h>


void showMenu(void);
void Jan13Max(void);
void Jan13Min(void);
void Jan13Mean(void);
void Jun13Max(void);
void Jun13Min(void);
void Jun13Mean(void);
void Dec13Max(void);
void Dec13Min(void);
void Dec13Mean(void);
void dispMaxMinMeanTemp(void);
void disphighestRangeTemp(void);
void dispMeanTemp(void);
void displowestTemp(void);
void dispmostHotdays(void);
void dispHottestday(void);
void getuserid(char*userid);
int chkuserid(char*userid);
void getPwd(char*pwd);
int chkPwd(char*pwd);

char systemuserid[]="cpps2014";

void main(void)
{
char useuserid[7];
int tries,status;

status=0;
tries=0;

printf("Please enter 6 numeric character userid.\n");

do
{
getuserid(useruserid);
tries++;
status=chkuserid(useruserid);
if (status==0) printf("\nIncorrect userid, try again.\n");
}while (tries<3 && status==0);

if (status==0) puts("Sorry, access denied.");
else puts("You may proceed to access temperature climate results.");
}


char systemPwd[]="a1b2c3";

void main(void)
{
char usePwd[7];
int tries,status;

status=0;
tries=0;

printf("Please enter 6 numeric character password.\n");

do
{
getPwd(userPwd);
tries++;
status=chkPwd(userPwd);
if (status==0) printf("\nIncorrect password, try again.\n");
}while (tries<3 && status==0);

if (status==0) puts("Sorry, access denied.");
else puts("You may proceed to access students' results.");
void main(void)
{
int tries, status;
char userinput;
do
{

showMenu();
userinput= getch();

switch(userinput)
{
case 'A': case 'a':
enterMonthDay();
break;
case 'B': case 'b':
displowestTemp();
break;
case 'C': case 'c':
dispnumberOfHotDays();
break;
case 'D': case 'd':
dispMeanTemp();
break;
case 'E': case 'e':
dispMostHotDays();
break;
case 'G': case 'g':
dispMaxMinMeanTemp();
break;
case 'H': case 'h':
dispHighestRangeTemp();
break;
case 'I': case 'i':
dispHottestDay();
break;
case 'Q': case 'q':
userinput='Q';
break;
default:
puts("You selected an invalid option\n");
}
}while(userinput!='Q');
my data.c
#include <stdio.h>

int Jan13Max[31]={31.4,30.5,32.0,30.5,31.8,32.5,35.2,32.7,32.1,30.0,31.0,31.4,30.8,31.0,30.9,30.3,30.7,32.0,24.8,25.4,31.1,28.2,30.9,30.7,30.7,30.7,31.0,31.0,31.3,31.2,31.5};
int Jan13Min[31]={23.9,23.1,24.2,25.0,25.2,25.2,25.2,21.6,22.4,25.0,25.9,25.4,23.6,25.4,25.9,26.1,25.2,24.3,22.6,23.6,24.1,23.7,24.6,25.4,24.3,25.0,24.7,25.3,25.2,24.9,25.2};
int Jan13Mean[31]={27.0,27.0,26.8,27.3,27.5,27.7,29.1,27.1,26.2,27.0,27.7,27.5,26.3,27.5,27.6,27.4,27.5,26.9,23.7,24.4,27.1,25.8,27.0,27.3,27.2,27.2,27.4,27.5,27.5,27.5,27.8};

int Jun13Max[31]={33.0,32.4,32.5,30.6,33.4,32.4,33.7,32.3,29.6,32.7,32.3,33.2,33.0,32.5,33.6,32.5,33.2,34.2 34.5,33.9,34.0,33.3,32.9,33.4,33.7,30.0,32.4,32.1,32.0,29.7,0.0};
int Jun13Min[31]={22.6,25.6,24.1,25.2,22.9,24.6,25.7,25.2,24.8,25.2,24.9,27.1,27.1,28.0,27.8,25.8,25.9,27.0,26.8,26.8,27.0,27.5,27.5,28.2,27.2,23.0,26.3,25.8,26.6,23.8,0.0};
int Jan13Mean[31]={27.2,28.7,28.1,27.3,27.2,28.4,28.5,27.7,27.7,28.9,29.3,29.8,29.8,29.9,30.0,29.6,29.2,30.4,30.5,29.9,30.1,30.1,30.0,30.2,29.5,27.7,28.9,28.5,28.8,27.5,0.0};

int Dec13Max[31]={28.5,26.0,30.6,28.0,31.1,29.3,30.9,29.1,31.3,30.1,31.3,31.3,31.7,32.0,31.7,33.7,32.4,32.1,29.0,28.2,29.9,31.1,27.6,29.5,30.2,30.3,30.6,30.0,29.2,29.7,28.7};
int Dec13Min[31]={24.9,24.4,23.5,23.4,24.4,22.7,23.2,23.7,24.1,25.0,25.0,25.2,25.1,23.1,21.6,24.3,24.2,21.2,22.8,23.8,23.7,24.4,23.9,25.3,25.5,24.8,25.3,25.1,24.9,24.8,24.8};
int Dec13Mean[31]={26.1,25.0,25.6,25.6,26.7,25.4,26.6,25.0,26.8,27.1,27.6,27.2,27.7,26.8,26.1,28.1,27.7,26.3,26.0,25.5,26.1,26.6,25.5,26.9,27.3,26.7,27.2,26.7,26.6,26.7,25.7};
Last edited on
You really should explain more than just "it won't work" if you want good help.
What exactly won't work?
Does it not run correctly or does it not compile? It is an important difference. If it is a compile-time error, posting the errors your compiler spits out is also helpful.

For your problem, the first error I see is on line 3 of your showMenu function, you have double quotation marks around "hot", but you need to escape these inner quotes by using \" instead of just "
http://en.cppreference.com/w/cpp/language/escape

Also, variable names cannot contain spaces. You can use underscores instead.
1
2
3
float highest_temperature;
float lowest_temperature;
highest_range=0;



And please use code tags for readability
http://www.cplusplus.com/articles/jEywvCM9/
Last edited on
Topic archived. No new replies allowed.