Java Project

Java Project

View Answers

October 1, 2009 at 3:34 PM

Hi Friend,

Try the following code:

import java.util.*;

public class Computer{
static String name;
static int size;
static int speed;
static String make;
static double price;
static int quantity;
public Computer(String n,int s,int sp,String m,double p,int q){
name=n;
size=s;
speed=sp;
make=m;
price=p;
quantity=q;
}
public String getName(){
return name;
}
public int getSize(){
return size;
}
public int getSpeed(){
return speed;
}
public String getMake(){
return make;
}
public double getPrice(){
return price;
}
public int getQuantity(){
return quantity;
}
public void valid(){
if((price==0)||(price<0)){
System.out.println("Please enter price");
System.exit(0);
}
else if((quantity==0)||(quantity<0)){
System.out.println("Please enter quantity ");
System.exit(0);
}
else{
displayData();
}
}
public void displayData(){
List<Computer> list = new ArrayList<Computer>();
list.add(new Computer(name,size,speed,make,price,quantity));
for (Computer s : list){
System.out.println("Computer Name: "+s.getName()+ "\nRAM Size :"+s.getSize()+"\nProcessor Make: "+s.getMake()+"\nProcessor Speed: "+s.getSpeed()+"\nQuantity: "+s.getQuantity()+"\nTotal Price of Computers: "+s.getPrice());
}
}
public static void main(String[]args){
System.out.println("Enter details");
Scanner input=new Scanner(System.in);
name=input.next();
size=input.nextInt();
speed=input.nextInt();
make=input.next();
price=input.nextDouble();
quantity=input.nextInt();
Computer c=new Computer(name,size,speed,make,price,quantity);
c.valid();
}
}

Thanks

April 23, 2010 at 4:40 PM

Hey are you doing MBA IT from symbisysy PUNE
coz i have the same question in my java project.

But this program is shoing error on the 50th line that [ or ( is expected.
but i m not able to solve it. coz i m not aware of java too much hepl plz









Related Tutorials/Questions & Answers:
Java Project
Java Project  Java project using with collection and generic with observer design pattern
java project
java project  how many tables are required in backend for online examination system project in jsp If backend is SQL
Advertisements
java project
java project  i would like to get an idea of how to do a project by doing a project(hospital management) in java.so could you please provide me with tips,UML,source code,or links of already completed project with documentation
JAVA project
JAVA project  How to extract tags and their corresponding properties of a "cascading style sheet" file using JAVA
java project
java project  Connecting to MySQL database and retrieving and displaying data in JSP page by using netbeans
Java Project
Java Project  how to write a program for competitive exams(for student practice purpose)? for example: first student have to login after login then he has to select the particular exam what he want to write i.e the exam may
java project - Java Beginners
java project  how can i download the source code for the project college admission system
Java Project - Java Beginners
Java Project  Hello Sir I want Mini Student Admission System project in java with Source Code and Back end Database is MS Access. plz Give That Sir its Very Very Urgent
Java Project - Java Beginners
Java Project  Dear Sir, Right now i am working in java image processing project. In that i have to split in one image like Texture, color..., Please visit the following links: http://www.roseindia.net/java/example
Java Project - Java Beginners
Java Project  Hey, thanks for everything your doing to make us better. Am trying to work on a project in java am in my first year doing software Engineering and the project is m end of year project. Am really believing
Java Project - Java Beginners
Java Project  I'm a III yr Engineering student. I've been ask 2 prepare a project on Java. Can u plz suggest me some topics ?   Hi friend... Java project topic with more information. 1. Asset Management 2. Shopping
java project - Java Beginners
java project  project for internet banking  Hi friend, I am sending you a link. This link will help you. Please visit for more information. http://www.roseindia.net/jsp/bank.shtml Thanks
project - Java Beginners
project in Java  Need example project in Java
JAVA PROJECT - Java Beginners
JAVA PROJECT  Dear Sir, I going to do project in java " IT in HR, recruitment, Leave management, Appriasal, Payroll" Kindly guide me about... etc. I am doing project first time. waiting for your reply, Prashant
java project - Java Beginners
java project  hi this amol i wish to do a project on banking software in java can u help   how can i help u .. and what the kind... adam certified java programmer certified websphere   ya sure!! what
java project - Java Beginners
java project  Can u pls suggest me any ideas for my B.E project? It's urgent... Front end---Java Back end----Oracle IDE---------Netbeans5.5 It should not be completely database oriented... I am not allowed to develop any
Java Project - Java Beginners
Java Project   Write a Java program to create simple Calculator for 4 basic Math operations, Addition, Subtraction, Multiplication and Division... the following link: http://www.roseindia.net/java/example/java/swing/calculator
Java Project - Java Beginners
Java Project  Dear Sir, I have to do Project in "IT in HR i.e. Recruitment, Leave Management, Appraisal & payroll. These are Four main modules... employee master. Now, can you tell in Java programming with Mysql How can
java project - Java Beginners
java project  HAVE START A J2ME PROJECT WITH NO CLEAR IDEA .. ANY ONE... project titled, as ?M-News Application? is basically a mobile news application Project. In our project we are going to develop a Mobile Application which
JAVA Project - Java Beginners
JAVA Project  Hi Friends, Can somebody please tell me a website from where I can download java live projects along with the source code
java project - Java Beginners
java project  Sir, how can i download the source for for the proect college admission system
Java Project - Java Beginners
question in my java project. But this program is shoing error on the 50th line...Java Project  Create a class Computer that stores information about...; public Computer(String n,int s,int sp,String m,double p,int q){ name=n; size=s
JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project
project detail - Java Beginners
project detail  Dear roseindia, i wnat to the idea for doing project in the java
project detail - Java Beginners
project detail  How to do project in java I am doing final MCA i want to do project I am willing to do project in java or j2ee. But I have no idea so I want some idea about project in java please give some sample project
Project - Java Beginners
Project  Give me a sample project idea done using code Java
Project - Java Beginners
Project  Give me a sample project idea done using code Java
java project - JavaMail
java project  i want to make a project in java on ethernet mailing system.....can you provide the source code of this?and give me more suggestions to make
java project question
java project question  how to calculate bill extracting quantity n price from one database table and inserting the result into another in java   Hi Friend, Visit Here Thanks
minor project in core java
minor project in core java  I am a student of BE IT branch 6sem ,i have to prepare a minor project in core java please sujest some topics other then management topics
java project topics
java project topics  Hello everyone, Can you please give me ideas on new projects in java(belonging to any part of java ), read the topics related to it and then i will make it. Please give me inventory ideas
Java project ideas
Java project ideas  Hi, Can anyone tell me the java project ideas? I want to develop the project to learn java programming concepts in depth. Thanks   Hi, You can develop following types of applications: a) Hotel
project in java - JDBC
friend, i am sending java project link, visit following link http...project in java  hi, i should do a project that enables a local cable operator to manage his customers. this should be done in java plz send me
Java Project - Development process
Java Project  Hello Sir I want Java Project for Time Table of Buses.that helps to search specific Bus Time and also add ,Update,Delete the Bus Routes. Back End MS Access Plz Give Me
Java project in Servlet
Java project in Servlet  Hi, I have one java (Servlet) project... have private network (LAN). So i want to run that project from any pc. Access to project should be from any syatem. Means can i access post 2 problems
JAVA Web project deployment
JAVA Web project deployment  Hi friends, I have created a website using servlet and JSP with SQL server on the backend. Now I have to deploy the project so that I can open the project and someone can work on it without installing
java project question
java project question  hi!!! I am doing a web related project in java.. And i am new to jsp. I am getting the following wargings. Pls help me.../displayer/sms line 79 Java Problem Class is a raw type. References to generic type
java project - JSP-Servlet
java project  i am going to do a mini-project on computerization... mini-project... where all the students can enter into the application... over to the ID card manufacturers.. so this is the idea of my mini-project
java project question
java project question  how to calculate bill extracting quantity n price from one database table and inserting the result into another in java   Hi Friend, Try the following code: import java.sql.*; import java.util.
Java Project Deployment
Java Project Deployment  Hi I have created a website using servlet and JSP. There are three type of users on the website namely administrator, student and teacher. Now I need to install this website on all the systems
java project - Development process
java project   Can you tell me how to design a windmill software
J2ME project - Java Beginners
project on MEDICAL CENTRAL SUPPLIES. Well i have a little bit knowledge about J2ME but i have to present this project with 5 to 7 DIFFERENT MIDLETS . If u have a demo project on MEDICAL CENTRAL SUPPLIES please give me
mini project - Java Beginners
mini project  can anybody plz send the mini project of "on line course portal for a campus
J2ME project - Java Beginners
project on MEDICAL CENTRAL SUPPLIES. Well i have a little bit knowledge about J2ME but i have to present this project with 5 to 7 DIFFERENT MIDLETS . If u have a demo project on MEDICAL CENTRAL SUPPLIES please give me
Help With My Java Project?
Help With My Java Project?  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two-dimension array where
Project Concerning - Java Beginners
Project Concerning  Dear Sir, Can you write me URL of any website from where I study the Servlet, JSP project.   Just googled it n im sure u will get many more results. Otherwise, RoseIndia is a better option
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen â?? where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter. Note: each
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen â?? where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter. Note: each
j2me project - Java Beginners
SALES DATA FROM THE SERVER. THIS MIDLET IS FOR THE PROJECT MEDICAL CENTRAL
Final Project - Java Beginners
in programming is paramount in being successful in the business industry. This project..., but it is suggested that you begin working on the final project assignment in Week 5, which should give you ample time to complete the project. You will find that all

Ads