Click here to Skip to main content
13,251,998 members (59,475 online)
   

Java

 
QuestionRe: File Path Problem Pin
Richard MacCutchan10-Apr-13 1:25
mvpRichard MacCutchan10-Apr-13 1:25 
AnswerRe: File Path Problem Pin
Indian Coder198910-Apr-13 1:45
memberIndian Coder198910-Apr-13 1:45 
QuestionRead JNDI from c# Pin
Member 11184949-Apr-13 2:59
memberMember 11184949-Apr-13 2:59 
AnswerRe: Read JNDI from c# Pin
Richard MacCutchan9-Apr-13 6:16
mvpRichard MacCutchan9-Apr-13 6:16 
GeneralRe: Read JNDI from c# Pin
Member 11184949-Apr-13 9:28
memberMember 11184949-Apr-13 9:28 
GeneralRe: Read JNDI from c# Pin
jschell9-Apr-13 10:19
memberjschell9-Apr-13 10:19 
GeneralRe: Read JNDI from c# Pin
Richard MacCutchan9-Apr-13 10:40
mvpRichard MacCutchan9-Apr-13 10:40 
GeneralRe: Read JNDI from c# Pin
Member 111849410-Apr-13 23:55
memberMember 111849410-Apr-13 23:55 
GeneralRe: Read JNDI from c# Pin
Richard MacCutchan11-Apr-13 0:14
mvpRichard MacCutchan11-Apr-13 0:14 
GeneralRe: Read JNDI from c# Pin
Member 111849411-Apr-13 0:21
memberMember 111849411-Apr-13 0:21 
GeneralRe: Read JNDI from c# Pin
Richard MacCutchan11-Apr-13 1:38
mvpRichard MacCutchan11-Apr-13 1:38 
GeneralRe: Read JNDI from c# Pin
Member 111849411-Apr-13 1:42
memberMember 111849411-Apr-13 1:42 
SuggestionRe: Read JNDI from c# Pin
Prasad Khandekar2-May-13 20:49
professionalPrasad Khandekar2-May-13 20:49 
QuestionJava Program to accept input from user and then display output . Pin
Aman kumar routh4-Apr-13 4:35
memberAman kumar routh4-Apr-13 4:35 
I need to make a java program which accepts input from user in form of item Code, quantity and rate and then display the total amount as well as discount .
the condition for getting discount is like
if the amount is greater than 5000 than discount is 10% of amount. i want to display amount and discount amount calculated ...my code works nice till it calculates amount but when moving to next step for calculating discount it shows error.

plzzz hep me out ...is there any error in my code??
am new to Core java
thank you...


import java.io.*;
class AMOUNT
{
public static void main(String args[])
{
Double discount= 0.0 ;
InputStreamReader istream = new InputStreamReader(System.in) ;
BufferedReader br= new BufferedReader(istream);
System.out.println("Welcome to My Java Program");
try
{
System.out.println("enter the item code:");
String code=br.readLine();

System.out.println("enter your quantity:");
String quantity=br.readLine();

System.out.println("enter the rate:");
String rate=br.readLine();

int qty=Integer.parseInt(quantity);
int Rate=Integer.parseInt(rate);



int amnt= qty*Rate;
System.out.println("your amountis"+amnt);

if(amnt > 5000)
{
discount=Double.parseDouble(br.readLine());
discount= 0.1 * amnt;
System.out.println("your discount is"+discount);
}
else
{

System.out.println("you dont have discount");
}
}
catch (Exception e)
{
System.out.println("error");

}
}
}
Aman Kumar Routh

AnswerRe: Java Program to accept input from user and then display output . Pin
emadrefai4-Apr-13 7:20
memberemadrefai4-Apr-13 7:20 
GeneralRe: Java Program to accept input from user and then display output . Pin
Aman kumar routh4-Apr-13 7:29
memberAman kumar routh4-Apr-13 7:29 
AnswerRe: Java Program to accept input from user and then display output . Pin
Richard MacCutchan4-Apr-13 7:29
mvpRichard MacCutchan4-Apr-13 7:29 
QuestionJAVA Pin
Member 995424830-Mar-13 9:01
memberMember 995424830-Mar-13 9:01 
AnswerRe: JAVA Pin
Richard MacCutchan30-Mar-13 14:19
mvpRichard MacCutchan30-Mar-13 14:19 
AnswerRe: JAVA Pin
Shubhashish_Mandal1-Apr-13 3:43
memberShubhashish_Mandal1-Apr-13 3:43 
AnswerRe: JAVA Pin
Cesar Bretana Glez3-Apr-13 10:43
memberCesar Bretana Glez3-Apr-13 10:43 
AnswerRe: JAVA Pin
Aman kumar routh4-Apr-13 4:46
memberAman kumar routh4-Apr-13 4:46 
AnswerRe: JAVA Pin
Richard MacCutchan9-Apr-13 5:58
mvpRichard MacCutchan9-Apr-13 5:58 
Questionhow to add list item dynamically in java I/O Pin
Member 824369330-Mar-13 4:30
memberMember 824369330-Mar-13 4:30 
AnswerRe: how to add list item dynamically in java I/O Pin
Richard MacCutchan30-Mar-13 7:18
mvpRichard MacCutchan30-Mar-13 7:18 
GeneralRe: how to add list item dynamically in java I/O Pin
Member 824369330-Mar-13 23:54
memberMember 824369330-Mar-13 23:54 
GeneralRe: how to add list item dynamically in java I/O Pin
Richard MacCutchan31-Mar-13 6:50
mvpRichard MacCutchan31-Mar-13 6:50 
GeneralRe: how to add list item dynamically in java I/O Pin
Member 824369331-Mar-13 6:58
memberMember 824369331-Mar-13 6:58 
GeneralRe: how to add list item dynamically in java I/O Pin
Richard MacCutchan31-Mar-13 7:01
mvpRichard MacCutchan31-Mar-13 7:01 
GeneralRe: how to add list item dynamically in java I/O Pin
Member 824369331-Mar-13 7:03
memberMember 824369331-Mar-13 7:03 
GeneralRe: how to add list item dynamically in java I/O Pin
Richard MacCutchan31-Mar-13 7:06
mvpRichard MacCutchan31-Mar-13 7:06 
QuestionJava: Parse OData Atom Feed Pin
WarriorOfFlames28-Mar-13 7:03
memberWarriorOfFlames28-Mar-13 7:03 
AnswerRe: Java: Parse OData Atom Feed Pin
Shubhashish_Mandal1-Apr-13 3:48
memberShubhashish_Mandal1-Apr-13 3:48 
QuestionAndroid: OData Restlet Client with NTLM Pin
WarriorOfFlames27-Mar-13 23:17
memberWarriorOfFlames27-Mar-13 23:17 
GeneralRe: Android: OData Restlet Client with NTLM Pin
Prasad Khandekar11-Apr-13 4:59
memberPrasad Khandekar11-Apr-13 4:59 
QuestionHow Install Bundle on apache felix ? Pin
f.zeinali26-Mar-13 23:44
memberf.zeinali26-Mar-13 23:44 
AnswerRe: How Install Bundle on apache felix ? Pin
Prasad Khandekar26-Apr-13 1:26
memberPrasad Khandekar26-Apr-13 1:26 
QuestionJava Pin
Rhod-Ann25-Mar-13 22:46
memberRhod-Ann25-Mar-13 22:46 
AnswerRe: Java Pin
Marco Bertschi25-Mar-13 23:38
memberMarco Bertschi25-Mar-13 23:38 
AnswerRe: Java Pin
apvkt2-Apr-13 22:14
groupapvkt2-Apr-13 22:14 
QuestionOpenOffice and GUI (Integration) Pin
Thomas Grapel25-Mar-13 2:25
memberThomas Grapel25-Mar-13 2:25 
AnswerRe: OpenOffice and GUI (Integration) Pin
Richard MacCutchan25-Mar-13 2:37
mvpRichard MacCutchan25-Mar-13 2:37 
GeneralRe: OpenOffice and GUI (Integration) Pin
Thomas Grapel25-Mar-13 3:05
memberThomas Grapel25-Mar-13 3:05 
GeneralRe: OpenOffice and GUI (Integration) Pin
Richard MacCutchan25-Mar-13 3:21
mvpRichard MacCutchan25-Mar-13 3:21 
GeneralRe: OpenOffice and GUI (Integration) Pin
Thomas Grapel25-Mar-13 3:27
memberThomas Grapel25-Mar-13 3:27 
GeneralRe: OpenOffice and GUI (Integration) Pin
Richard MacCutchan25-Mar-13 3:44
mvpRichard MacCutchan25-Mar-13 3:44 
GeneralRe: OpenOffice and GUI (Integration) Pin
Thomas Grapel25-Mar-13 3:50
memberThomas Grapel25-Mar-13 3:50 
Questionhow to use tmx map in my code Pin
java_beginer24-Mar-13 12:22
memberjava_beginer24-Mar-13 12:22 
AnswerRe: how to use tmx map in my code Pin
Richard MacCutchan25-Mar-13 0:43
mvpRichard MacCutchan25-Mar-13 0:43 
Questioncan anyone help me with my final project Pin
java_beginer24-Mar-13 9:18
memberjava_beginer24-Mar-13 9:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 15 Nov 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid