Savage Blood – Alex Chance

Published by:

Savage Blood - Alex Chance

I have just completed reading the book ‘Savage Blood’ by Alex Chance. It is a thriller story which I feel slightly uncommon compared to other thriller stories that usually have a strong attachment to the main point and repetitive from the beginning until the ending of the story.

The author’s boundless imagination has created a different feeling for readers when reading the story. With a single focus in this story, which is the savage island, the author is able to express his creativity in linking the characters from different locations in the world and lead the story back to the main plot. Besides that, every character has its own uniqueness of story development.

Although the storyline is interesting and a bit different from other thriller stories which I used to read but it will not be one of my favourite books. The reason is I tend to easily get confused and need some time to follow the storyline. The story involves of too many characters and often jumps from one story to a different story. Even though the author is able to link all the characters to the key point: savage island, but it requires certain effort and limitless imaginations from the author to proceed further for the story development. The effort is obvious as more sub-stories are inserted to carry on the plot. The additional sub-stories which use to create the interconnections of different characters to the savage island increases more confusion on me to understand the story and to distinguish the different characters’ stories.

Chapter 7: Arrays (Exercise 7.14)

Published by:

/**
 * Exercise 7.14
 * Airline reservation system - assign seats on each flight of the airline's only plane (capacity: 10 seats)
 * 1. Please type 1 for First Class & Please type 2 for Economy
 * 2. If the user types 1 - assign a seat in the first class section (1-5).
 * 3. If the user types 2 - assign a seat in the economy section (6-10).
 * 4. Display a boarding pass - person's seat number & first-class/economy section of the plane.
 * 5. One-dimensional array of primitive type boolean to represent the seating chart of the plane.
 * 6. Initialize all the elements of the array to false for all empty seats.
 * 7. As each seat is assigned, set the corresponding elements of the array to true to indicate that the seat is no longer
 * 		available.
 * 8. Never assign a seat that has already been assigned.
 * 9. When the economy section is full, ask the person if it is acceptable to be placed in the first-class section (& vice-versa).
 * 10. If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours".
 */
package com.chapter7.arrays;

import java.io.BufferedReader;

public class Exercise714 {

	private boolean seatsBooked;
	private boolean arrSeats[];
	private int CAPACITY = 10;
	private int availSeats = CAPACITY;
	private Scanner input;
	private int userChoice;
	private int current;

	// constructor
	public Exercise714() {
		this.arrSeats = new boolean[CAPACITY];
		initSeats();
		this.seatsBooked = true;
	}

	// Initialize all the elements of the array to false for all empty seats.
	private void initSeats() {
		for (int i = 0; i < arrSeats.length; i++) {
			arrSeats[i] = false;
		}
	}

	// Display the menu for user choice
	public void displayMenu() {
		do {

			// if no more seats available in the flight, display the message
			if (availSeats == 0) {
				System.out.println();
				System.out.println("No more available seats in this flight.");
				System.out.println("Thank you for using our system");
				break;
			}
			System.out.println("***** Airline Reservation System *****");
			System.out.println(" Menu Options ");
			System.out.println(" 1 - First Class ");
			System.out.println(" 2 - Economy Class ");
			System.out.println(" 3 - Exit ");
			System.out.println("**************************************");
			System.out.println("Please choose your option: ");
			input = new Scanner(System.in);

			// try to get the user choice
			try {
				userChoice = input.nextInt();
				while (userChoice != 1 && userChoice != 2 && userChoice != 3) {
					System.out.println("Please choose either '1', '2' or '3'");
					displayMenu();
				}

			} catch (InputMismatchException ex) {
				System.err.println("Not a valid number: " + userChoice);
			}
			seatsBooked = assignSeats(userChoice);
		} while (seatsBooked);

	}

	// Assign the seats based from the user's choice for the class
	public boolean assignSeats(int userChoice) {

		switch (userChoice) {

		// First class section
		case 1:

			for (current = 0; current < 5; current++) {
				if (arrSeats[current] == false) {
					arrSeats[current] = true;
					printBoardingPass(current + 1);
					availSeats--;
					seatsBooked = true;

					break;
				}

			}

			// if first class section is full, prompt user to choose other class
			if (current == 5) {
				chooseOtherClass();
			}
			break;

		// Economy class section
		case 2:
			for (current = 5; current < 10; current++) {
				if (arrSeats[current] == false) {
					arrSeats[current] = true;
					printBoardingPass(current + 1);
					availSeats--;
					seatsBooked = true;
					break;
				}
			}

			// if economy class section is full, prompt user to choose other
			// class
			if (current == 10) {
				chooseOtherClass();
			}
			break;
		case 3:
			System.out.println("Thank you for using our system. Goodbye!");
			System.exit(0);

		default:
			System.out.println("Invalid input. Please type again");
			seatsBooked = true;
		}
		return seatsBooked;

	}

	// If the chosen class is full, ask the user whether want to choose other
	// class section
	private boolean chooseOtherClass() {
		do {
			System.out
					.println("There are no more seats available for the chosen class.\n");
			System.out
					.println("Do you want to choose another class? Type 'Y' for Yes or 'N' for No");

			String ans = input.next();
			if (ans.equalsIgnoreCase("Y")) {
				seatsBooked = true;
			} else if (ans.equalsIgnoreCase("N")) {
				System.out.println("Next flight leaves in 3 hours.");
				System.out.println();
				break;
			} else {
				System.out.println("\nInvalid input.");
			}

		} while (!seatsBooked);
		return seatsBooked;

	}

	// Print the boarding pass with the seat number and class section
	public void printBoardingPass(int seatNum) {

		System.out.println("***** Boarding Pass *****");
		System.out.println();
		System.out.println("Seat number: " + (seatNum));
		if (seatNum <= 5) {
			System.out.println("You've been assigned to first class.");
		} else {
			System.out.println("You've been assigned to economy class.");
		}
		System.out.println("Thank you for using our system. Have a safe flight!");
		System.out.println();
		System.out.println("*************************");
		System.out.println();

	}
}

/** Output

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
***** Boarding Pass *****

Seat number: 1
You've been assigned to first class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
***** Boarding Pass *****

Seat number: 2
You've been assigned to first class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
2
***** Boarding Pass *****

Seat number: 6
You've been assigned to economy class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
2
***** Boarding Pass *****

Seat number: 7
You've been assigned to economy class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
***** Boarding Pass *****

Seat number: 3
You've been assigned to first class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
***** Boarding Pass *****

Seat number: 4
You've been assigned to first class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
2
***** Boarding Pass *****

Seat number: 8
You've been assigned to economy class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
***** Boarding Pass *****

Seat number: 5
You've been assigned to first class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
There are no more seats available for the chosen class.

Do you want to choose another class? Type 'Y' for Yes or 'N' for No
Y
***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
2
***** Boarding Pass *****

Seat number: 9
You've been assigned to economy class.
Thank you for using our system. Have a safe flight!

*************************

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
1
There are no more seats available for the chosen class.

Do you want to choose another class? Type 'Y' for Yes or 'N' for No
N
Next flight leaves in 3 hours.

***** Airline Reservation System *****
 Menu Options 
 1 - First Class 
 2 - Economy Class 
 3 - Exit 
**************************************
Please choose your option: 
2
***** Boarding Pass *****

Seat number: 10
You've been assigned to economy class.
Thank you for using our system. Have a safe flight!

*************************

No more available seats in this flight.
Thank you for using our system

**/ 
package com.chapter7.arrays;

public class Exercise714Test {
	public static void main(String[] args) {
		Exercise714 airlineSystem=new Exercise714();
		airlineSystem.displayMenu();
	}

}

The Lying Tongue – Andrew Wilson

Published by:

The Lying Tongue - Andrew Wilson

After graduated from London University in art history, Adam Woods travels to Venice to take a post as an English tutor. Unfortunately, Mr. Gondolini’s son gets the maid’s daughter pregnant. Due to this reason, Mr. Gondolini has sent his son to New York to avoid any repercussions, thus causing Adam unemployed. However, with the idea by Mrs. Gondolini to work as a personal assistant, Adam applied for the job and work as a personal assistant to a reclusive writer Gordon Crace.

Crace wrote one novel in 1967 entitled ‘The Debating Society’ which was a huge bestseller and also the only novel since then. Adam works very hard cleaning up the abandoned house and also cooking simple meals for Crace. Besides that, Crace likes to talk to him about arts and his collections in the house. Despite of Crace’s eccentric behaviour such as asking him to do the grocery in a limited time as Crace cannot bear to be left alone, Adam still perform his tasks diligently and work according to Crace’s requirements. As the time passes by, Adam realised that his novel is not going well and decided to write a biography of Crace since this is a good opportunity for him to know more about the older man. He has access to all the older man’s letters and learns that there is another writer has the same interest to write a biography of Crace. As for another letter, he soon found out it is related to a young man who lived with Crace committed suicide soon after publication.

Adam lies to Crace by using grandmother’s funeral as an excuse so he can visit England to dig out more details of the older man’s past. His visit to England enables him to investigate how far has the writer knows about Crace in preparing to write the biography. Besides that, he also get to know that the young man that committed suicide named Christopher Davidson looks alike to him and has an unexpected relationship with Crace. Christopher’s ex-classmate which is also Crace’s ex-student told Adam that his old friends used to participate in debating society were abused by Crace and causes them committed suicide few years ago. Crace’s homosexuality stories causing tension to Adam to return to Venice and live with Crace.

The story ends with a gunshot between Crace and Adam when Adam tries to search for the manuscript “The Music Teacher”. Crace knew Adam’s motives all these time and created a puzzle before he died that leads Adam to search for the manuscript in different places in the house. In the end, Adam has to searched for the manuscript from Crace’s body as Crace purposely planned it in such way so that Adam has to touch his body after he died. What Adam found from the body is not the manuscript but it’s a book called “The Lying Tongue” and the main character was called Adam. The story has been sent to the publisher before Crace died.

It has been quite some time that I encountered such a book which is difficult to stop reading it. This is a psychological thriller novel. Although this is Andrew Wilson’s debut novel but the story is well-written and able to create an exceptional thriller to the readers.

Other Reviews: