Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cstring>
- //#include "STORMS_H"
- #include "storms.h"
- using namespace std;
- // int MAX_STORMS = 26;
- STORM Storm[] = {};
- // int index = 0;
- void printStorm(){
- int count = 0;
- for (int i = 0; i < count +1; i++){
- cout << Storm[i].NAME << " " << Storm[i].STORM_YEAR << " " << Storm
- [i].STORM_MONTH << " " << Storm[i].STORM_DAY << " " << Storm[i].TYPE << " " <<
- Storm[i].STORM_CAT << " " << Storm[i].MAX_SPEED;
- }
- }
- STORM fillStormList(struct STORM Storm[], ifstream &infile){
- for (int i = 1; i <= 26 ; i++){
- infile >> Storm[i].NAME;
- infile >> Storm[i].STORM_MONTH;
- infile >> Storm[i].STORM_YEAR;
- infile >> Storm[i].STORM_DAY;
- infile >> Storm[i].TYPE;
- infile >> Storm[i].STORM_CAT;
- infile >> Storm[i].MAX_SPEED;
- // getStormName(inFile, Storm.NAME);
- // getStormYear(inFile, Storm.STORM_YEAR);
- // getStormMonth(inFile, Storm.STORM_MONTH);
- // getStormDay(inFile, Storm.STORM_DAY);
- // getStormType(inFile, Storm.TYPE);
- // getStormCat(inFile, Storm.STORM_CAT);
- // getStormMaxSpeed(inFile, Storm.MAX_SPEED);
- }
- return *Storm;
- }
- void initStorm(char NAME[], int STORM_YEAR, int STORM_MONTH, int STORM_DAY,
- char TYPE[], int STORM_CAT, int MAX_SPEED) {
- strcpy(Storm[0].NAME, NAME);
- cin.ignore(100, ' ');
- Storm[0].STORM_YEAR = STORM_YEAR;
- Storm[0].STORM_MONTH = STORM_MONTH;
- Storm[0].STORM_DAY = STORM_DAY;
- strcpy(Storm[0].TYPE, TYPE);
- cin.ignore(100, ' ');
- Storm[0].STORM_CAT = STORM_CAT;
- cin.ignore(100, ' ');
- Storm[0].MAX_SPEED = MAX_SPEED;
- }
- void getStormName(ifstream &infile, char NAME[]){
- infile.getline(NAME, MAX_CHAR);
- }
- void getStormYear(ifstream &infile, int STORM_YEAR){
- infile >> STORM_YEAR;
- }
- void getStormMonth(ifstream &infile, int STORM_MONTH){
- infile >> STORM_MONTH;
- }
- void getStormDay(ifstream &infile, int STORM_DAY){
- infile >> STORM_DAY;
- }
- void getStormType(ifstream &infile, char TYPE[]) {
- infile.getline(TYPE, 20);
- }
- void getStormCat(ifstream &infile, int STORM_CAT){
- infile >> STORM_CAT;
- }
- void getStormMaxSpeed(ifstream &infile, int MAX_SPEED){
- infile >> MAX_SPEED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement