-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbookdetail.cpp
67 lines (51 loc) · 1.1 KB
/
bookdetail.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <bits/stdc++.h>
using namespace std;
struct books
{
char title[25];
char pub[25];
int year;
int status;
};
int main()
{
int i, n;
cout<<"Enter Number Of Books : ";
cin>>n;
struct books a[n];
cout<<"Enter The Book Details : \n";
cout<<"-------------------------\n";
for(i=0;i<n;i++)
{
cout<<"Title : ";
cin>>a[i].title;
cout<<"Publication : ";
cin>>a[i].pub;
cout<<"Year : ";
cin>>a[i].year;
cout<<"Status : ";
cin>>a[i].status;
cout<<"----------------------\n";
}
cout<<"=====================================================\n";
cout<<"Book Title \t|Publication \t|Year \t\t|Status\n";
cout<<"=====================================================\n";
for(i=0;i<n;i++)
{
cout<<"\n"<<a[i].title<<"\t\t|"<<a[i].pub<<"\t\t|"<<a[i].year<<"\t\t|";
if(a[i].status <=1990)
{
cout<<"Outdated";
}
else if(a[i].status >= 1991 && a[i].status <=2000)
{
cout<<"Medium";
}
else
{
cout<<"Lates";
}
}
cout<<"\n\n=================================================";
return 0;
}