The Artima Developer Community
Sponsored Link

Java Answers Forum
How To Continue With The Code for Sales Program(Part 2)

2 replies on 1 page. Most recent reply: Feb 24, 2004 2:55 AM by leonglkw

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
leonglkw

Posts: 43
Nickname: leonglkw
Registered: Feb, 2004

How To Continue With The Code for Sales Program(Part 2) Posted: Feb 24, 2004 2:40 AM
Reply to this message Reply
Advertisement

while(true)
{
System.out.print("Enter product code: ");
prdCode = BuffReader.readLine();
System.out.print("Enter quantity: ");
prdQuantity = BuffReader.readLine();
System.out.print("More items[Y/N]?:");
morePrd = BuffReader.readLine();
if(morePrd.equalsIgnoreCase("N"))
break;
else
continue;

}


import java.io.*;

class Product {
String category;
String favourite;
int qtyPrepared;
int qtySold;
int costPrice;
int sellingPrice;
int difference;
}

class Sales {
public static void main(String[] args) throws IOException{
Product c1 = new Product();
Product c2 = new Product();
Product c3 = new Product();
Product p1 = new Product();
Product p2 = new Product();
Product s1 = new Product();
Product s2 = new Product();

c1.category = "Computer";
c1.favourite = "[c1]DELL";
c1.qtyPrepared = 0;
c1.qtySold = 0;
c1.costPrice = 1000;
c1.sellingPrice = 1700;
c1.difference = 0;

c2.category = "Computer";
c2.favourite = "[c2]Compaq";
c2.qtyPrepared = 0;
c2.qtySold = 0;
c2.costPrice = 900;
c2.sellingPrice = 1200;
c2.difference = 0;

c3.category = "Computer";
c3.favourite = "[c3]HP";
c3.qtyPrepared = 0;
c3.qtySold = 0;
c3.costPrice = 1200;
c3.sellingPrice = 1500;
c3.difference = 0;

p1.category = "Printer";
p1.favourite = "[p1]Digitech";
p1.qtyPrepared = 0;
p1.qtySold = 0;
p1.costPrice = 150;
p1.sellingPrice = 200;
p1.difference = 0;

p2.category = "Printer";
p2.favourite = "[p2]HP";
p2.qtyPrepared = 0;
p2.qtySold = 0;
p2.costPrice = 180;
p2.sellingPrice = 300;
p2.difference = 0;

s1.category = "Scanner";
s1.favourite = "[s1]HP";
s1.qtyPrepared = 0;
s1.qtySold = 0;
s1.costPrice = 100;
s1.sellingPrice = 150;
s1.difference = 0;

s2.category = "Scanner";
s2.favourite = "[s2]Digitech";
s2.qtyPrepared = 0;
s2.qtySold = 0;
s2.costPrice = 80;
s2.sellingPrice = 120;
s2.difference = 0;

try
{
String prdCode ="";
String prdQuantity = "0";
String morePrd ="";


InputStreamReader inReader = new InputStreamReader(System.in);
BufferedReader BuffReader = new BufferedReader(inReader);
System.out.println("Items sold:-");
while(true)
{
System.out.print("Enter product code: ");
prdCode = BuffReader.readLine();
System.out.print("Enter quantity: ");
prdQuantity = BuffReader.readLine();
System.out.print("More items[Y/N]?:");
morePrd = BuffReader.readLine();
if(morePrd.equalsIgnoreCase("N"))
break;
else
continue;

}
}
catch(Exception e )
{
System.out.println("ERROR " + e);
}
}
}


Viswanatha Basavalingappa

Posts: 84
Nickname: viswagb
Registered: Nov, 2003

Re: How To Continue With The Code for Sales Program(Part 2) Posted: Feb 24, 2004 2:53 AM
Reply to this message Reply
what is the issues here? any querstion you need to ask?

leonglkw

Posts: 43
Nickname: leonglkw
Registered: Feb, 2004

Re: How To Continue With The Code for Sales Program(Part 2) Posted: Feb 24, 2004 2:55 AM
Reply to this message Reply
Hi Viswa,

I accidentally posted the above incomplete question.
Pls ignore it.
I'm preparing my question now.
Anyway, thanks for help in my previous quentions.

Flat View: This topic has 2 replies on 1 page
Topic: ImageIcon and Access Database Previous Topic   Next Topic Topic: How To Continue With The Code for Sales Program

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use