Translating Boolean true/false into Yes/No of what I am doing wrong

Having a hard time figuring out how to translate this. Here is the method I think should do it:
instance variable: private boolean isPaperback;Method:
   public void translate(boolean trueOrFalse)
        if (isPaperback = true) {
            System.out.println("Yes");
        else {
            System.out.println("No");
    }When I run the method, it gives me an answer of "Yes" for both true and false. Any idea of what I am doing wrong?
TIA, Marc
Edited by: Celtica on Feb 9, 2009 12:33 AM
Edited by: Celtica on Feb 9, 2009 12:34 AM

here is the code of the program:
public class Book
    // instance variables
    private String title;
    private String author;
    private String isbn;
    private int numberOfPages;
    private boolean isPaperback;
    private double price;
     * Constructor for objects of class Book
    public Book(String theTitle, String theAuthor, String theIsbn,
                int theNumberOfPages, boolean theIsPaperback,
                double thePrice)
        // initialise instance variables
        title = theTitle;
        author = theAuthor;
        isbn = theIsbn;
        numberOfPages = theNumberOfPages;
        isPaperback = theIsPaperback;
        if (price < 0.00) {
            double price = 0.00;
        else {
        price = thePrice;
     * Display the title
    public String getTitle()
        // put your code here
        return title;
     * Display the Author
    public String getAuthor()
        // put your code here
        return author;
     * Display the ISBN
    public String getIsbn()
        // put your code here
        return isbn;
     * Display the Number of pages
    public int getNumberOfPages()
        // put your code here
        return numberOfPages;
     * Display the isPaperback Status
    public boolean getIsPaperback()
        return isPaperback;
     * Display the price
    public double getPrice()
        return price;
     * set the title
    public void setTitle(String newTitle)
        // put your code here
        title = newTitle;
     * Set the Author
    public void setAuthor(String newAuthor)
        // put your code here
        author = newAuthor;
     * Set the ISBN
    public void getIsbn(String newIsbn)
        // put your code here
        isbn = newIsbn;
     * Set the Number of pages
    public void setNumberOfPages(int newNumberOfPages)
        // put your code here
        numberOfPages = newNumberOfPages;
     * Set the isPaperback Status
    public void setIsPaperback(boolean newIsPaperback)
        // put your code here
        isPaperback = newIsPaperback;
     * set the Price
    public void setPrice(double newPrice)
        // put your code here
        price = newPrice;
     * Returns the string "Yes" if passed true, and "no" if passed false
   public void translate(boolean trueOrFalse)
        if (isPaperback = true) {
            System.out.println("Yes");
        else {
            System.out.println("No");
     * Displays book information
    public void displayBook()
        System.out.println("Title: " + title);
        System.out.println("Author: " + author);
        System.out.println("ISBN: " + isbn);
        System.out.println("Pages: " + numberOfPages);
        System.out.println("Paperback:" + isPaperback);
        System.out.println("Suggested Price: $" + price);       
}

Similar Messages

Maybe you are looking for

  • Tomcat (newbie to Mac) how to install and run?

    Hi, I wonder if anyone knows any good tutorial of how to install tomcat on MAC? Also, I'm not really sure what type of tomcat I should use for mac (Tomcat specifically and explicitly offer the window's package) any DIRECT url will be GREAT...I'm look

  • My iphone 4s is in recovery mode after updating and keeps getting error 4005

    Hi there, I recently tried updating to iOS 7.1 using iTunes. Don't know what went wrong but I got an error (quickly clicked it away so don't know what the first error was) and it is now in recovery mode. Whenever I try to recover it with iTunes it st

  • WRT54G freezes when mac connects with airport card

    I'm using WRT54G, i have plugged to it 3 things; cable modem, a PC desktop and a mac desktop. that all works great. When I connect via my mac laptop the router freezes, sometimes. i've been tracking it and there is no consistency of how long until it

  • What is "RoboHelp Word COM addin" for Microsoft Word?

    HI, I can't find a solution anywhere! A few months ago, I was able to create a PDF using Acrobat Professional 8 >> Create PDF from file, and then I suddenly could not. On Adobe's site, I found that I needed to re-enable this particular addin, which w

  • Debug doesen't start

    Hi experts.... I want to debug an abap function called from a java webdynpro. I've set an external break-point for the user RFCUSER in the abap function. the function work fine but the flow doesn't stop at the break-point. anyone can help me?? Marco