5 of 6 Paper No: 1
+addJournal(journal: Journal):void
+getJournal PublisherById (id:int): String
+getAverage Price ():double
addJournal (journal: Journal):void - add
new journal into the JournalList
get.Journal PublisherById(id: int): String return the publisher in uppercase of the journal by id. If not found matching data,return "N/A"
getAveragePrice():double return the average of price of the journals in the
Journal List
Hints: to declare the JournalList class, you can use the following statement:public class JournalList extends ArrayList<Jburnal> {
}
The program output might look something like this (using the JournalList class):
The journals have been added:
The journals have been added:
100, OXFORD, 4000.00
100, OXFORD, 4000.00
101, WILL, 2000.00
101, WILL, 2000.00
102, ISI, 5000.00
102, ISI, 5000.00
103, SCOPUS, 8000.00
103, SCOPUS, 8000.00
104,SUR, 7000.00
104,SUR, 7000.00
Add a new journal:
Add a new journal:
Enter id: 105
Enter id: 105
Enter publisher:yale
Enter publisher:yale
Enter price:3000
Enter price:3000
1. Test get Journal PublisherByld
1. Test getJournal PublisherByld
2. Test getAveragePrice
2. Test getAveragePrice
Enter TC(1/2):1
Enter TC(1/2):2
Enter id: 105
OUTPUT:4833.33
Zoom
+ 100%
Close
OUTPUT: