#include "stdafx.h"
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
using namespace std;
struct DATE{
int day;
int month;
int year;
};
struct onDutyRecords{
string name;
double sunshine;
double rainfall;
double midTemp;
DATE date;
};
onDutyRecords person;
int ShowMenu(void);
void ListDaysOnDutyOfMet(vector <onDutyRecords> &);
void ListAllTheWetDays(vector <onDutyRecords> &);
void ListDaysOnDutyOfMet(vector <onDutyRecords> &);
void ListAllTheSunnyDays(vector <onDutyRecords> &);
void ListAverageOfTwoDays(vector <onDutyRecords> &);
void ListHotestDayByMiddayTemp(vector <onDutyRecords> &);
void ListDaysWithShortestSunshine(vector <onDutyRecords> &);
void Exit(void);
bool quitFlag = false;
int _tmain(int argc, _TCHAR* argv[])
{
vector <onDutyRecords> records;
ifstream infile("Report.txt");
//what next on this line to extract file into vector?
// so i could create functions below
//what is wrong now with switch parametrs?
int option;
do
{
option = ShowMenu();
switch (option)
{
case 0:
ListDaysOnDutyOfMet();
break;
case 1:
ListAllTheWetDays();
break;
case 2:
ListAllTheSunnyDays();
break;
case 3:
ListAverageOfTwoDays();
break;
case 4:
ListHotestDayByMiddayTemp();
break;
case 5:
ListDaysWithShortestSunshine();
break;
case 6:
Exit();
break;
default:
cout << "invalid option\n";
}
} while (!quitFlag);
return 0;
}
int ShowMenu(void)
{
int option;
cout << "\n\n\n";
cout << "\t0. Do Days On Duty Of Meteorologist\n";
cout << "\t1. Display All The Wet Days\n";
cout << "\t2. All The Sunny Days\n";
cout << "\t3. Average Of Two Days\n";
cout << "\t4. Hotest Day By Midday Temp\n";
cout << "\t5.\tDays With Shortest Sunshine\n";
cout << "\t6. Exit\n";
cout << "\t\tEnter option : ";
cin >> option;
cout << endl << endl;
return option;
}
void ListDaysOnDutyOfMet(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void ListAllTheWetDays(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void ListAllTheSunnyDays(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void ListAverageOfTwoDays(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void ListHotestDayByMiddayTemp(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void ListDaysWithShortestSunshine(vector <onDutyRecords> &dOnDuty)
{
cout << "Not impl";
}
void Exit(void)
{
cout << "Not impl";
}
aluhnev 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.