Java.. pls.
Hi, sir. it compiler but when search or purchase it didt go true.
Sir, can u help me sir. Please Sir..
Import java.io.*;
public class nathan{
String title[]={"Biography","Computers","Science","Sports","Religion"};
String author[]={"Francis","Roland","Bobby","Keith","Robbert"};
String publisher[]={"USA","USA","Germany","France","Spain"};
Double price[]={19.00,25.50,20.80,19.60,13.80};
double quantity[]={10,40,32,36,41};
boolean done = false;
InputStreamReader input = new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(input);
public void nathan () throws IOException{
do{
System.out.println();
System.out.println("|!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!|");
System.out.println("| Welcome to |");
System.out.println("| Nathan Book Shop |");
System.out.println(" ------------------------------------------- ");
System.out.println("| 1. All Books |");
System.out.println("| 2. Books By Title |");
System.out.println("| 3. Purchase Books |");
System.out.println("| 4. Exit |");
System.out.println("|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|");
System.out.println("");
System.out.print("Enter your choice=>");
String op = br.readLine();
int read = Integer.parseInt(op);
switch(read){
case 1:
System.out.println("");
allBooks();
break;
case 2:
System.out.println("");
searchTitle();
break;
case 3:
System.out.println("");
purchase();
break;
case 4:
System.out.println("{{{{THANK YOU}}}}");
done=true;
break;
default:
System.out.print("Wrong Info. Please Enter Again");
}
}
while (!done);
}
public void searchTitle() throws IOException{
System.out.print("Enter Title Name::");
String name = br.readLine();
for(int i=0;i<5;i++){
if(name.equals(title[i])){
System.out.println("Author : "+author[i]);
System.out.println("Publisher : "+publisher[i]);
System.out.println("Price : "+price[i]);
System.out.println("Quantity : "+quantity[i]);
}
}
}
public void purchase() throws IOException{
System.out.print("Enter book name:");
String name = br.readLine();
for(int i=0;i<5;i++){
if(name.equals(title[i])){
System.out.println("Author : "+author[i]);
System.out.println("Publisher : "+publisher[i]);
System.out.println("Price : "+price[i]);
System.out.println("Quantity : "+quantity[i]);
System.out.println("Total Price : "+quantity[i]*price[i]);
}
}
}
public void allBooks()throws IOException{
System.out.println("Title\t\tAuthor\t\tPublisher\tQuantity\tPrice");
System.out.println("=============================================");
for(int a=0; a<author.length;a++){
System.out.println(""+title[a]+"\t"+author[a]+"\t\t|"+publisher[a]+"\t\t|"+quantity[a]+"\t\t|"+price[a]);
System.out.println("");
}
System.out.println("");
}
public static void main(String args[])throws IOException{
nathan bk = new nathan();
bk.nathan();
}
}
View Answers
May 3, 2010 at 10:52 AM
Hi Friend,
Please clarify the format in which you want to display the data on selecting search and purchase option.
Thanks
Related Tutorials/Questions & Answers:
Java.. pls. - Java BeginnersJava..
pls. Hi, sir. it compiler but when search or purchase it didt go true.
Sir, can u help me sir. Please Sir..
Import java.io.*;
public class nathan{
String title[]={"Biography","Computers","Science","Sports
Java Beans pls!! - Java BeginnersJava Beans
pls!! hello,, can someone give me a simple program of
java beans, and Jsp.
pls.. im begging you guys.. i really need it!! plss.. thanks...://www.roseindia.net/jsp/
java-bean-example-jsp.shtml
http://www.roseindia.net/jsp
Advertisements
pls send reply - Java Beginnerspls send reply i get the error
Error Occurred:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
how to remove
pls. help me - Java Beginnerspls. help me please help me i do need now if its okay...
Consider the method headings:
void funcOne(int[] alpha, int size)
int funcSum(int...[] list = new int[50];
int[] Alist = new int[60];
int num;
Write
Java pls send reply - Java Beginnerspls send reply i get the error
Error Occurred:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
how to remove
Hi Friend,
Check your connection string, username
hi.. i hv few error. pls. - Java Beginnershi.. i hv few error.
pls. hi sir, i have few error. can u
pls help me.
pls.
im very new in
java. ths my Uni assgmnt.
please help me...
import java.io.*;
public class nathan
{
String title[]={"Biography
pls help me it urgentpls help me it urgent hey,
pls help me i want to know that can we call
java/.bat file from plsql/proceudre /trigger
pls help me it urgentpls help me it urgent hey,
pls help me i want to know that can we call
java/.bat file from plsql/proceudre /trigger
pls help me it urgentpls help me it urgent hey,
pls help me i want to know that can we call
java/.bat file from plsql/proceudre /trigger
ModuleNotFoundError: No module named 'pls'ModuleNotFoundError: No module named '
pls' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
pls'
How to remove the ModuleNotFoundError: No module named '
pls' error
ModuleNotFoundError: No module named 'pls'ModuleNotFoundError: No module named '
pls' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
pls'
How to remove the ModuleNotFoundError: No module named '
pls' error
ModuleNotFoundError: No module named 'pls'ModuleNotFoundError: No module named '
pls' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
pls'
How to remove the ModuleNotFoundError: No module named '
pls' error
i dont no how to solve it pls i dont no how to solve it
pls Calculate and display the sum of all prime number from 1 to 100 covert in
java system codes
pls send code pls send code
pls send code for set database value into text box based on selected value
in struts and jsp
use any database and get its code for getting values from google
Pls send code Pls send code I am Mohini Charankar
suppose Name="Mohini" Edit Button Click on that I change my Name with "Mohini/" Save it and page refresh After... an error
pls send code
pls help me with this questionpls help me with this question how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program
Pls help me with stringsPls help me with strings To reverse a every other word in a string.
Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me with stringsPls help me with strings To reverse a every other word in a string.
Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me...........Pls help me........... how to use the text file as input to insert the values injdbc?
Please visit the following link:
Insert text file data into database
pls answer these questionpls answer these question Write a program that prompts the user to input the length and width of a rectangle.
Then calculate and prints the rectangleâ??s area and perimeter.
import java.io.*;
class rectangle
ModuleNotFoundError: No module named 'noun_pls'ModuleNotFoundError: No module named 'noun_
pls' Hi,
My Python... 'noun_
pls'
How to remove the ModuleNotFoundError: No module named 'noun_
pls... to install padas library.
You can install noun_
pls python with following
sourse code plssourse code pls customer registration code in
java?
Hello Friend,
Please visit the following links:
http://www.roseindia.net/jsp/javascriptpagerefresh.shtml
http://www.roseindia.net/jsp/user-registration-form
on-line examination project?(urgent pls)on-line examination project?(urgent
pls) Hello friends,
i am doing an on-line examination project. In A page i will get n(user requirement) questions from data base(question and five radio buttons) if the user had
pls review my code - Strutspls review my code When i click on the submit page i am getting a blank page
Pls help me.
thanks in advance.
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request
pls review my code - Strutspls review my code Hello friends,
This is the code in struts. when i click on the submit button.
It is showing the blank page.
Pls respond soon its urgent.
Thanks in advance.
public class LOGINAction extends Action
Pls review my code - StrutsPls review my code Hello friends,
this is my code in struts action class
this page contains checkboxes and radiobuttons also.
when i enter the submit it shows me blank page.
can anybody solve my problem its urgent.
help me
pls provide steps to connect mysql in flex - XMLpls provide steps to connect mysql in flex hi ,
PLS SUGGEST ME I HAVE NO IDEA WHERE TO PLACE THE FUNCTIONS.PHP CODE.I HAVE WAMP SERVER .CAN I PASTE THE FUNCTIONS.PHP THERE .OR ANY OTHERWAY .HOW FLEX CONNECT WITH WAMP .IF SO
PLS pls i need help with my assignmentpls i need help with my assignment how to write a code that ask the user for the height of the triangle and prints the triangle using * eg if height is 3 it prints
*
and also using import java.util.Scanner
pls help its eating my time:(pls help its eating my time:( hi am new to struts2.0 in my application i have declared a list in static how to get the static list values in my result.jsp??? if i remove the static in the list the result is getting displayed.why
pls help me sir its urgentpls help me sir its urgent thanks for reply,
but i am getting this error
pls help me its urgent
type Exception report
message
description The server encountered an internal error () that prevented it from
MYSQL EXCEPTION -DATA TRUNCATION..pls resolve itMYSQL EXCEPTION -DATA TRUNCATION..
pls resolve it while running my program as follows
Register1.html
<!DOCTYPE html>
<html lang="en... status
successsfully connected unable to connect database
Pls say whts
pls give me answer ae soon as possible - Ajaxpls give me answer ae soon as possible i m writing code of ajax technology ...but it is not working
pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
pls provide common path to set image in flex - XMLpls provide common path to set image in flex hi,
pls provide common setpath to image in flex.when i give ful path like these
C:\eclipse\workspace... like these ...\pictures\useful_links_logo.gif .its not working.
pls provide