Purchase Solution

Java Programming: SchoolTextBook Class

Not what you're looking for?

Ask Custom Question

Create a class titled SchoolTextBook that contains fields for the author, title, page count, ISBN, and price. This SchoolTextBook class will also provide setter and getter methods for all fields. Save this class in a file titled SchoolTextBook.java.

Write an application with an array that holds 5 instances of the SchoolTextBook class, filled without prompting the user for input. Next prompt the used to enter a field for sorting, sort the array of objects based on the user input, and then display the newly sorted array of objects. Save this class in a file titled SchoolTextBookSort.java.

Purchase this Solution

Solution Summary

The expert examines SchoolTextBook Classes for java programming.

Solution Preview

import java.text.NumberFormat;

public class SchoolTextBook {

private String author; //1 for sorting
private String title; //2 for sorting
private int pageCount; //3 for sorting
private String isbn; //4 for sorting
private double price; //5 for sorting

public SchoolTextBook() {
}

public SchoolTextBook(String a, String t, int c, String ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.