SlideShare a Scribd company logo
1 of 47
Conversion cost consists of which of the following?
Direct labor and manufacturing overhead cost.
Direct materials and direct labor cost.
Manufacturing overhead cost.
Direct labor cost.
2.
East Company manufactures and sells a single product with a
positive contribution margin. If the selling price and the
variable expense per unit both increase 5% and fixed expenses
do not change, what is the effect on the contribution margin per
unit and the contribution margin ratio?
Option C
Option D
Option B
Option A
3.
Which of the following three statements are correct?
I. A profit center has control over both cost and revenue.
II. An investment center has control over invested funds, but
not over costs and revenue.
III. A cost center has no control over sales.
Only II.
Only I and III.
Only I and II.
Only I.
4.
Which of the following costs is an example of a period rather
than a product cost?
Depreciation on production equipment.
Wages of salespersons.
Wages of production machine operators.
Insurance on production equipment.
5.
An increase in the discount rate will result in an increase in the
present value of a given cash flow.
True
False
6.
The purpose of the Data Processing Department of Falena
Corporation is to assist the various departments of the
corporation with their information needs free of charge. The
Data Processing Department would best be evaluated as a:
revenue center.
investment center.
cost center.
profit center.
Top of Form
7.
Which of the following represents the normal sequence in which
the indicated budgets are prepared?
Sales, Balance Sheet, Direct Labor
Production, Manufacturing Overhead, Sales
Production, Cash, Income Statement
Direct Materials, Cash, Sales
Bottom of Form
8.
The wages of factory maintenance personnel would usually be
considered to be:
Option D
Option C
Option B
Option A
9.
Horizontal analysis involves comparing two or more years'
financial data for a single company.
True
False
10.
For a given level of sales, a low contribution margin ratio will
produce less net operating income than a high contribution
margin ratio.
True
False
11.
Manufacturing overhead consists of:
indirect materials but not indirect labor.
indirect labor but not indirect materials.
all manufacturing costs, except direct materials and direct labor.
all manufacturing costs.
Net income/Cost of goods sold
12.
The formula for the gross margin percentage is:
(Sales - Cost of goods sold)/Cost of goods sold
(Sales - Cost of goods sold)/Sales
Net income/Sales
Net income/Cost of goods sold
13.
Which of the following statements is not correct?
The sales budget generally is accompanied by a computation of
expected cash receipts for the forthcoming budget period.
The cash budget must be prepared prior to the sales budget
because managers want to know the expected cash collections
on sales made to customers in prior periods before projecting
sales for the current period.
The sales budget is constructed by multiplying the expected
sales in units by the sales price.
The sales budget is the starting point in preparing the master
budget.
14.
In activity-based costing, the total overhead cost in an activity
cost pool can be computed by:
dividing the total activity in the activity cost pool by the
activity rate for the activity cost pool.
dividing the total direct labor-hours in the activity cost pool by
the activity rate for the activity cost pool.
multiplying the total direct labor-hours in the activity cost pool
by the activity rate for the activity cost pool.
multiplying the total activity in the activity cost pool by the
activity rate for the activity cost pool.
15.
Issuing new shares of stock in a five-for-one split of common
stock would:
increase total stockholders' equity.
decrease total stockholders' equity.
decrease the book value per share of common stock.
increase the book value per share of common stock.
16.
The difference between total sales in dollars and total variable
expenses is called:
net operating income.
the contribution margin.
the gross margin.
net profit.
17.
Which of the following statements provide(s) an argument in
favor of including only a plant's net book value rather than
gross book value as part of operating assets in the ROI
computation?
I. Net book value is consistent with how plant and equipment
items are reported on a balance sheet.
II. Net book value is consistent with the computation of net
operating income, which includes depreciation as an operating
expense.
III. Net book value allows ROI to decrease over time as assets
get older.
Only I.
Only I and II.
Only I and III.
Only III.
18.
Guerra Electronics manufactures a variety of electronic gadgets
for use in the home. Which of the following would probably be
the most accurate measure of activity to use for allocating the
cost of inspecting the finished products at Guerra?
Machine-hours
Number of inspections
Direct labor-hours
Inspection time
19.
If two companies have the same total sales and total expenses
and make the same product, the volatility of net operating
income with changes in sales will tend to be greater in the
company with a higher proportion of fixed expenses in its cost
structure.
True
False
Top of Form
20.
Budgeted production needs are determined by:
deducting the beginning inventory in units from budgeted sales
in units.
adding budgeted sales in units to the desired ending inventory
in units and deducting the beginning inventory in units from
this total.
adding budgeted sales in units to the beginning inventory in
units and deducting the desired ending inventory in units from
this total.
adding budgeted sales in units to the desired ending inventory
in units.
Bottom of Form
©2011 T
21.
If a company's return on assets is substantially higher than its
cost of borrowing, then the common stockholders would
normally want the company to have a relatively high debt/equity
ratio.
True
False
22.
Residual income is superior to return on investment as a means
of measuring performance because it encourages managers to
make investment decisions that are more consistent with the
interests of the company as a whole.
True
False
23.
National Telephone company has been forced by competition to
put much more emphasis on planning and controlling its costs.
Accordingly, the company's controller has suggested initiating a
formal budgeting process. Which of the following steps will
NOT help the company gain maximum acceptance by employees
of the proposed budgeting system?
Demonstrating top management support for the budgeting
program.
Implementing the change quickly.
Ensuring that favorable deviations of actual results from the
budget, as well as unfavorable deviations, are discussed with
the responsible managers.
Including in departmental responsibility reports only those
items that are under the department manager's control.
24.
Human resource management is an example of an activity at
which of the following levels?
Batch-level activity.
Facility-level activity.
Product-level activity.
Unit-level activity.
25.
The market price of XYZ Company's common stock dropped
from $25 to $21 per share. The dividend paid per share
remained unchanged. The company's dividend payout ratio
would:
increase.
decrease.
be unchanged.
impossible to determine without more information.
26.
The master budget is a network consisting of many separate
budgets that are interdependent.
True
False
27.
A decrease in the discount rate:
b. is one way to compensate for greater risk in a project.
d. responses a and b are both correct.
a. will increase present values of future cash flows.
c. will reduce present values of future cash flows.
28.
Product engineering is an example of a:
Batch-level activity.
Product-level activity.
Unit-level activity.
Facility-level activity.
29.
The use of return on investment as a performance measure may
lead managers to make decisions that are not in the best
interests of the company as a whole.
True
False
30.
If an investment has cash outflows of Q dollars at the end of
each year for three years, then the present value of these cash
outflows under a 10% rate of return will be:
greater than under a 12% rate of return.
equal to that under a 12% rate of return.
less than under a 12% rate of return.
unknown because it depends on the size of Q.
31.
Even if operations are interrupted or cut back, committed fixed
costs remain largely unchanged in the short term because the
costs of restoring them later are likely to be far greater than any
short-run savings that might be realized.
True
False
32.
The dividend yield ratio is calculated by dividing dividends per
share by earnings per share.
True
False
3.
When a company shifts from a traditional cost system in which
manufacturing overhead is applied based on direct labor-hours
to an activity-based costing system in which there are batch-
level and product-level costs, the unit product costs of high
volume products typically decrease whereas the unit product
costs of low volume products typically increase.
True
False
Top of Form
34.
Financial leverage is negative when:
total liabilities are less than total assets.
the return on total assets is less than the rate of return
demanded by creditors.
the return on total assets is less than the rate of return on
common stockholders' equity.
total liabilities are less than stockholders' equity.
35.
A company with a degree of operating leverage of 4 would
expect net operating income to increase by 200% if sales
increased from $100,000 to $150,000.
True
False
Bottom of Form
library.txt
A:0:Author Name:Street One:Washi:DC:20002:(202)635-0000
B:0:Java One:technica:50.59:0
A:1:Author Name Two:Street Two:New
York:NY:12122:(508)123-0000
B:1:Java Two:action:6.14:1
Address.javaAddress.javapackageBook;
//import Book.Address;
//import Library2.Genre;
publicclassAddress{
String street;// street address
String city;// city
String state;// state
String zip;// zip
String phone;// phone
/*
* Constructor with empty set of arguments -
create empty strings
*/
publicAddress(){
street=newString();
city =newString();
state =newString();
zip =newString();
phone =newString();
}
/*
* Constructor with all arguments
*/
publicAddress(String s,String c,String z,String st,String p){
street = s;
city = c;
zip = z;
state = st;
phone = p;
}
/*
* setStreet - set street address
*/
publicvoid setStreet (String s){
street = s;
}
/*
* getStreet - return street address
*/
publicString getStreet(){
return street;
}
/*
* setCity - set city
*/
publicvoid setCity (String c){
city = c;
}
/*
* getCity - return city
*/
publicString getCity(){
return city;
}
/*
* setZip - set zip code
*/
publicvoid setZip (String z){
zip = z;
}
/*
* getZip - return zip code
*/
publicString getZip(){
return zip;
}
/*
* setState - set state
*/
publicvoid setState(String st){
state = st;
}
/*
* getState - get state
*/
publicString getState(){
return state;
}
/*
* setPhone - set phone number
*/
publicvoid setPhone (String p){
phone = p;
}
/*
* getPhone - return phone number
*/
publicString getPhone(){
return phone;
}
/* Return true if address matches */
publicboolean isAddress(String s,String c,String z,String st){
return(s.equalsIgnoreCase(street)&& c.equalsIgnoreCase(city)&
&
z.equalsIgnoreCase(zip)&& st.equalsIgnoreCase(stat
e));
}
/*
* Return address in format street addr:city:zip:phone
*/
//@Override
publicString toString(){
return street+":"+city+":"+zip+":"+state+":"+phone;
}
}
Author.javaAuthor.java
packageBook;
/*
* Author class - represents an author
*
*/
publicclassAuthor{
Address addr;
String name;/* Author's name */
int index;/* index */
/*
* Constructor with no args
*/
publicAuthor(){
addr =newAddress();
name =newString();
index =-1;/* unspecified */
}
/*
* Constructor with 1 argument - name
*/
publicAuthor(String n){
name = n;
addr =newAddress();
index =-1;
}
/*
* Constructor with 2 arguments - name and address
*/
publicAuthor(String n,int ind,Address a){
name = n;
index = ind;
addr = a;
}
/* Return true if the author has the same name */
publicboolean isName(String n){
return n.equalsIgnoreCase(name);
}
/* Return true if author's index is i */
publicboolean isIndex(int i){
return getIndex()== i;
}
/*
* Return true if string 'n' matches author's name substring
*/
publicboolean matchName(String n){
return name.matches(n);
}
/*
* Return true if author's index matches i, same as isAuthorIn
dex
*/
publicboolean matchIndex(int i){
return isIndex(i);
}
/*
* getName - get name
*/
publicString getName(){
return name;
}
/*
* setName - set name
*/
publicvoid setName(String n){
name = n;
}
/*
* setIndex - set author's index
*/
publicvoid setIndex(int ind){
index = ind;
}
/*
* getIndex - get author's index
*/
publicint getIndex(){
return index;
}
/*
* getAddress - get address
*/
publicAddress getAddress(){
return addr;
}
/*
* setAddress - set address
*/
publicvoid setAddress(Address a){
addr = a;
}
/*
* Return author in format first last:street address:city:zip:ph
one
*/
@Override
publicString toString(){
return name +":"+ addr;// will use addr.toString()
}
}
Book.javaBook.javapackageBook;
//This Class represents a book
publicclassBook{
Author author;
Title title;
Gendre gendre;
int index;
float price;
/*
* Constructor with no arguments - initialize members
*/
publicBook(){
author =newAuthor();
title =newTitle();
gendre =newGendre();
price =0;
index =-1;/* unspecified */
}
/*
* Constructor with all arguments
*/
publicBook(int i,Title t,Author a,Gendre g,float p){
author = a;
title = t;
gendre = g;
price = p;
index = i;
}
/*
* setPrice - set the book price
*/
publicvoid setPrice(float p){
price = p;
}
/*
* getPrice - get the book price
*/
publicfloat getPrice(){
return price;
}
/*
* setAuthor - set the book's author
*/
publicvoid setAuthor (Author a){
author = a;
}
/*
* getAuthor - get author
*/
publicAuthor getAuthor(){
return author;
}
/*
* setTitle - set the book title
*/
publicvoid setTitle(Title t){
title = t;
}
/*
* getTitle - get the book title
*/
publicTitle getTitle(){
return title;
}
/*
* setGendre - set gendre
*/
publicvoid setGendre(Gendre g){
gendre = g;
}
/*
* getGendre - get gendre
*/
publicGendre getGendre(){
return gendre;
}
/*
* setIndex - set index
*/
publicvoid setIndex(int ind){
index = ind;
}
/*
* getIndex - get index
*/
publicint getIndex(){
return index;
}
/* Book match functions (used for search)
* isAuthorName - if the author exactly as specified
* isGendre - if the gendre exactly matches
* isTitle - if the title exactly matches
* matchAuthorName - if author matches partially
* matchTitle - if title matches partially
* matchGendre - if gendre matches partially
*/
publicboolean isAuthorName(String a){
return author.isName(a);
}
publicboolean isGendre(String g){
return gendre.isGendre(g);
}
publicboolean isTitle(String t){
return title.isTitle(t);
}
publicboolean matchAuthorName(String a){
return author.matchName(a);
}
publicboolean matchAuthorIndex(int i){
return author.matchIndex(i);
}
publicboolean matchTitle(String t){
return title.matchTitle(t);
}
publicboolean matchGendre(String g){
return gendre.matchGendre(g);
}
/*
* toString - return in format title:gendre:price
*/
// @Override
publicString toString(){
return title +":"+ gendre +":"+ price;
}
}
Final.javaFinal.javapackage demo;
publicclassFinalextends javax.swing.JFrame{
publicFinal(){
initComponents();
}
/**
* This method is called from within the constructor to initial
ize the form.
* WARNING: Do NOT modify this code. The content of this
method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-
fold defaultstate="collapsed" desc="Generated Code">//GEN-
BEGIN:initComponents
privatevoid initComponents(){
firstNameLabel =new javax.swing.JLabel();
firstNameField =new javax.swing.JTextField();
lastNameLabel =new javax.swing.JLabel();
lastNameField =new javax.swing.JTextField();
emailLabel =new javax.swing.JLabel();
emailField =new javax.swing.JTextField();
jScrollPane1 =new javax.swing.JScrollPane();
availableList =new javax.swing.JList();
jScrollPane2 =new javax.swing.JScrollPane();
selectedList =new javax.swing.JList();
cancelButton =new javax.swing.JButton();
okButton =new javax.swing.JButton();
availableLabel =new javax.swing.JLabel();
selectedLabel =new javax.swing.JLabel();
jLabel1 =new javax.swing.JLabel();
jTextField1 =new javax.swing.JTextField();
jPanel1 =new javax.swing.JPanel();
unselectAllButton =new javax.swing.JButton();
selectAllButton =new javax.swing.JButton();
unselectButton =new javax.swing.JButton();
selectButton =new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.
EXIT_ON_CLOSE);
firstNameLabel.setText("First Name:");
lastNameLabel.setText("Last Name:");
emailLabel.setText("E-mail:");
availableList.setModel(new javax.swing.AbstractListMode
l(){
String[] strings ={"Mathematics","Physics","Chemistry","Biolo
gy","Architecture","Geology"};
publicint getSize(){return strings.length;}
publicObject getElementAt(int i){return strings[i];}
});
jScrollPane1.setViewportView(availableList);
selectedList.setModel(new javax.swing.AbstractListModel
(){
String[] strings ={"Philosophy","Astronomy","Religion","Psych
ology"};
publicint getSize(){return strings.length;}
publicObject getElementAt(int i){return strings[i];}
});
jScrollPane2.setViewportView(selectedList);
cancelButton.setText("Cancel");
okButton.setText("OK");
availableLabel.setText("Available Topics:");
selectedLabel.setText("Selected Topics:");
jLabel1.setText("Middle Name:");
unselectAllButton.setText("<<");
selectAllButton.setText(">>");
unselectButton.setText("<");
selectButton.setText(">");
javax.swing.GroupLayout jPanel1Layout =new javax.swin
g.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0,0,0)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addComponent(selectAllButton)
.addComponent(selectButton)
.addComponent(unselectButton)
.addComponent(unselectAllButton))
.addGap(0,0,0))
);
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORI
ZONTAL,new java.awt.Component[]{selectAllButton, selectBut
ton, unselectAllButton, unselectButton});
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,S
hort.MAX_VALUE)
.addComponent(selectAllButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(selectButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(unselectButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(unselectAllButton)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,S
hort.MAX_VALUE))
);
javax.swing.GroupLayout layout =new javax.swing.Group
Layout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.A
lignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, lay
out.createSequentialGroup()
.addGap(0,0,Short.MAX_VALUE)
.addComponent(okButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(cancelButton))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRE
D_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swi
ng.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED))
.addComponent(availableLabel))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(selectedLabel)
.addGap(0,0,Short.MAX_VALUE))
.addComponent(jScrollPane2)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addComponent(firstNameLabel)
.addComponent(lastNameLabel)
.addComponent(emailLabel)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addComponent(firstNameField)
.addComponent(lastNameField)
.addComponent(emailField)
.addComponent(jTextField1))))
.addContainerGap())
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTA
L,new java.awt.Component[]{cancelButton, okButton});
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.A
lignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(firstNameLabel)
.addComponent(firstNameField, javax.swing.GroupLayout.PRE
FERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, ja
vax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFER
RED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s
wing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(lastNameLabel)
.addComponent(lastNameField, javax.swing.GroupLayout.PREF
ERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, java
x.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(emailLabel)
.addComponent(emailField, javax.swing.GroupLayout.PREFER
RED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s
wing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(availableLabel)
.addComponent(selectedLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addComponent(jScrollPane1)
.addComponent(jScrollPane2)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_
SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_
VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.BASELINE)
.addComponent(cancelButton)
.addComponent(okButton))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
publicstaticvoid main(String args[]){
/* Set the Nimbus look and feel */
//<editor-
fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay wit
h the default look and feel.
* For details see http://download.oracle.com/javase/tutori
al/uiswing/lookandfeel/plaf.html
*/
try{
for(javax.swing.UIManager.LookAndFeelInfo info : javax.swing
.UIManager.getInstalledLookAndFeels()){
if("Nimbus".equals(info.getName())){
javax.swing.UIManager.setLookAndFeel(info.getC
lassName());
break;
}
}
}catch(ClassNotFoundException ex){
java.util.logging.Logger.getLogger(Final.class.getName
()).log(java.util.logging.Level.SEVERE,null, ex);
}catch(InstantiationException ex){
java.util.logging.Logger.getLogger(Final.class.getName
()).log(java.util.logging.Level.SEVERE,null, ex);
}catch(IllegalAccessException ex){
java.util.logging.Logger.getLogger(Final.class.getName
()).log(java.util.logging.Level.SEVERE,null, ex);
}catch(javax.swing.UnsupportedLookAndFeelException ex){
java.util.logging.Logger.getLogger(Final.class.getName
()).log(java.util.logging.Level.SEVERE,null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(newRunnable(){
@Override
publicvoid run(){
newFinal().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel availableLabel;
private javax.swing.JList availableList;
private javax.swing.JButton cancelButton;
private javax.swing.JTextField emailField;
private javax.swing.JLabel emailLabel;
private javax.swing.JTextField firstNameField;
private javax.swing.JLabel firstNameLabel;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField lastNameField;
private javax.swing.JLabel lastNameLabel;
private javax.swing.JButton okButton;
private javax.swing.JButton selectAllButton;
private javax.swing.JButton selectButton;
private javax.swing.JLabel selectedLabel;
private javax.swing.JList selectedList;
private javax.swing.JButton unselectAllButton;
private javax.swing.JButton unselectButton;
// End of variables declaration//GEN-END:variables
}
Gendre.javaGendre.javapackageBook;
import java.util.ArrayList;
/*
* This class represents one
* or more (not yet implemented)
* book gendre (s)
*/
publicclassGendre{
ArrayList<String> list;
/*
* Constructor - create empty set of gendres
*/
publicGendre(){
list =newArrayList<String>();// create new list
}
/*
* Constructor with 1 argument - gendre
*/
publicGendre(String g){
list =newArrayList<String>();// create new list
list.add(g);
}
/*
* setGendre() - set gendre
*
*/
publicvoid setGendre(ArrayList gendre){
list = gendre;
}
/*
* getGendre() - get a list of gendres of this book
*/
publicArrayList<String> getGendre(){
return list;
}
/*
*
* isGendre -
return true if this gendre is already in a list of gendres
*/
publicboolean isGendre(String gendre){
for(int i=0; i<list.size(); i++){
if(list.get(i).equalsIgnoreCase(gendre))returntrue;
}
returnfalse;
}
/*
* matchGendre -
return true if 'n' matches any gendre substring
*/
publicboolean matchGendre(String g){
for(int i=0; i<list.size(); i++){
if(list.get(i).matches(g))returntrue;
}
returnfalse;
}
/* convert list of gendres to gendre1,gendre2,gendre3,.. string *
/
@Override
publicString toString(){
String result=newString();
if(list.size()>0) result = list.get(0);
for(int i =1; i<list.size(); i++){
result=result+","+list.get(i);
}
return result;
}
}
LibrartyUI.javaLibrartyUI.java
/*
* Use separate package for GUI
* import our 'books' classes
*/
import java.io.*;
publicclassLibrartyUIextends javax.swing.JFrame{
staticLibrary lib;
/**
* Creates new form BookStoreUI
*/
publicLibrartyUI(){
super();
initComponents();
}
/**
* This method is called from within the constructor to initial
ize the form.
* WARNING: Do NOT modify this code. The content of this
method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-
fold defaultstate="collapsed" desc="Generated Code">//GEN-
BEGIN:initComponents
privatevoid initComponents(){
jMenuBar1 =new javax.swing.JMenuBar();
jMenu1 =new javax.swing.JMenu();
jMenu2 =new javax.swing.JMenu();
buttonGroup1 =new javax.swing.ButtonGroup();
buttonGroup2 =new javax.swing.ButtonGroup();
jPanel1 =new javax.swing.JPanel();
jLabel1 =new javax.swing.JLabel();
jRadioButtonAuthorIndex =new javax.swing.JRadioButton
();
jRadioButtonBookIndex =new javax.swing.JRadioButton()
;
jRadioButtonBookTitle =new javax.swing.JRadioButton();
jRadioButtonGendre =new javax.swing.JRadioButton();
jLabel2 =new javax.swing.JLabel();
jTextFieldSearch =new javax.swing.JTextField();
jButtonSearch =new javax.swing.JButton();
jLabel3 =new javax.swing.JLabel();
jScrollPane1 =new javax.swing.JScrollPane();
jTextArea1 =new javax.swing.JTextArea();
jMenuBar2 =new javax.swing.JMenuBar();
jMenu3 =new javax.swing.JMenu();
jMenuItem1 =new javax.swing.JMenuItem();
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setDefaultCloseOperation(javax.swing.WindowConstants.
EXIT_ON_CLOSE);
jLabel1.setText("Search on:");
buttonGroup1.add(jRadioButtonAuthorIndex);
jRadioButtonAuthorIndex.setSelected(true);
jRadioButtonAuthorIndex.setText("Author Index");
jRadioButtonAuthorIndex.addActionListener(new java.awt
.event.ActionListener(){
publicvoid actionPerformed(java.awt.event.ActionEvent evt){
jRadioButtonAuthorIndexActionPerformed(evt);
}
});
buttonGroup1.add(jRadioButtonBookIndex);
jRadioButtonBookIndex.setText("Book Index");
jRadioButtonBookIndex.addActionListener(new java.awt.e
vent.ActionListener(){
publicvoid actionPerformed(java.awt.event.ActionEvent evt){
jRadioButtonBookIndexActionPerformed(evt);
}
});
buttonGroup1.add(jRadioButtonBookTitle);
jRadioButtonBookTitle.setText("Book Title");
jRadioButtonBookTitle.addActionListener(new java.awt.e
vent.ActionListener(){
publicvoid actionPerformed(java.awt.event.ActionEvent evt){
jRadioButtonBookTitleActionPerformed(evt);
}
});
buttonGroup1.add(jRadioButtonGendre);
jRadioButtonGendre.setText("Gendre");
jLabel2.setText("Search for:");
jButtonSearch.setText("Search ");
jButtonSearch.addActionListener(new java.awt.event.Acti
onListener(){
publicvoid actionPerformed(java.awt.event.ActionEvent evt){
jButtonSearchActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout =new javax.swin
g.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10,10,10)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addComponent(jRadioButtonGendre)
.addComponent(jRadioButtonBookTitle)
.addComponent(jRadioButtonBookIndex)
.addComponent(jRadioButtonAuthorIndex))))
.addGap(36,36,36)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PR
EFERRED_SIZE,246, javax.swing.GroupLayout.PREFERRED_
SIZE)
.addComponent(jButtonSearch))
.addContainerGap(809,Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupL
ayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.BASELINE)
.addComponent(jRadioButtonAuthorIndex, javax.swing.GroupL
ayout.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFE
RRED_SIZE)
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PR
EFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, j
avax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jRadioButtonBookIndex, javax.swing.GroupLay
out.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFER
RED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(jRadioButtonBookTitle, javax.swing.GroupLay
out.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFER
RED_SIZE))
.addComponent(jButtonSearch))
.addGap(2,2,2)
.addComponent(jRadioButtonGendre))
);
jLabel3.setText("Search result:");
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jMenu3.setText("File");
jMenuItem1.setText("Exit");
jMenuItem1.addActionListener(new java.awt.event.Action
Listener(){
publicvoid actionPerformed(java.awt.event.ActionEvent evt){
jMenuItem1ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem1);
jMenuBar2.add(jMenu3);
setJMenuBar(jMenuBar2);
javax.swing.GroupLayout layout =new javax.swing.Group
Layout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.A
lignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_
SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_
VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(10,10,10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayou
t.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFE
RRED_SIZE,634, javax.swing.GroupLayout.PREFERRED_SIZE
))
.addGap(552,552,552))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.A
lignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRE
D_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swi
ng.GroupLayout.PREFERRED_SIZE)
.addGap(23,23,23)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFA
ULT_SIZE,159,Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
privatevoid jMenuItem1ActionPerformed(java.awt.event.Action
Event evt){//GEN-FIRST:event_jMenuItem1ActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_jMenuItem1ActionPerformed
privatevoid jRadioButtonBookTitleActionPerformed(java.awt.ev
ent.ActionEvent evt){//GEN-
FIRST:event_jRadioButtonBookTitleActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jRadioButtonBookTitleActionPerformed
privatevoid jRadioButtonAuthorIndexActionPerformed(java.awt
.event.ActionEvent evt){//GEN-
FIRST:event_jRadioButtonAuthorIndexActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jRadioButtonAuthorIndexActionPerformed
privatevoid jButtonSearchActionPerformed(java.awt.event.Acti
onEvent evt){//GEN-
FIRST:event_jButtonSearchActionPerformed
// TODO add your handling code here
String strAuthorame="";
if(jRadioButtonAuthorIndex.isSelected()){
// Search by Author Index
int index;
index =Integer.parseInt(jTextFieldSearch.getText());
if(lib.searchOnAuthorIndex(index)){
// Update Author's information
Author author = lib.getAuthorOnIndex(index);
jTextArea1.setText(author.toString());
}
else{// author not found - setup empty fields
strAuthorame ="*** NOT FOUND ***";
jTextArea1.setText(strAuthorame);
}
/* After searching on Author Index we also setup currentBook I
ndex */
if(lib.getCurrentBookIndex()!=-1){
Book book;
book = lib.getBookOnIndex(lib.getCurrentBookIndex
());
jTextArea1.setText(book.toString());
}
else{// no more books not found with this author
strAuthorame="";
jTextArea1.setText("*** NOT FOUND ***");
}
}
/* Search by Book Index */
elseif(jRadioButtonBookIndex.isSelected()){
// Search by Author Index
int index;
index =Integer.parseInt(jTextFieldSearch.getText());
if(lib.searchOnBookIndex(index)){
// Update Book information
Book book = lib.getBookOnIndex(index);
String bk = book.toString()+"n";
Author author = lib.getAuthorOnIndex(lib.getCurrentAuthorInd
ex());
bk += author.toString();
jTextArea1.setText(bk);
}
else{// Book not found
String strTitle =("*** NOT FOUND ***");
jTextArea1.setText(strTitle);
}
}
/*
* Search by BOOK TITLE
*/
elseif(jRadioButtonBookTitle.isSelected()){
String title = jTextFieldSearch.getText();
/* If book found */
if(lib.searchOnBookTitle(title)){
int index = lib.getCurrentBookIndex();
// Update Book information
Book book = lib.getBookOnIndex(index);
String strTitle =(book.getTitle().toString())+"n";
strTitle +=(book.getGendre().toString())+"n";
Author author = lib.getAuthorOnIndex(lib.getCurrentAuthorInd
ex());
strTitle += author.toString()+"n";
Address address = author.getAddress();
strTitle += address.toString();
jTextArea1.setText(strTitle);
}

More Related Content

Similar to Conversion cost consists of which of the following Direct lab.docx

Bu330 accounting for managers exam part 1
Bu330 accounting for managers exam part 1Bu330 accounting for managers exam part 1
Bu330 accounting for managers exam part 1homeworkecrater
 
Acc 225 week 9 capstone discussion question
Acc 225 week 9 capstone discussion questionAcc 225 week 9 capstone discussion question
Acc 225 week 9 capstone discussion questiontreaddunnxili1979
 
authority the right to direct with permission to act.centralizat.docx
authority the right to direct with permission to act.centralizat.docxauthority the right to direct with permission to act.centralizat.docx
authority the right to direct with permission to act.centralizat.docxikirkton
 
Accounting1Dividends are distributions of profits to the owne.docx
Accounting1Dividends are distributions of profits to the owne.docxAccounting1Dividends are distributions of profits to the owne.docx
Accounting1Dividends are distributions of profits to the owne.docxannetnash8266
 
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdf
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdfFINANCIAL STATEMENT ANALYSIS MATERIAL.pdf
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdfneelesh2k5
 
Company 1Company #1Income StatementBalance SheetAll numbers in tho
Company 1Company #1Income StatementBalance SheetAll numbers in thoCompany 1Company #1Income StatementBalance SheetAll numbers in tho
Company 1Company #1Income StatementBalance SheetAll numbers in thoLynellBull52
 
Acc 561 final exams
Acc 561 final examsAcc 561 final exams
Acc 561 final examsexamzking
 
Accounting standards b.com ii
Accounting standards b.com iiAccounting standards b.com ii
Accounting standards b.com iiShivaji Shinde
 
Process of control
Process of controlProcess of control
Process of controlDipak Mer
 
MAS compilation of questions
MAS compilation of questionsMAS compilation of questions
MAS compilation of questionsacctg2012
 
Which of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxWhich of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxalanfhall8953
 
Managerial accounting-Test Bank for Students
Managerial accounting-Test Bank for Students Managerial accounting-Test Bank for Students
Managerial accounting-Test Bank for Students sadraus
 
Men Health 12102014Smoking Smoking is bad for human being .docx
Men Health 12102014Smoking Smoking is bad for human being .docxMen Health 12102014Smoking Smoking is bad for human being .docx
Men Health 12102014Smoking Smoking is bad for human being .docxandreecapon
 
Which of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxWhich of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxphilipnelson29183
 

Similar to Conversion cost consists of which of the following Direct lab.docx (19)

Aaaaa
AaaaaAaaaa
Aaaaa
 
Bu330 accounting for managers exam part 1
Bu330 accounting for managers exam part 1Bu330 accounting for managers exam part 1
Bu330 accounting for managers exam part 1
 
Analysis of cost
Analysis of costAnalysis of cost
Analysis of cost
 
SMRM MI Chapter 10 CVP Analysis
SMRM MI Chapter 10  CVP AnalysisSMRM MI Chapter 10  CVP Analysis
SMRM MI Chapter 10 CVP Analysis
 
Nolen bootcamp
Nolen bootcampNolen bootcamp
Nolen bootcamp
 
Acc 225 week 9 capstone discussion question
Acc 225 week 9 capstone discussion questionAcc 225 week 9 capstone discussion question
Acc 225 week 9 capstone discussion question
 
authority the right to direct with permission to act.centralizat.docx
authority the right to direct with permission to act.centralizat.docxauthority the right to direct with permission to act.centralizat.docx
authority the right to direct with permission to act.centralizat.docx
 
Accounting1Dividends are distributions of profits to the owne.docx
Accounting1Dividends are distributions of profits to the owne.docxAccounting1Dividends are distributions of profits to the owne.docx
Accounting1Dividends are distributions of profits to the owne.docx
 
Fin 200 final exam
Fin 200 final examFin 200 final exam
Fin 200 final exam
 
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdf
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdfFINANCIAL STATEMENT ANALYSIS MATERIAL.pdf
FINANCIAL STATEMENT ANALYSIS MATERIAL.pdf
 
Company 1Company #1Income StatementBalance SheetAll numbers in tho
Company 1Company #1Income StatementBalance SheetAll numbers in thoCompany 1Company #1Income StatementBalance SheetAll numbers in tho
Company 1Company #1Income StatementBalance SheetAll numbers in tho
 
Acc 561 final exams
Acc 561 final examsAcc 561 final exams
Acc 561 final exams
 
Accounting standards b.com ii
Accounting standards b.com iiAccounting standards b.com ii
Accounting standards b.com ii
 
Process of control
Process of controlProcess of control
Process of control
 
MAS compilation of questions
MAS compilation of questionsMAS compilation of questions
MAS compilation of questions
 
Which of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxWhich of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docx
 
Managerial accounting-Test Bank for Students
Managerial accounting-Test Bank for Students Managerial accounting-Test Bank for Students
Managerial accounting-Test Bank for Students
 
Men Health 12102014Smoking Smoking is bad for human being .docx
Men Health 12102014Smoking Smoking is bad for human being .docxMen Health 12102014Smoking Smoking is bad for human being .docx
Men Health 12102014Smoking Smoking is bad for human being .docx
 
Which of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docxWhich of the following is an advantage of corporations relative to.docx
Which of the following is an advantage of corporations relative to.docx
 

More from maxinesmith73660

You have been chosen to present in front of your local governing boa.docx
You have been chosen to present in front of your local governing boa.docxYou have been chosen to present in front of your local governing boa.docx
You have been chosen to present in front of your local governing boa.docxmaxinesmith73660
 
You have been charged with overseeing the implementation of cybersec.docx
You have been charged with overseeing the implementation of cybersec.docxYou have been charged with overseeing the implementation of cybersec.docx
You have been charged with overseeing the implementation of cybersec.docxmaxinesmith73660
 
You have been commissioned to create a manual covering the installat.docx
You have been commissioned to create a manual covering the installat.docxYou have been commissioned to create a manual covering the installat.docx
You have been commissioned to create a manual covering the installat.docxmaxinesmith73660
 
You have been challenged by a mentor you respect and admire to demon.docx
You have been challenged by a mentor you respect and admire to demon.docxYou have been challenged by a mentor you respect and admire to demon.docx
You have been challenged by a mentor you respect and admire to demon.docxmaxinesmith73660
 
You have been chosen as the consultant group to assess the organizat.docx
You have been chosen as the consultant group to assess the organizat.docxYou have been chosen as the consultant group to assess the organizat.docx
You have been chosen as the consultant group to assess the organizat.docxmaxinesmith73660
 
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docx
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docxYou have been assigned a reading by WMF Petrie; Diospolis Parva (.docx
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docxmaxinesmith73660
 
You have been asked to speak to city, municipal, and state elected a.docx
You have been asked to speak to city, municipal, and state elected a.docxYou have been asked to speak to city, municipal, and state elected a.docx
You have been asked to speak to city, municipal, and state elected a.docxmaxinesmith73660
 
You have been asked to provide a presentation, covering the history .docx
You have been asked to provide a presentation, covering the history .docxYou have been asked to provide a presentation, covering the history .docx
You have been asked to provide a presentation, covering the history .docxmaxinesmith73660
 
You have been asked to organize a community health fair at a loc.docx
You have been asked to organize a community health fair at a loc.docxYou have been asked to organize a community health fair at a loc.docx
You have been asked to organize a community health fair at a loc.docxmaxinesmith73660
 
You have been asked to explain the differences between certain categ.docx
You have been asked to explain the differences between certain categ.docxYou have been asked to explain the differences between certain categ.docx
You have been asked to explain the differences between certain categ.docxmaxinesmith73660
 
You have been asked to evaluate a 3-year-old child in your clinic.  .docx
You have been asked to evaluate a 3-year-old child in your clinic.  .docxYou have been asked to evaluate a 3-year-old child in your clinic.  .docx
You have been asked to evaluate a 3-year-old child in your clinic.  .docxmaxinesmith73660
 
You have been asked to develop UML diagrams to graphically depict .docx
You have been asked to develop UML diagrams to graphically depict .docxYou have been asked to develop UML diagrams to graphically depict .docx
You have been asked to develop UML diagrams to graphically depict .docxmaxinesmith73660
 
You have been asked to develop UML diagrams to graphically depict an.docx
You have been asked to develop UML diagrams to graphically depict an.docxYou have been asked to develop UML diagrams to graphically depict an.docx
You have been asked to develop UML diagrams to graphically depict an.docxmaxinesmith73660
 
You have been asked to develop a quality improvement (QI) process fo.docx
You have been asked to develop a quality improvement (QI) process fo.docxYou have been asked to develop a quality improvement (QI) process fo.docx
You have been asked to develop a quality improvement (QI) process fo.docxmaxinesmith73660
 
You have been asked to design and deliver a Microsoft PowerPoint pre.docx
You have been asked to design and deliver a Microsoft PowerPoint pre.docxYou have been asked to design and deliver a Microsoft PowerPoint pre.docx
You have been asked to design and deliver a Microsoft PowerPoint pre.docxmaxinesmith73660
 
You have been asked to be the project manager for the development of.docx
You have been asked to be the project manager for the development of.docxYou have been asked to be the project manager for the development of.docx
You have been asked to be the project manager for the development of.docxmaxinesmith73660
 
You have been asked to conduct research on a past forensic case to a.docx
You have been asked to conduct research on a past forensic case to a.docxYou have been asked to conduct research on a past forensic case to a.docx
You have been asked to conduct research on a past forensic case to a.docxmaxinesmith73660
 
You have been asked for the summary to include the following compone.docx
You have been asked for the summary to include the following compone.docxYou have been asked for the summary to include the following compone.docx
You have been asked for the summary to include the following compone.docxmaxinesmith73660
 
You have been asked to be the project manager for the developmen.docx
You have been asked to be the project manager for the developmen.docxYou have been asked to be the project manager for the developmen.docx
You have been asked to be the project manager for the developmen.docxmaxinesmith73660
 
You have been asked by management, as a senior member of your co.docx
You have been asked by management, as a senior member of your co.docxYou have been asked by management, as a senior member of your co.docx
You have been asked by management, as a senior member of your co.docxmaxinesmith73660
 

More from maxinesmith73660 (20)

You have been chosen to present in front of your local governing boa.docx
You have been chosen to present in front of your local governing boa.docxYou have been chosen to present in front of your local governing boa.docx
You have been chosen to present in front of your local governing boa.docx
 
You have been charged with overseeing the implementation of cybersec.docx
You have been charged with overseeing the implementation of cybersec.docxYou have been charged with overseeing the implementation of cybersec.docx
You have been charged with overseeing the implementation of cybersec.docx
 
You have been commissioned to create a manual covering the installat.docx
You have been commissioned to create a manual covering the installat.docxYou have been commissioned to create a manual covering the installat.docx
You have been commissioned to create a manual covering the installat.docx
 
You have been challenged by a mentor you respect and admire to demon.docx
You have been challenged by a mentor you respect and admire to demon.docxYou have been challenged by a mentor you respect and admire to demon.docx
You have been challenged by a mentor you respect and admire to demon.docx
 
You have been chosen as the consultant group to assess the organizat.docx
You have been chosen as the consultant group to assess the organizat.docxYou have been chosen as the consultant group to assess the organizat.docx
You have been chosen as the consultant group to assess the organizat.docx
 
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docx
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docxYou have been assigned a reading by WMF Petrie; Diospolis Parva (.docx
You have been assigned a reading by WMF Petrie; Diospolis Parva (.docx
 
You have been asked to speak to city, municipal, and state elected a.docx
You have been asked to speak to city, municipal, and state elected a.docxYou have been asked to speak to city, municipal, and state elected a.docx
You have been asked to speak to city, municipal, and state elected a.docx
 
You have been asked to provide a presentation, covering the history .docx
You have been asked to provide a presentation, covering the history .docxYou have been asked to provide a presentation, covering the history .docx
You have been asked to provide a presentation, covering the history .docx
 
You have been asked to organize a community health fair at a loc.docx
You have been asked to organize a community health fair at a loc.docxYou have been asked to organize a community health fair at a loc.docx
You have been asked to organize a community health fair at a loc.docx
 
You have been asked to explain the differences between certain categ.docx
You have been asked to explain the differences between certain categ.docxYou have been asked to explain the differences between certain categ.docx
You have been asked to explain the differences between certain categ.docx
 
You have been asked to evaluate a 3-year-old child in your clinic.  .docx
You have been asked to evaluate a 3-year-old child in your clinic.  .docxYou have been asked to evaluate a 3-year-old child in your clinic.  .docx
You have been asked to evaluate a 3-year-old child in your clinic.  .docx
 
You have been asked to develop UML diagrams to graphically depict .docx
You have been asked to develop UML diagrams to graphically depict .docxYou have been asked to develop UML diagrams to graphically depict .docx
You have been asked to develop UML diagrams to graphically depict .docx
 
You have been asked to develop UML diagrams to graphically depict an.docx
You have been asked to develop UML diagrams to graphically depict an.docxYou have been asked to develop UML diagrams to graphically depict an.docx
You have been asked to develop UML diagrams to graphically depict an.docx
 
You have been asked to develop a quality improvement (QI) process fo.docx
You have been asked to develop a quality improvement (QI) process fo.docxYou have been asked to develop a quality improvement (QI) process fo.docx
You have been asked to develop a quality improvement (QI) process fo.docx
 
You have been asked to design and deliver a Microsoft PowerPoint pre.docx
You have been asked to design and deliver a Microsoft PowerPoint pre.docxYou have been asked to design and deliver a Microsoft PowerPoint pre.docx
You have been asked to design and deliver a Microsoft PowerPoint pre.docx
 
You have been asked to be the project manager for the development of.docx
You have been asked to be the project manager for the development of.docxYou have been asked to be the project manager for the development of.docx
You have been asked to be the project manager for the development of.docx
 
You have been asked to conduct research on a past forensic case to a.docx
You have been asked to conduct research on a past forensic case to a.docxYou have been asked to conduct research on a past forensic case to a.docx
You have been asked to conduct research on a past forensic case to a.docx
 
You have been asked for the summary to include the following compone.docx
You have been asked for the summary to include the following compone.docxYou have been asked for the summary to include the following compone.docx
You have been asked for the summary to include the following compone.docx
 
You have been asked to be the project manager for the developmen.docx
You have been asked to be the project manager for the developmen.docxYou have been asked to be the project manager for the developmen.docx
You have been asked to be the project manager for the developmen.docx
 
You have been asked by management, as a senior member of your co.docx
You have been asked by management, as a senior member of your co.docxYou have been asked by management, as a senior member of your co.docx
You have been asked by management, as a senior member of your co.docx
 

Recently uploaded

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Conversion cost consists of which of the following Direct lab.docx

  • 1. Conversion cost consists of which of the following? Direct labor and manufacturing overhead cost. Direct materials and direct labor cost. Manufacturing overhead cost. Direct labor cost. 2. East Company manufactures and sells a single product with a positive contribution margin. If the selling price and the variable expense per unit both increase 5% and fixed expenses do not change, what is the effect on the contribution margin per unit and the contribution margin ratio? Option C Option D Option B Option A 3.
  • 2. Which of the following three statements are correct? I. A profit center has control over both cost and revenue. II. An investment center has control over invested funds, but not over costs and revenue. III. A cost center has no control over sales. Only II. Only I and III. Only I and II. Only I. 4. Which of the following costs is an example of a period rather than a product cost? Depreciation on production equipment. Wages of salespersons. Wages of production machine operators. Insurance on production equipment. 5.
  • 3. An increase in the discount rate will result in an increase in the present value of a given cash flow. True False 6. The purpose of the Data Processing Department of Falena Corporation is to assist the various departments of the corporation with their information needs free of charge. The Data Processing Department would best be evaluated as a: revenue center. investment center. cost center. profit center. Top of Form 7. Which of the following represents the normal sequence in which the indicated budgets are prepared?
  • 4. Sales, Balance Sheet, Direct Labor Production, Manufacturing Overhead, Sales Production, Cash, Income Statement Direct Materials, Cash, Sales Bottom of Form 8. The wages of factory maintenance personnel would usually be considered to be: Option D Option C Option B Option A 9. Horizontal analysis involves comparing two or more years' financial data for a single company.
  • 5. True False 10. For a given level of sales, a low contribution margin ratio will produce less net operating income than a high contribution margin ratio. True False 11. Manufacturing overhead consists of: indirect materials but not indirect labor. indirect labor but not indirect materials. all manufacturing costs, except direct materials and direct labor. all manufacturing costs. Net income/Cost of goods sold
  • 6. 12. The formula for the gross margin percentage is: (Sales - Cost of goods sold)/Cost of goods sold (Sales - Cost of goods sold)/Sales Net income/Sales Net income/Cost of goods sold 13. Which of the following statements is not correct? The sales budget generally is accompanied by a computation of expected cash receipts for the forthcoming budget period. The cash budget must be prepared prior to the sales budget because managers want to know the expected cash collections on sales made to customers in prior periods before projecting sales for the current period. The sales budget is constructed by multiplying the expected sales in units by the sales price. The sales budget is the starting point in preparing the master budget.
  • 7. 14. In activity-based costing, the total overhead cost in an activity cost pool can be computed by: dividing the total activity in the activity cost pool by the activity rate for the activity cost pool. dividing the total direct labor-hours in the activity cost pool by the activity rate for the activity cost pool. multiplying the total direct labor-hours in the activity cost pool by the activity rate for the activity cost pool. multiplying the total activity in the activity cost pool by the activity rate for the activity cost pool. 15. Issuing new shares of stock in a five-for-one split of common stock would: increase total stockholders' equity. decrease total stockholders' equity. decrease the book value per share of common stock. increase the book value per share of common stock.
  • 8. 16. The difference between total sales in dollars and total variable expenses is called: net operating income. the contribution margin. the gross margin. net profit. 17. Which of the following statements provide(s) an argument in favor of including only a plant's net book value rather than gross book value as part of operating assets in the ROI computation? I. Net book value is consistent with how plant and equipment items are reported on a balance sheet. II. Net book value is consistent with the computation of net operating income, which includes depreciation as an operating expense. III. Net book value allows ROI to decrease over time as assets get older. Only I.
  • 9. Only I and II. Only I and III. Only III. 18. Guerra Electronics manufactures a variety of electronic gadgets for use in the home. Which of the following would probably be the most accurate measure of activity to use for allocating the cost of inspecting the finished products at Guerra? Machine-hours Number of inspections Direct labor-hours Inspection time 19. If two companies have the same total sales and total expenses and make the same product, the volatility of net operating income with changes in sales will tend to be greater in the company with a higher proportion of fixed expenses in its cost structure. True
  • 10. False Top of Form 20. Budgeted production needs are determined by: deducting the beginning inventory in units from budgeted sales in units. adding budgeted sales in units to the desired ending inventory in units and deducting the beginning inventory in units from this total. adding budgeted sales in units to the beginning inventory in units and deducting the desired ending inventory in units from this total. adding budgeted sales in units to the desired ending inventory in units. Bottom of Form ©2011 T 21. If a company's return on assets is substantially higher than its cost of borrowing, then the common stockholders would normally want the company to have a relatively high debt/equity
  • 11. ratio. True False 22. Residual income is superior to return on investment as a means of measuring performance because it encourages managers to make investment decisions that are more consistent with the interests of the company as a whole. True False 23. National Telephone company has been forced by competition to put much more emphasis on planning and controlling its costs. Accordingly, the company's controller has suggested initiating a formal budgeting process. Which of the following steps will NOT help the company gain maximum acceptance by employees of the proposed budgeting system? Demonstrating top management support for the budgeting program.
  • 12. Implementing the change quickly. Ensuring that favorable deviations of actual results from the budget, as well as unfavorable deviations, are discussed with the responsible managers. Including in departmental responsibility reports only those items that are under the department manager's control. 24. Human resource management is an example of an activity at which of the following levels? Batch-level activity. Facility-level activity. Product-level activity. Unit-level activity. 25. The market price of XYZ Company's common stock dropped from $25 to $21 per share. The dividend paid per share remained unchanged. The company's dividend payout ratio would: increase.
  • 13. decrease. be unchanged. impossible to determine without more information. 26. The master budget is a network consisting of many separate budgets that are interdependent. True False 27. A decrease in the discount rate: b. is one way to compensate for greater risk in a project. d. responses a and b are both correct. a. will increase present values of future cash flows. c. will reduce present values of future cash flows. 28.
  • 14. Product engineering is an example of a: Batch-level activity. Product-level activity. Unit-level activity. Facility-level activity. 29. The use of return on investment as a performance measure may lead managers to make decisions that are not in the best interests of the company as a whole. True False 30. If an investment has cash outflows of Q dollars at the end of each year for three years, then the present value of these cash outflows under a 10% rate of return will be: greater than under a 12% rate of return.
  • 15. equal to that under a 12% rate of return. less than under a 12% rate of return. unknown because it depends on the size of Q. 31. Even if operations are interrupted or cut back, committed fixed costs remain largely unchanged in the short term because the costs of restoring them later are likely to be far greater than any short-run savings that might be realized. True False 32. The dividend yield ratio is calculated by dividing dividends per share by earnings per share. True False 3.
  • 16. When a company shifts from a traditional cost system in which manufacturing overhead is applied based on direct labor-hours to an activity-based costing system in which there are batch- level and product-level costs, the unit product costs of high volume products typically decrease whereas the unit product costs of low volume products typically increase. True False Top of Form 34. Financial leverage is negative when: total liabilities are less than total assets. the return on total assets is less than the rate of return demanded by creditors. the return on total assets is less than the rate of return on common stockholders' equity. total liabilities are less than stockholders' equity. 35.
  • 17. A company with a degree of operating leverage of 4 would expect net operating income to increase by 200% if sales increased from $100,000 to $150,000. True False Bottom of Form library.txt A:0:Author Name:Street One:Washi:DC:20002:(202)635-0000 B:0:Java One:technica:50.59:0 A:1:Author Name Two:Street Two:New York:NY:12122:(508)123-0000 B:1:Java Two:action:6.14:1 Address.javaAddress.javapackageBook; //import Book.Address; //import Library2.Genre; publicclassAddress{ String street;// street address String city;// city String state;// state String zip;// zip String phone;// phone /* * Constructor with empty set of arguments - create empty strings */ publicAddress(){ street=newString();
  • 18. city =newString(); state =newString(); zip =newString(); phone =newString(); } /* * Constructor with all arguments */ publicAddress(String s,String c,String z,String st,String p){ street = s; city = c; zip = z; state = st; phone = p; } /* * setStreet - set street address */ publicvoid setStreet (String s){ street = s; } /* * getStreet - return street address */ publicString getStreet(){ return street; } /* * setCity - set city */ publicvoid setCity (String c){ city = c; } /* * getCity - return city
  • 19. */ publicString getCity(){ return city; } /* * setZip - set zip code */ publicvoid setZip (String z){ zip = z; } /* * getZip - return zip code */ publicString getZip(){ return zip; } /* * setState - set state */ publicvoid setState(String st){ state = st; } /* * getState - get state */ publicString getState(){ return state; } /* * setPhone - set phone number */ publicvoid setPhone (String p){ phone = p; } /*
  • 20. * getPhone - return phone number */ publicString getPhone(){ return phone; } /* Return true if address matches */ publicboolean isAddress(String s,String c,String z,String st){ return(s.equalsIgnoreCase(street)&& c.equalsIgnoreCase(city)& & z.equalsIgnoreCase(zip)&& st.equalsIgnoreCase(stat e)); } /* * Return address in format street addr:city:zip:phone */ //@Override publicString toString(){ return street+":"+city+":"+zip+":"+state+":"+phone; } } Author.javaAuthor.java packageBook; /* * Author class - represents an author * */ publicclassAuthor{ Address addr; String name;/* Author's name */ int index;/* index */
  • 21. /* * Constructor with no args */ publicAuthor(){ addr =newAddress(); name =newString(); index =-1;/* unspecified */ } /* * Constructor with 1 argument - name */ publicAuthor(String n){ name = n; addr =newAddress(); index =-1; } /* * Constructor with 2 arguments - name and address */ publicAuthor(String n,int ind,Address a){ name = n; index = ind; addr = a; } /* Return true if the author has the same name */ publicboolean isName(String n){ return n.equalsIgnoreCase(name); } /* Return true if author's index is i */ publicboolean isIndex(int i){ return getIndex()== i; } /*
  • 22. * Return true if string 'n' matches author's name substring */ publicboolean matchName(String n){ return name.matches(n); } /* * Return true if author's index matches i, same as isAuthorIn dex */ publicboolean matchIndex(int i){ return isIndex(i); } /* * getName - get name */ publicString getName(){ return name; } /* * setName - set name */ publicvoid setName(String n){ name = n; } /* * setIndex - set author's index */ publicvoid setIndex(int ind){ index = ind; } /* * getIndex - get author's index */ publicint getIndex(){ return index; }
  • 23. /* * getAddress - get address */ publicAddress getAddress(){ return addr; } /* * setAddress - set address */ publicvoid setAddress(Address a){ addr = a; } /* * Return author in format first last:street address:city:zip:ph one */ @Override publicString toString(){ return name +":"+ addr;// will use addr.toString() } } Book.javaBook.javapackageBook; //This Class represents a book publicclassBook{ Author author; Title title; Gendre gendre; int index; float price;
  • 24. /* * Constructor with no arguments - initialize members */ publicBook(){ author =newAuthor(); title =newTitle(); gendre =newGendre(); price =0; index =-1;/* unspecified */ } /* * Constructor with all arguments */ publicBook(int i,Title t,Author a,Gendre g,float p){ author = a; title = t; gendre = g; price = p; index = i; } /* * setPrice - set the book price */ publicvoid setPrice(float p){ price = p; } /* * getPrice - get the book price */ publicfloat getPrice(){ return price; } /* * setAuthor - set the book's author
  • 25. */ publicvoid setAuthor (Author a){ author = a; } /* * getAuthor - get author */ publicAuthor getAuthor(){ return author; } /* * setTitle - set the book title */ publicvoid setTitle(Title t){ title = t; } /* * getTitle - get the book title */ publicTitle getTitle(){ return title; } /* * setGendre - set gendre */ publicvoid setGendre(Gendre g){ gendre = g; } /* * getGendre - get gendre */ publicGendre getGendre(){ return gendre; }
  • 26. /* * setIndex - set index */ publicvoid setIndex(int ind){ index = ind; } /* * getIndex - get index */ publicint getIndex(){ return index; } /* Book match functions (used for search) * isAuthorName - if the author exactly as specified * isGendre - if the gendre exactly matches * isTitle - if the title exactly matches * matchAuthorName - if author matches partially * matchTitle - if title matches partially * matchGendre - if gendre matches partially */ publicboolean isAuthorName(String a){ return author.isName(a); } publicboolean isGendre(String g){ return gendre.isGendre(g); } publicboolean isTitle(String t){ return title.isTitle(t); } publicboolean matchAuthorName(String a){ return author.matchName(a); } publicboolean matchAuthorIndex(int i){ return author.matchIndex(i);
  • 27. } publicboolean matchTitle(String t){ return title.matchTitle(t); } publicboolean matchGendre(String g){ return gendre.matchGendre(g); } /* * toString - return in format title:gendre:price */ // @Override publicString toString(){ return title +":"+ gendre +":"+ price; } } Final.javaFinal.javapackage demo; publicclassFinalextends javax.swing.JFrame{ publicFinal(){ initComponents(); } /** * This method is called from within the constructor to initial ize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor- fold defaultstate="collapsed" desc="Generated Code">//GEN- BEGIN:initComponents
  • 28. privatevoid initComponents(){ firstNameLabel =new javax.swing.JLabel(); firstNameField =new javax.swing.JTextField(); lastNameLabel =new javax.swing.JLabel(); lastNameField =new javax.swing.JTextField(); emailLabel =new javax.swing.JLabel(); emailField =new javax.swing.JTextField(); jScrollPane1 =new javax.swing.JScrollPane(); availableList =new javax.swing.JList(); jScrollPane2 =new javax.swing.JScrollPane(); selectedList =new javax.swing.JList(); cancelButton =new javax.swing.JButton(); okButton =new javax.swing.JButton(); availableLabel =new javax.swing.JLabel(); selectedLabel =new javax.swing.JLabel(); jLabel1 =new javax.swing.JLabel(); jTextField1 =new javax.swing.JTextField(); jPanel1 =new javax.swing.JPanel(); unselectAllButton =new javax.swing.JButton(); selectAllButton =new javax.swing.JButton(); unselectButton =new javax.swing.JButton(); selectButton =new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants. EXIT_ON_CLOSE); firstNameLabel.setText("First Name:"); lastNameLabel.setText("Last Name:"); emailLabel.setText("E-mail:"); availableList.setModel(new javax.swing.AbstractListMode l(){ String[] strings ={"Mathematics","Physics","Chemistry","Biolo
  • 29. gy","Architecture","Geology"}; publicint getSize(){return strings.length;} publicObject getElementAt(int i){return strings[i];} }); jScrollPane1.setViewportView(availableList); selectedList.setModel(new javax.swing.AbstractListModel (){ String[] strings ={"Philosophy","Astronomy","Religion","Psych ology"}; publicint getSize(){return strings.length;} publicObject getElementAt(int i){return strings[i];} }); jScrollPane2.setViewportView(selectedList); cancelButton.setText("Cancel"); okButton.setText("OK"); availableLabel.setText("Available Topics:"); selectedLabel.setText("Selected Topics:"); jLabel1.setText("Middle Name:"); unselectAllButton.setText("<<"); selectAllButton.setText(">>"); unselectButton.setText("<"); selectButton.setText(">"); javax.swing.GroupLayout jPanel1Layout =new javax.swin g.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout);
  • 30. jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupL ayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(0,0,0) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addComponent(selectAllButton) .addComponent(selectButton) .addComponent(unselectButton) .addComponent(unselectAllButton)) .addGap(0,0,0)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORI ZONTAL,new java.awt.Component[]{selectAllButton, selectBut ton, unselectAllButton, unselectButton}); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupL ayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,S hort.MAX_VALUE) .addComponent(selectAllButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(selectButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(unselectButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(unselectAllButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,S hort.MAX_VALUE))
  • 31. ); javax.swing.GroupLayout layout =new javax.swing.Group Layout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.A lignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, lay out.createSequentialGroup() .addGap(0,0,Short.MAX_VALUE) .addComponent(okButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(cancelButton)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRE D_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swi ng.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED)) .addComponent(availableLabel)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(selectedLabel)
  • 32. .addGap(0,0,Short.MAX_VALUE)) .addComponent(jScrollPane2))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addComponent(firstNameLabel) .addComponent(lastNameLabel) .addComponent(emailLabel) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addComponent(firstNameField) .addComponent(lastNameField) .addComponent(emailField) .addComponent(jTextField1)))) .addContainerGap()) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTA L,new java.awt.Component[]{cancelButton, okButton}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.A lignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(firstNameLabel) .addComponent(firstNameField, javax.swing.GroupLayout.PRE FERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, ja vax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED)
  • 33. .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFER RED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s wing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(lastNameLabel) .addComponent(lastNameField, javax.swing.GroupLayout.PREF ERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, java x.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(emailLabel) .addComponent(emailField, javax.swing.GroupLayout.PREFER RED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.s wing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(availableLabel) .addComponent(selectedLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addComponent(jScrollPane1) .addComponent(jScrollPane2) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_ SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_
  • 34. VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.BASELINE) .addComponent(cancelButton) .addComponent(okButton)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ publicstaticvoid main(String args[]){ /* Set the Nimbus look and feel */ //<editor- fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay wit h the default look and feel. * For details see http://download.oracle.com/javase/tutori al/uiswing/lookandfeel/plaf.html */ try{ for(javax.swing.UIManager.LookAndFeelInfo info : javax.swing .UIManager.getInstalledLookAndFeels()){ if("Nimbus".equals(info.getName())){ javax.swing.UIManager.setLookAndFeel(info.getC lassName()); break; } } }catch(ClassNotFoundException ex){
  • 35. java.util.logging.Logger.getLogger(Final.class.getName ()).log(java.util.logging.Level.SEVERE,null, ex); }catch(InstantiationException ex){ java.util.logging.Logger.getLogger(Final.class.getName ()).log(java.util.logging.Level.SEVERE,null, ex); }catch(IllegalAccessException ex){ java.util.logging.Logger.getLogger(Final.class.getName ()).log(java.util.logging.Level.SEVERE,null, ex); }catch(javax.swing.UnsupportedLookAndFeelException ex){ java.util.logging.Logger.getLogger(Final.class.getName ()).log(java.util.logging.Level.SEVERE,null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(newRunnable(){ @Override publicvoid run(){ newFinal().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel availableLabel; private javax.swing.JList availableList; private javax.swing.JButton cancelButton; private javax.swing.JTextField emailField; private javax.swing.JLabel emailLabel; private javax.swing.JTextField firstNameField; private javax.swing.JLabel firstNameLabel; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField lastNameField;
  • 36. private javax.swing.JLabel lastNameLabel; private javax.swing.JButton okButton; private javax.swing.JButton selectAllButton; private javax.swing.JButton selectButton; private javax.swing.JLabel selectedLabel; private javax.swing.JList selectedList; private javax.swing.JButton unselectAllButton; private javax.swing.JButton unselectButton; // End of variables declaration//GEN-END:variables } Gendre.javaGendre.javapackageBook; import java.util.ArrayList; /* * This class represents one * or more (not yet implemented) * book gendre (s) */ publicclassGendre{ ArrayList<String> list; /* * Constructor - create empty set of gendres */ publicGendre(){ list =newArrayList<String>();// create new list } /* * Constructor with 1 argument - gendre */ publicGendre(String g){ list =newArrayList<String>();// create new list list.add(g); }
  • 37. /* * setGendre() - set gendre * */ publicvoid setGendre(ArrayList gendre){ list = gendre; } /* * getGendre() - get a list of gendres of this book */ publicArrayList<String> getGendre(){ return list; } /* * * isGendre - return true if this gendre is already in a list of gendres */ publicboolean isGendre(String gendre){ for(int i=0; i<list.size(); i++){ if(list.get(i).equalsIgnoreCase(gendre))returntrue; } returnfalse; } /* * matchGendre - return true if 'n' matches any gendre substring */ publicboolean matchGendre(String g){ for(int i=0; i<list.size(); i++){ if(list.get(i).matches(g))returntrue; } returnfalse; }
  • 38. /* convert list of gendres to gendre1,gendre2,gendre3,.. string * / @Override publicString toString(){ String result=newString(); if(list.size()>0) result = list.get(0); for(int i =1; i<list.size(); i++){ result=result+","+list.get(i); } return result; } } LibrartyUI.javaLibrartyUI.java /* * Use separate package for GUI * import our 'books' classes */ import java.io.*; publicclassLibrartyUIextends javax.swing.JFrame{ staticLibrary lib; /** * Creates new form BookStoreUI */ publicLibrartyUI(){ super(); initComponents(); } /**
  • 39. * This method is called from within the constructor to initial ize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor- fold defaultstate="collapsed" desc="Generated Code">//GEN- BEGIN:initComponents privatevoid initComponents(){ jMenuBar1 =new javax.swing.JMenuBar(); jMenu1 =new javax.swing.JMenu(); jMenu2 =new javax.swing.JMenu(); buttonGroup1 =new javax.swing.ButtonGroup(); buttonGroup2 =new javax.swing.ButtonGroup(); jPanel1 =new javax.swing.JPanel(); jLabel1 =new javax.swing.JLabel(); jRadioButtonAuthorIndex =new javax.swing.JRadioButton (); jRadioButtonBookIndex =new javax.swing.JRadioButton() ; jRadioButtonBookTitle =new javax.swing.JRadioButton(); jRadioButtonGendre =new javax.swing.JRadioButton(); jLabel2 =new javax.swing.JLabel(); jTextFieldSearch =new javax.swing.JTextField(); jButtonSearch =new javax.swing.JButton(); jLabel3 =new javax.swing.JLabel(); jScrollPane1 =new javax.swing.JScrollPane(); jTextArea1 =new javax.swing.JTextArea(); jMenuBar2 =new javax.swing.JMenuBar(); jMenu3 =new javax.swing.JMenu(); jMenuItem1 =new javax.swing.JMenuItem(); jMenu1.setText("File");
  • 40. jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setDefaultCloseOperation(javax.swing.WindowConstants. EXIT_ON_CLOSE); jLabel1.setText("Search on:"); buttonGroup1.add(jRadioButtonAuthorIndex); jRadioButtonAuthorIndex.setSelected(true); jRadioButtonAuthorIndex.setText("Author Index"); jRadioButtonAuthorIndex.addActionListener(new java.awt .event.ActionListener(){ publicvoid actionPerformed(java.awt.event.ActionEvent evt){ jRadioButtonAuthorIndexActionPerformed(evt); } }); buttonGroup1.add(jRadioButtonBookIndex); jRadioButtonBookIndex.setText("Book Index"); jRadioButtonBookIndex.addActionListener(new java.awt.e vent.ActionListener(){ publicvoid actionPerformed(java.awt.event.ActionEvent evt){ jRadioButtonBookIndexActionPerformed(evt); } }); buttonGroup1.add(jRadioButtonBookTitle); jRadioButtonBookTitle.setText("Book Title"); jRadioButtonBookTitle.addActionListener(new java.awt.e vent.ActionListener(){ publicvoid actionPerformed(java.awt.event.ActionEvent evt){ jRadioButtonBookTitleActionPerformed(evt); }
  • 41. }); buttonGroup1.add(jRadioButtonGendre); jRadioButtonGendre.setText("Gendre"); jLabel2.setText("Search for:"); jButtonSearch.setText("Search "); jButtonSearch.addActionListener(new java.awt.event.Acti onListener(){ publicvoid actionPerformed(java.awt.event.ActionEvent evt){ jButtonSearchActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout =new javax.swin g.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupL ayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(10,10,10) .addComponent(jLabel1)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addComponent(jRadioButtonGendre) .addComponent(jRadioButtonBookTitle) .addComponent(jRadioButtonBookIndex) .addComponent(jRadioButtonAuthorIndex)))) .addGap(36,36,36)
  • 42. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PR EFERRED_SIZE,246, javax.swing.GroupLayout.PREFERRED_ SIZE) .addComponent(jButtonSearch)) .addContainerGap(809,Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupL ayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.BASELINE) .addComponent(jRadioButtonAuthorIndex, javax.swing.GroupL ayout.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFE RRED_SIZE) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PR EFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, j avax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jRadioButtonBookIndex, javax.swing.GroupLay out.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFER RED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
  • 43. t.RELATED) .addComponent(jRadioButtonBookTitle, javax.swing.GroupLay out.PREFERRED_SIZE,23, javax.swing.GroupLayout.PREFER RED_SIZE)) .addComponent(jButtonSearch)) .addGap(2,2,2) .addComponent(jRadioButtonGendre)) ); jLabel3.setText("Search result:"); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jMenu3.setText("File"); jMenuItem1.setText("Exit"); jMenuItem1.addActionListener(new java.awt.event.Action Listener(){ publicvoid actionPerformed(java.awt.event.ActionEvent evt){ jMenuItem1ActionPerformed(evt); } }); jMenu3.add(jMenuItem1); jMenuBar2.add(jMenu3); setJMenuBar(jMenuBar2); javax.swing.GroupLayout layout =new javax.swing.Group Layout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.A lignment.LEADING)
  • 44. .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_ SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_ VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(10,10,10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayou t.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFE RRED_SIZE,634, javax.swing.GroupLayout.PREFERRED_SIZE )) .addGap(552,552,552)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.A lignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRE D_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swi ng.GroupLayout.PREFERRED_SIZE) .addGap(23,23,23) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFA ULT_SIZE,159,Short.MAX_VALUE) .addContainerGap()) );
  • 45. pack(); }// </editor-fold>//GEN-END:initComponents privatevoid jMenuItem1ActionPerformed(java.awt.event.Action Event evt){//GEN-FIRST:event_jMenuItem1ActionPerformed // TODO add your handling code here: System.exit(0); }//GEN-LAST:event_jMenuItem1ActionPerformed privatevoid jRadioButtonBookTitleActionPerformed(java.awt.ev ent.ActionEvent evt){//GEN- FIRST:event_jRadioButtonBookTitleActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioButtonBookTitleActionPerformed privatevoid jRadioButtonAuthorIndexActionPerformed(java.awt .event.ActionEvent evt){//GEN- FIRST:event_jRadioButtonAuthorIndexActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioButtonAuthorIndexActionPerformed privatevoid jButtonSearchActionPerformed(java.awt.event.Acti onEvent evt){//GEN- FIRST:event_jButtonSearchActionPerformed // TODO add your handling code here String strAuthorame=""; if(jRadioButtonAuthorIndex.isSelected()){ // Search by Author Index int index; index =Integer.parseInt(jTextFieldSearch.getText()); if(lib.searchOnAuthorIndex(index)){ // Update Author's information Author author = lib.getAuthorOnIndex(index); jTextArea1.setText(author.toString());
  • 46. } else{// author not found - setup empty fields strAuthorame ="*** NOT FOUND ***"; jTextArea1.setText(strAuthorame); } /* After searching on Author Index we also setup currentBook I ndex */ if(lib.getCurrentBookIndex()!=-1){ Book book; book = lib.getBookOnIndex(lib.getCurrentBookIndex ()); jTextArea1.setText(book.toString()); } else{// no more books not found with this author strAuthorame=""; jTextArea1.setText("*** NOT FOUND ***"); } } /* Search by Book Index */ elseif(jRadioButtonBookIndex.isSelected()){ // Search by Author Index int index; index =Integer.parseInt(jTextFieldSearch.getText()); if(lib.searchOnBookIndex(index)){ // Update Book information Book book = lib.getBookOnIndex(index); String bk = book.toString()+"n"; Author author = lib.getAuthorOnIndex(lib.getCurrentAuthorInd ex()); bk += author.toString(); jTextArea1.setText(bk); } else{// Book not found
  • 47. String strTitle =("*** NOT FOUND ***"); jTextArea1.setText(strTitle); } } /* * Search by BOOK TITLE */ elseif(jRadioButtonBookTitle.isSelected()){ String title = jTextFieldSearch.getText(); /* If book found */ if(lib.searchOnBookTitle(title)){ int index = lib.getCurrentBookIndex(); // Update Book information Book book = lib.getBookOnIndex(index); String strTitle =(book.getTitle().toString())+"n"; strTitle +=(book.getGendre().toString())+"n"; Author author = lib.getAuthorOnIndex(lib.getCurrentAuthorInd ex()); strTitle += author.toString()+"n"; Address address = author.getAddress(); strTitle += address.toString(); jTextArea1.setText(strTitle); }