Computer Science-C++ Programming Check

profileUser1166
SSLab11.cpp

// SSLab11.cpp : This file contains the 'main' function. Program execution begins and ends there. //Sadikshya Shrestha' Lab Assignment 11 #include<iostream> using namespace std; struct airline { string identity; int out; int off; int on; int in; }; int main() { int arrh, arrm, airbh, airbm; airline min; airline hr; cout << "enter the flight identification number\n"; cin >> hr.identity; cout << "enter the hr of the 'Out time' in military format\n"; cin >> hr.out; cout << "enter the minute of the 'Out time' in military format\n"; cin >> min.out; cout << "enter the hr of the 'Off time' in military format\n"; cin >> hr.off; cout << "enter the minute of the 'Off time' in military format\n"; cin >> min.off; cout << "enter the hr of the 'On time' in military format\n"; cin >> hr.on; cout << "enter the minute of the 'On time' in military format\n"; cin >> min.on; cout << "enter the hr of the 'In time' in military format\n"; cin >> hr.in; cout << "enter the minute of the 'In time' in military format\n"; cin >> min.in; cout << "enter the scheduled arrival hour and min\n"; cin >> arrh >> arrm; airbh = hr.off - hr.on; airbm = min.off - min.on; if (airbh > 0) cout << "The airbourne time in hours and minute is " << airbh << ":" << abs(airbm) << endl; else { airbm = (((24 - hr.off) * 60) - 3) + ((hr.on * 60) + min.on); airbh = airbm / 60; airbm = airbm % 60; cout << "The airbourne time in hours and minute is " << airbh << ":" << abs(airbm) << endl; } arrm = arrm + 15; if (arrm > 60) { arrh += 1; arrm -= 60; } if (hr.in > arrh || min.in > arrm) cout << "flight not on time\n"; else cout << "flight on time\n"; return 0; }