-
Notifications
You must be signed in to change notification settings - Fork 14
/
book.cs
77 lines (60 loc) · 1.8 KB
/
book.cs
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
68
69
70
71
72
73
74
75
76
77
using System;
using System.IO;
using System.Collections.Generic;
// Names:
// Help from:
/* Help details:
*/
namespace IntroCS
{
/// A class that maintains information on a book.
public class Book
{
private String title;
private String author;
private int year; // of publication
public Book(String title, String author, int year)
{ //code
}
/// Return the title.
public String GetTitle()
{
return "Not coded"; //just so skeleton compiles
}
/// Return the author.
public String GetAuthor()
{
return "Not coded"; //just so skeleton compiles
}
/// Return the year of publication.
public int GetYear()
{ // code!
return 0; //just so skeleton compiles
}
/// Return a multi-line String labeling all Book information.
public override string ToString()
{
return "Not coded"; //just so skeleton compiles
}
////////////////////////////////////
// Extra credit methods hereafter //
////////////////////////////////////
// extra credit Book chunk
/// Construct a Book, taking data from reader.
/// Read through three lines that contain the
/// title, author, and year of publication, respectively.
/// There may be an extra blank line at the beginning.
/// If so ignore it.
/// Nothing beyond the line with the year is read.
public Book(StreamReader reader)
{ // code for extra credit!
}
// extra credit IsEqual chunk
// Return true if all the corresponding fields in this Book
// and in aBook are equal. Return false otherwise.
public bool IsEqual(Book aBook)
{ // code for extra credit
return true; //so skeleton compiles
}
}
}