Professional Documents
Culture Documents
P8.1
P8.2
/**
This class models a tally counter.
*/
public class Counter
{
private int value;
private int max;
/**
Gets the current value of this counter.
@return the current value
*/
public int getValue()
{
return value;
}
/**
Advances the value of this counter by 1.
*/
public void count()
{
value = value + 1;
if (value >= max)
{
System.out.println("Limit exceeded");
reset();
}
}
/**
Resets the value of this counter to 0.
P8.3
import java.util.Scanner;
/**
A class that keeps track of a dynamic menu.
*/
public class Menu
{
private String menuItems;
private int optionCount;
private Scanner in;
/**
Constructs a menu with no options.
*/
public Menu()
{
menuItems = "";
optionCount = 0;
in = new Scanner(System.in);
}
/**
Adds an option to the end of this menu.
@param option the option to add
*/
public void addOption(String option)
{
optionCount++;
menuItems = menuItems + optionCount + ") " + option + "\n";
}
/**
Displays the menu, with options numbered starting with 1,
and prompts the user for input. Repeats until a valid input
is supplied.
@return the number that the user supplied
*/
public int getInput()
{
int input;
do
{
System.out.print(menuItems);
input = in.nextInt();
}
while (input < 1 || input > optionCount);
return input;
P8.4
/**
A class to keep track of, print, and compare addresses with and
without apartment numbers.
*/
public class Address
{
private String houseNumber;
private String apartmentNumber;
private String street;
private String city;
private String state;
private String postalCode;
/**
Constructs an address with everything but an apartment number.
@param houseNumber the house number as a string
@param street the street as a string
@param city the city as a string
@param state the state as a string
@param postalCode the postal code as a string
*/
public Address(String houseNumber, String street, String city, String state,
String postalCode)
{
this.houseNumber = houseNumber;
this.apartmentNumber = "";
this.street = street;
this.city = city;
this.state = state;
this.postalCode = postalCode;
}
/**
Constructs an address with an apartment number
@param houseNumber the house number as a string
@param apartmentNumber the apartment number as a string
@param street the street as a string
@param city the city as a string
@param state the state as a string
@param postalCode the postal code as a string
*/
public Address(String houseNumber, String apartmentNumber, String street,
String city, String state, String postalCode)
{
this.houseNumber = houseNumber;
this.apartmentNumber = apartmentNumber;
this.street = street;
this.city = city;
this.state = state;
this.postalCode = postalCode;
/**
Compares two addresses by postal code
@param other the other address
@return true if the distinguished argument's postal code is less
than other 's postal code
*/
public boolean comesBefore(Address other)
{
return postalCode.compareTo(other.postalCode) < 0;
}
}
P8.5
/**
Class to get surface area and volume of a soda can.
*/
public class SodaCan
{
private double height;
private double radius;
/**
Initializes a can with given height and radius.
@param height the height
@param radius the radius
*/
public SodaCan(double height, double radius)
{
this.height = height;
this.radius = radius;
}
/**
Calculates the surface area of the soda can.
@return the surface area of the soda can
*/
public double getSurfaceArea()
{
return 2 * Math.PI * radius * (radius + height);
}
/**
Calculates the volume of the soda can.
@return the volume of the soda can
*/
public double getVolume()
P8.6
/**
A class suitable for the simulating a car driving.
*/
public class Car
{
private double fuelEfficiency;
private double gasLevel;
/**
Initializes a car with a given fuel efficiency
@param fuelEfficiency the default fuel efficiency
*/
public Car(double fuelEfficiency)
{
this.fuelEfficiency = fuelEfficiency;
gasLevel = 0;
}
/**
Puts gas in the tank.
@param gas amount of gas to add
*/
public void addGas(double gas)
{
this.gasLevel = gasLevel + gas;
}
/**
Simulates driving the car and thus reducing the gas in the tank
@param distance miles driven
*/
public void drive(double distance)
{
gasLevel -= distance / fuelEfficiency;
}
/**
Returns the current gas level.
@return current gas level
*/
public double getGasLevel()
{
return gasLevel;
}
}
/**
A class to represent the quiz scores of a student.
*/
public class Student
{
private String name;
private int totalQuizScore;
private int numberOfQuizzes;
/**
Initializes a new student with a name and a 0 total quiz score.
*/
public Student(String name)
{
this.name = name;
totalQuizscore = 0;
}
/**
Gets the student's name.
@return the student's name
*/
public String getName()
{
return name;
}
/**
Adds one quiz to the student's record.
@param score the score of the quiz
*/
public void addQuiz(int score)
{
totalQuizScore += score;
numberOfQuizzes++;
}
/**
Returns the student's total score.
@return the student's total score
*/
public int getTotalScore()
{
return totalQuizScore;
}
/**
Calculates and returns the student's average quiz score
@return the student's average quiz score
*/
public double getAverageScore()
{
if (numberOfQuizzes > 0)
{
P8.8
As this solution requires two classes, Grade is listed first, then Student.
/**
A class to construct a grade from a string.
*/
public class Grade
{
private String grade;
/**
Constructs a grade from a string
@param gradeAsString a valid letter grade such as A, A-, B+, etc.
*/
public Grade(String gradeAsString)
{
grade = gradeAsString;
}
/**
Calculates the numeric value of the grade.
@return the numeric value of the grade
*/
public double getNumericValue()
{
double numericGrade;
if (grade.charAt(0) == 'A')
{
numericGrade = 4.0;
}
else if (grade.charAt(0) == 'B')
{
numericGrade = 3.0;
}
else if (grade.charAt(0) == 'C')
{
numericGrade = 2.0;
}
else if (grade.charAt(0) == 'D')
{
numericGrade = 1.0;
}
else
{
numericGrade = 0.0;
}
if (grade.length() > 1)
/**
A class to represent a student with grades.
*/
public class Student
{
private String name;
private double totalGrade;
private int numberOfGrades;
/**
Initializes a new student with a name and a 0 total grade.
*/
public Student(String name)
{
this.name = name;
totalGrade = 0;
numberOfGrades = 0;
}
/**
Gets the student's name.
@return the student's name
*/
public String getName()
{
return name;
}
/**
Adds one grade to the student's record.
@param grade the student's grade
*/
public void addGrade(Grade grade)
{
totalGrade += grade.getNumericValue();
numberOfGrades++;
}
/**
Returns the student's GPA.
@return the student's GPA
*/
public double getGPA()
P8.9
/**
A class to simulate a combination lock.
*/
public class ComboLock
{
private int secret1;
private int secret2;
private int secret3;
/**
Initializes the combination of the lock.
@param secret1 first number to turn right to
@param secret2 second number to turn left to
@param secret3 third number to turn right to
*/
public ComboLock(int secret1, int secret2, int secret3)
{
this.secret1 = secret1;
this.secret2 = secret2;
this.secret3 = secret3;
lockState = 0;
currentNumber = 0;
validSoFar = true;
}
/**
Resets the state of the lock so that it can be opened again.
*/
public void reset()
{
lockState = 0;
currentNumber = 0;
validSoFar = true;
}
/**
Turns lock left given number of ticks.
@param ticks number of ticks to turn left
/**
Turns lock right given number of ticks
@param ticks number of ticks to turn right
*/
public void turnRight(int ticks)
{
currentNumber = (currentNumber - ticks + 40) % 40;
// States 0 and 2 are the only valid states in which to turn the lock
if (lockState == 0)
{
if (currentNumber == secret1)
{
lockState = 1;
}
}
else if (lockState == 2)
{
if (currentNumber == secret3)
{
lockState = 3;
}
}
else
{
validSoFar = false;
}
}
/**
Returns true if the lock can be opened now
@return true if lock is in open state
*/
public boolean open()
{
return lockState == 3 && validSoFar;
}
}
/**
A voting machine that can be used for a simple election.
*/
public class VotingMachine
{
private int democratVotes;
private int republicanVotes;
/**
Initializes a blank voting machine.
*/
public VotingMachine()
{
democratVotes = 0;
republicanVotes = 0;
}
/**
Adds one vote for a Democrat.
*/
public void voteDemocrat()
{
democratVotes++;
}
/**
Adds one vote for a Republican.
*/
public void voteRepublican()
{
republicanVotes++;
}
/**
Reports the Democrat tally.
@return the Democrat tally
*/
public int democratTally()
{
return democratVotes;
}
/**
Reports the Republican tally.
@return the Republican tally
*/
public int republicanTally()
{
return republicanVotes;
}
/**
Erase all votes in machine.
P8.11
/**
A class that makes a letter.
*/
public class Letter
{
private String from;
private String to;
private String messageText;
/**
Takes the sender and recipient and initializes the letter.
@param recipient the recipient
@param sender the sender
*/
public Letter(String from, String to)
{
this.to = to;
this.from = from;
messageText = "";
}
/**
Appends a line of text to the message body.
@param line the line to append
*/
public void addLine(String line)
{
messageText = messageText + "\n" + line;
}
/**
Makes the message into one long string.
*/
public String getText()
{
return "Dear " + to + ":\n" + messageText + "\n\nSincerely,\n\n" + from;
}
/**
Prints the message text.
*/
public void print()
P8.12
/**
A class that simulates a bug moving.
*/
public class Bug
{
private int position;
private boolean movingRight;
/**
Initializes the bug given a position.
@param initialPosition the initial position
*/
public Bug(int initialPosition)
{
position = initialPosition;
movingRight = true;
}
/**
Changes the direction the bug is moving.
*/
public void turn()
{
movingRight = !movingRight;
}
/**
Moves the bug one unit in the current direction.
*/
public void move()
{
if (movingRight)
/**
Reports the current position of the bug.
@return the current position
*/
public int getPosition()
{
return position;
}
}
/**
A class to test the bug class.
*/
public class TestBug
{
public static void main(String[] args)
{
Bug myBug = new Bug(10);
myBug.move();
myBug.move();
myBug.turn();
myBug.move();
myBug.turn();
myBug.move();
myBug.turn();
myBug.move();
myBug.move();
System.out.println("Expected position 10; Current position "
+ myBug.getPosition());
}
}
P8.13
/**
A class that simulates a moth flying.
*/
public class Moth
{
private double position;
/**
Moves the moth halfway to the lightPosition.
*/
public void moveToLight(double lightPosition)
{
position -= (position - lightPosition) / 2;
}
/**
Reports the current position of the moth.
@return the current position
*/
public double getPosition()
{
return position;
}
}
/**
A class to test the moth class.
*/
public class TestMoth
{
public static void main(String[] args)
{
Moth myMoth = new Moth(10);
myMoth.moveToLight(20);
System.out.println("Expected position 15; Current position "
+ myMoth.getPosition());
myMoth.moveToLight(0);
System.out.println("Expected position 7.5; Current position "
+ myMoth.getPosition());
myMoth.moveToLight(0);
System.out.println("Expected position 3.75; Current position "
+ myMoth.getPosition());
myMoth.moveToLight(0);
System.out.println("Expected position 1.875: Current position "
+ myMoth.getPosition());
}
}
P8.14
/**
A class that can calculate surface area and volume of spheres,
/**
Calculates the surface area of a sphere.
@param r the radius of the sphere
@return the surface area of the sphere
*/
public static double sphereSurface(double r)
{
return 4.0 * Math.PI * r * r;
}
/**
Calculates the volume of a cylinder.
@param r the radius of the cylinder
@param h the height of the cylinder
@return the volume of the cylinder
*/
public static double cylinderVolume(double r, double h)
{
return Math.PI * r * r * h;
}
/**
Calculates the surface area of a cylinder.
@param r the radius of the sphere
@return the surface area of the cylinder
*/
public static double cylinderSurface(double r, double h)
{
return 2 * Math.PI * r * (r + h);
}
/**
Calculates the volume of a cone.
@param r the radius of the base of the cone
@param h the height of the cone
@return the volume of the cone
*/
public static double coneVolume(double r, double h)
{
return 1.0 / 3.0 * Math.PI * r * r * h;
}
/**
import java.util.Scanner;
P8.15
/**
A class that represents a cone and can calculate its volume and surface area.
*/
public class Cone
{
private double radius;
private double height;
/**
Creates a cone of given radius and height.
@param radius the radius
/**
Calculates the volume of the cone.
@return the volume of the cone
*/
public double getVolume()
{
return 1.0 / 3.0 * Math.PI * radius * radius * height;
}
/**
Calculates the surface area of the cone.
@return the surface area of the cone
*/
public double getSurface()
{
return Math.PI * radius * radius + Math.PI * radius
* Math.sqrt(radius * radius + height * height);
}
}
/**
A class that represents a cylinder and can calculate its volume and
surface area.
*/
public class Cylinder
{
private double radius;
private double height;
/**
Creates a new cylinder of given height and radius.
@param radius the radius
@param height the height
*/
public Cylinder(double radius, double height)
{
this.radius = radius;
this.height = height;
}
/**
Calculates the volume of a cylinder.
@return the volume of the cylinder
*/
public double getVolume()
{
return Math.PI * radius * radius * height;
}
/**
A class that represents a sphere and can calculate its volume and surface area.
*/
public class Sphere
{
private double radius;
/**
Creates a sphere of a given radius.
@param radius the radius
*/
public Sphere(double radius)
{
this.radius = radius;
}
/**
Calculates the volume of the sphere.
@return the volume of the sphere.
*/
public double getVolume()
{
return 4.0 / 3.0 * Math.PI * Math.pow(radius, 3);
}
/**
Calculates the surface area of the sphere.
@return the volume of the sphere.
*/
public double getSurface()
{
return 4.0 * Math.PI * radius * radius;
}
}
import java.util.Scanner;
P8.16
import java.util.ArrayList;
/**
A simulated cash register that tracks the item count and
the total amount due.
*/
public class CashRegisterModified
{
private ArrayList<Double> itemPrices;
/**
Constructs a cash register with cleared item totals
*/
public CashRegisterModified()
{
itemPrices = new ArrayList<Double>();
}
/**
Adds an item to this cash register.
@param price the price of this item
*/
public void addItem(double price)
{
itemPrices.add(price);
}
/**
Gets the price of all items of the current sale.
@return the total price
*/
public double getTotal()
{
double total = 0.0;
for (double price : itemPrices)
{
total += price;
/**
Gets the number of items in the current sale.
@return the item count
*/
public int getCount()
{
return itemPrices.size();
}
/**
Clears the item count and the total.
*/
public void clear()
{
itemPrices = new ArrayList<Double>();
}
/**
Displays the prices of all items in the current sale.
*/
public void displayAll()
{
for (int i = 0; i < itemPrices.size(); i++)
{
System.out.println(itemPrices.get(i));
}
}
}
P8.17
/**
A simulated cash register that tracks the item count and
the total amount due.
*/
public class CashRegister
{
private int itemCount;
private int totalPrice;
/**
Constructs a cash register with cleared item totals
*/
public CashRegister()
{
itemCount = 0;
totalPrice = 0;
}
/**
Adds an item to this cash register.
/**
Gets the price of all items of the current sale.
@return the total price
*/
public double getTotal()
{
return totalPrice / 100.0;
}
/**
Gets the number of items in the current sale.
@return the item count
*/
public int getCount()
{
return itemCount;
}
/**
Clears the item count and the total.
*/
public void clear()
{
itemCount = 0;
totalPrice = 0;
}
}
P8.18
/**
A simulated cash register that tracks the item count,
the total amount due, and total sales.
*/
public class CashRegisterModified
{
private int itemCount;
private double totalPrice;
private int salesCount;
private double totalSales;
/**
Constructs a cash register with cleared item totals
*/
public CashRegisterModified()
{
itemCount = 0;
/**
Adds an item to this cash register.
@param price the price of this item
*/
public void addItem(double price)
{
totalPrice += price;
totalSales += price;
itemCount++;
salesCount++;
}
/**
Gets the price of all items of the current sale.
@return the total price
*/
public double getTotal()
{
return totalPrice;
}
/**
Gets the number of items sold in a day.
@return the item count
*/
public int getSalesCount()
{
return salesCount;
}
/**
Gets the price of all items sold in a day.
@return the total price
*/
public double getSalesTotal()
{
return totalSales;
}
/**
Gets the number of items in the current sale.
@return the item count
*/
public int getCount()
{
return itemCount;
}
/**
Clears the item count and the total.
*/
public void clear()
/**
Clears the sales and count total.
*/
public void resetSales()
{
clear();
salesCount = 0;
totalSales = 0;
}
}
P8.19
/**
A class that has both a checking and savings account.
*/
public class Portfolio
{
private BankAccount checking;
private BankAccount savings;
/**
Initializes a new portfolio with empty checking and savings
balances.
*/
public Portfolio()
{
checking = new BankAccount();
savings = new BankAccount();
}
/**
Adds amount to the appropriate account.
@param amount amount of money to add
@param account "S" for savings "C" for checking
*/
public void deposit(double amount, String account)
{
if (account.equals("S"))
{
savings.deposit(amount);
}
if (account.equals("C"))
{
checking.deposit(amount);
}
}
/**
Removes amount from the appropriate account.
/**
Transfers amount from one account to the other
@param amount amount of money to transfer
@param account "S" for savings "C" for checking for which account
the money is taken from.
*/
public void transfer(double amount, String account)
{
if (account.equals("S"))
{
savings.withdraw(amount);
checking.deposit(amount);
}
if (account.equals("C"))
{
checking.withdraw(amount);
savings.deposit(amount);
}
}
/**
Gets the current balances of an account.
@param account "S" for savings "C" for checking to indicate account
the money is taken from.
*/
public double getBalance(String account)
{
if (account.equals("S"))
{
System.out.println("Savings: " + savings.getBalance());
}
if (account.equals("C"))
{
System.out.println("Checking: " + checking.getBalance());
}
}
}
P8.20
/**
Initializes the country with the given inputs.
@param name the name to set
@param population the population to set
@param area the area to set
*/
public Country(String name, int population, double area)
{
this.name = name;
this.population = population;
this.area = area;
}
/**
Prints the relevant country information.
*/
public void printCountry()
{
System.out.printf("Name: %s\nPopulation %d\nArea: %f\n", name,
population, area);
}
/**
Reports the population density
@return the population density
*/
public double getPopulationDensity()
{
if (area != 0)
{
return population / area;
}
else
{
return 0;
}
}
/**
Calculates which country has larger population.
@param b the other country
@return true if this is larger than b
*/
public boolean largerPopulation(Country b)
{
return this.population > b.population;
/**
Calculates which country has larger population density.
@param b the other country
@return true if this is larger than b
*/
public boolean largerDensity(Country b)
{
return this.getPopulationDensity() > b.getPopulationDensity();
}
/**
Calculates which country has larger area.
@param b the other country
@return true if this is larger than b
*/
public boolean largerArea(Country b)
{
return this.area > b.area;
}
}
import java.util.Scanner;
Country b = readCountry();
while (b != null)
{
P8.21
/**
A class that models an e-mail message.
*/
public class Message
{
private String recipient;
private String sender;
private String messageText;
/**
Takes the sender and recipient
@param recipient the recipient
@param sender the sender
*/
public Message(String recipient, String sender)
{
this.recipient = recipient;
this.sender = sender;
messageText = "";
}
/**
Appends a line of text to the message body.
@param line the line to append
*/
public void append(String line)
{
/**
Makes the message into one long string.
*/
public String toString()
{
return "From: " + sender + "\nTo: " + recipient + "\n" + messageText;
}
/**
Prints the message text.
*/
public void print()
{
System.out.print(this.toString());
}
}
P8.22
import java.util.ArrayList;
/**
A class that stores e-mail messages.
*/
public class Mailbox
{
private ArrayList<Message> messages;
/**
Initializes an empty mailbox.
*/
public Mailbox()
{
messages = new ArrayList<Message>();
}
/**
/**
Gets the ith message.
@param i the message number to get
@return the ith message
*/
public Message getMessage(int i)
{
return messages.get(i);
}
/**
Removes the ith message.
@param i the message number to remove
*/
public void removeMessage(int i)
{
messages.remove(i);
}
}
P8.23
import java.util.Scanner;
/**
A class that discounts $10 on the next purchase after $100 in purchases.
*/
public class Discount
{
public static double total;
public static double discountTally;
if (input == -1)
{
more = false;
}
else
{
makePurchase(input);
}
}
while (more);
P8.24
import java.util.Scanner;
import java.util.ArrayList;
/**
A class that discounts $10 on the next purchase after $100 in purchases.
*/
public class Discount
{
public static double total = 0;
public static double discountTally = 0;
private static ArrayList<Integer> stores = new ArrayList<Integer>();
do
{
Scanner in = new Scanner(System.in);
System.out.println("Please enter a purchase amount, -1 to quit: ");
double input = in.nextDouble();
if (input != -1)
{
System.out.println("Please enter a store number from 1 - 20: ");
int visit = in.nextInt();
stores.add(visit);
int i = 0;
while (i < stores.size() - 1)
{
if (stores.get(i) == stores.get(i + 1))
{
stores.remove(stores.get(i + 1));
}
else
{
i++;
}
}
makePurchase(input);
}
else
{
more = false;
}
}
while (more);
P8.25
/**
A class that simulates a cannonball firing in the air.
*/
public class Cannonball
{
private double xPos;
private double yPos;
private double xVel;
private double yVel;
/**
Initializes a cannonball to the given weight and x position.
@param xPos the x position
*/
public Cannonball(double xPos)
{
this.xPos = xPos;
this.yPos = 0;
}
/**
Moves the cannonball given its current velocity, also updates
velocity for gravity.
@param sec the seconds the move simulates
*/
public void move(double sec)
{
xPos += xVel * sec;
yPos += yVel * sec;
yVel += GRAVITY * sec;
}
/**
Gets the x position of the cannonball.
@return the x position of the cannonball
*/
public double getX()
{
return xPos;
}
/**
Gets the y position of the cannonball.
@return the y position of the cannonball
*/
public double getY()
/**
Simulates a cannonball being fired given the initial angle and
velocity.
@param alpha the angle to fire
@param v the velocity to fire at
*/
public void shoot(double alpha, double v)
{
xVel = v * Math.cos(alpha);
yVel = v * Math.sin(alpha);
do
{
move(0.1);
System.out.printf("xpos: %f, ypos: %f\n", xPos, yPos);
} while (yPos > 0);
}
}
import java.util.Scanner;
/**
A class that prompts the user for an angle and velocity to fire a
cannonball.
*/
public class FireCannonball
{
public static void main(String[] args)
{
System.out.println("Please enter a starting angle: ");
Scanner in = new Scanner(System.in);
double angle = in.nextDouble();
P8.26
P8.27
double nominalResistance;
double tolerance;
double actualResistance;
int exponentValue = 5;
System.out.print("Resistance: ");
double resistance = in.nextDouble();
System.out.print(r.colorBands());
}
}
P8.28
public Resistor()
{
nominalResistance = 0;
tolerance = 0;
actualResistance = 0;
52. The raven was regarded as sacred, and greatly venerated by the old Norse Vikings, who
had always one or two of these birds in their ships. When setting out on marauding
expeditions the raven was let loose and his flight followed by the bold voyagers, in the
belief that he led them to war and victory. These birds it was supposed lived to a
fabulous age. Odin’s shield had a raven on it, and so had the Landeyda or battle-flag of
Sigurd, which ever led to victory, although its bearer was doomed to die. Hialtland is the
ancient name of Shetland. The Norse rovers thought it a disgrace to die in their beds in
peace; and when they found their end approaching, clad in armour, had themselves
carried on board their ships which were then set fire to and sent adrift, that the old
heroes might die, as they had lived, on the ocean, and thence worthily rise to Valhalla.
53. The “Death of the Old Norse King,” translated into Icelandic verse by the Rev. Olaf
Pálsson.
54. A rix dollar is equal in value to 2/3 English. A skilling is a fraction more than a farthing.
55. Extracted from the postscript to Mr. William Longman’s “Suggestions for the
Exploration of Iceland”—an address delivered to the members of the Alpine Club, of
which he is Vice-President.—Longman & Co., 1861.
56. This chapter, written in December 1859, has already appeared in the pages of a
periodical.—A.J.S.
57. These journals, while admitting, in a general though apologetic way, that great evils exist
in connection with slavery, yet, somehow, on every occasion, systematically and
persistently uphold pro-slavery measures and interests.
58. Fuller information and subsequent events in America have justified and amply
confirmed this estimate of Brown, formed at the time. Having had access to documents,
published and unpublished, and being in a position to judge, we would confidently refer
the reader to a volume of 452 pp. 8vo., since published by Smith, Elder & Co.—“The
Life and Letters of Captain John Brown, edited by Richard D. Webbe”—as presenting a
fair statement of the facts of the case. From Brown’s deeds and words, therein recorded,
it will be clearly seen, how calm, noble and dignified was the bearing of the man whom
short-sighted trimmers, on both sides the Atlantic, have attempted to brand as a fanatic.
60. The antiquarian book to which we have already referred, erroneously attributes the
discovery to Garder, a Dane of Swedish origin. Our authority is Gísli Brynjúlfsson, the
Icelandic poet, now resident in Copenhagen, to whose kindness we are also indebted for
the copy of this work which we possess.
61. For these last, we would refer to Thorpe’s “Yuletide Stories,” Dasent’s “Popular Tales
from the Norse,” our own Nursery Lore, and to preceding Stories and Tales in this
appendix.
62. Mr. Dasent has since published an admirable translation of “Njal’s Saga,” which presents
a vivid picture of life in Iceland at the end of the tenth century.
Pg. vii: Punctuation consistency: ‘on Northern Subjects.’ to ‘on Northern Subjects’—Removed
period at end of TOC entry
Pg. 12: Repeated word: ‘in in the time’ to ‘in the time’
Pg. 52: Punctuation fix: ‘cleanliness comfort and refinement’ to ‘cleanliness, comfort and
refinement’—Added missing comma
Pg. 70: Corrected typo: ‘at each others’ to ‘at each other’s’—Added missing apostrophe
Pg. 138: Missing punctuation: ‘Faröe Islands. pp 30’ to ‘Faröe Islands, pp 30’—Period for
comma
Pg. 167: Quote placement: ‘has ever occurred.’ to ‘has ever occurred.”’—Added missing close-
quote to quote end
Pg. 171: Punctuation fix: ‘issue from Kötlugjá,’ to ‘issue from Kötlugjá.’—Comma for period
Pg. 189: Extra punctuation: ‘lava. continued’ to ‘lava continued’—Removed extra period
Pg. 226: Proper name consistency: ‘A. J. S.’ to ‘A.J.S.’—Usually without spaces
Pg. 239: Missing punctuation : ‘such a rib as this’ to ‘such a rib as this?’—Added missing ‘?’ at
para end
Pg. 242: Missing punctuation : ‘if she does’ to ‘“if she does’—Added missing opening
quotation mark
Pg. 259: Quote placement: ‘little porridge pot.’ to ‘little porridge pot.”’—Added missing close-
quote at quote end
Pg. 260: Proper name consistency: ‘Vola’ to ‘Vala’—Nominative form corrected, see next
sentence
Pg. 260: Chapter / TOC consistency: ‘N/A’ to ‘FROM THE “VÖLUSPÁ”’—Added section
heading where indicated in TOC
Pg. 262: Chapter / TOC consistency: ‘N/A’ to ‘FROM THE “SÓLAR LJÓD”’—Added
section heading where indicated in TOC
Pg. 264: Quote placement: ‘this Sun’s Song!’ to ‘this Sun’s Song!”’—Added missing close-
quote at poem end
Pg. 265: Quote placement: ‘Odin’s High Song’ to ‘“Odin’s High Song’—Added missing open-
quote at quote beginning
Pg. 265: Chapter / TOC consistency: ‘N/A’ to ‘FROM THE POEMS RELATING TO
SIGURD & BRYNHILD.’—Added section heading where indicated in TOC
Pg. 267: Missing punctuation : ‘the man speaks his mind’ to ‘the man speaks his mind.’—
Missing period added at stanza end
Pg. 272: Missing punctuation: ‘live without crime’ to ‘live without crime.’—Missing period
added at stanza end
Pg. 274: Missing punctuation: ‘in her breast’ to ‘in her breast.’—Missing period added at
stanza end
Pg. 275: Corrected typo: ‘CXII’ to ‘XCII’
Pg. 292: Punctuation fix: ‘lava,’ to ‘lava.’—Comma for period at entry end
Pg. 310: Missing punctuation: ‘days 296’ to ‘days, 296’—Added comma before pg. number
Pg. 310: Missing punctuation: ‘26’ to ‘26.’—Added missing period at end of index subentry
Pg. 313: Punctuation fix: ‘Plain, 94.’ to ‘Plain, 94’—Extra punctuation at entry end
Pg. 313: Punctuation fix: ‘Plateau, 74.’ to ‘Plateau, 74’—Extra punctuation at entry end
Pg. 313: Punctuation fix: ‘Pits, 107.’ to ‘Pits, 107’—Extra punctuation at entry end
Pg. 314: Missing punctuation: ‘140’ to ‘140.’—Added missing period at end of index subentry
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.