JSP :: How To Display Amount In Indian Format

Apr 30, 2014

i want to display a amount in indian currency format,

i.e=10000000=this iwant show is=1,00,00,000 rather than 10,000,000

View Replies


ADVERTISEMENT

Basic GUI Calculator - Display Amount Of Commission And Total Annual Salary In Dollar Format

Apr 28, 2014

So, I am supposed to write a program that calculates the total annual compensation for a salesman using user input for the salary, sales, and commission rate (list of 3 predefined commission rates. have to display in dollar format the amount of commission and total annual salary.

CommCalc class

public class CommCalc
{
//attributes of class, stored data
private double sales;
private double salary;
private double rate;
//and a total field? beware stale data.
//store sales argument from sales field
public void setSales(double sal)

[Code] ....

I know that i have to fix some of the semantics . I have this code that I made earlier, is there an easy way to make it into a GUI interface? Or will I have to go throughthe code lines to add the JOptionPane? And I am a little confused on how to make a list (array) for the commission rate.

View Replies View Related

Transferring Amount To Other Account - Number Format Exception

Apr 7, 2014

I'm doing this project in JSP.net, with html. and in one of the web pages, what I'm doing is that, a person is transferring an amount to someone else, and if the transfer amount is more than the account balance, then he cannot transfer. else, save details in a table.

Here's the code I've used

<%
String t1=request.getParameter("text1");
String t2=request.getParameter("text2");
java.util.Date date1 = new java.util.Date();
SimpleDateFormat ft = new SimpleDateFormat ("dd/MM/yyyy");
int tamt = Integer.parseInt(t2);
int bamt = 0;

[Code] .....

But when i enter the fields and click the submit button in the form, to save it in the table, i get the error:

"org.apache.jasper.JasperException: java.lang.NumberFormatException: null"

(I've attached a screen shot of the error) : NumberFormatException.bmp (750.98K)

What does this mean? how do i find the line in the code that has the error?

View Replies View Related

How To Display Amount Paid By User And Show Balance

May 3, 2015

I've four classes object. I don't know how to display the amount paid by the user, and show the balance. The calculate button just show the total amount. Do I have to create another object class? And I've to show the bills too.

This is my 1st Frame

import javax.swing.*;
import java.awt.*;
//titlepanel class displays a title in a panel
public class TitlePanel extends JPanel {
public TitlePanel() {
JLabel title = new JLabel();

[Code] .....

View Replies View Related

Calculate Total Amount Paid And Display It - NULL Error

Dec 10, 2014

Exception in thread "main" java.lang.NullPointerException
at ShoeStore.calculateTotal(ShoeStore.java:103)
at ShoeStore.main(ShoeStore.java:88)

This is the error when program is ran. The program is supposed to calculate the total amount paid for all shoes and display it.

import java.util.Scanner;
 public class ShoeStore
{
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
String shoe_Name, nameStore, type;
int size, shoeAmount;
double sellingCost;
 
 [Code] .....

View Replies View Related

Program To Determine Max Amount Of Units Sold And Display It In Dialog Box

Feb 9, 2014

I am trying to write a program that basically determines the max amount of units sold and displays it in a dialog box. Also, the program will display the winning sales associate out of 10. I have wrote the program successfully so far and I can see the maximum number of units sold displayed in the dialog box, but I cannot seem to link the winning sales person.

Here is the code I have typed so far.

//Program to find maximum of three number

import javax.swing.JOptionPane;
import java.util.Scanner;
public class Sales
{
public static void main (String[] args)
{
//Declare variables
int num1, num2, num3, num4, num5, num6, num7, num8, num9, num10;
int large;
int winner;

[Code] ......

View Replies View Related

How To Format Methods To Display Number With 1-2 Decimal Places

May 8, 2014

I am working with a program I wrote for class. I got it to compile and do what I want, But I was wondering how I can format my methods to to display a decimal with 1-2 decimal places. Would I create a method in my NumberAnalysis class to do it for me? Or would I declare an instance of the DecimalFormat class in my main method?

import java.util.Scanner; //Needed for Scanner Class
import java.io.*; //Need for File and IOException
import java.text.DecimalFormat;
public class Ex8_11 { 
public static void main(String[] args) throws IOException{
{
DecimalFormat decformatter = new DecimalFormat("#0.00");
 
[Code] .....

This is my output:

Lowest Number: 1.09
Highest Number: 82.76
Total Number: 367.89000000000004
Total Average Number: 30.657500000000002

Think I just solved the answer to my own question, I did it by declaring double variables in my main method and called the methods and instantiated the variables into the methods... Is there a better way to do this?

package lesson4.skowronek;
 import java.util.Scanner; //Needed for Scanner Class
import java.io.*; //Need for File and IOException
import java.text.DecimalFormat;
public class Ex8_11 {
public static void main(String[] args) throws IOException{
 
[Code] ....

View Replies View Related

Enter In Sales Amount And Then Get It To Display Asterisk Per 100 In Sales

Apr 3, 2014

{
public static void main (String []args)
{
Scanner numberin = new Scanner (System.in);
double store [];

[Code]....

How would I get my program to display a * for every 100 dollars in sales that the user enters in so: for example the user enters in store 1: $ 400 in sales for the store I want it to display store 1:****

The first part of my code allows the user to enter in whatever values the stores have in sales. The Second half of the code starts at line 19 is my best guess on what I need to do I just am not sure how to get it to display what I need it to.

View Replies View Related

JSP :: Display Product Details From Database In A Gridview Format For Online Shopping System

Apr 12, 2015

I want to display product details such as product image, name, price in a one cell of a table tag on jsp page. There should be multiple rows and 3 cells per row in the required output.i have written the following code:

<form action="displayServlet" method="get">

<table >
<tr>
<%
statement4 = connection3.createStatement();
rs4 = statement4.executeQuery("SELECT * FROM product");

[code]....

This code displays all cells in only one row. I used colspan but its not working...I have attached the snapshot of above code output and required output

View Replies View Related

How To Return Value (amount) In 10 Years

Mar 14, 2014

Here's the small project... but how can I return the value (amount) in 10 years ? The way I did, the program just doesnt return anything...

import java.util.Scanner;
public class FutureValue
{
public static void main (String []args) {
double amount = 0;
double apr = 0;
System.out.println("How much money would you like to invest?");

[Code] ....

View Replies View Related

Show Amount Of Number According To Its Interval

Jul 4, 2014

I am trying to make a program that get input value 1-200 from user. However I would like to make the program to show warning if the input number is not within the range of 1-200. In the end I would like to show the amount of number according to its interval (i.e less 50, 51-100 and so on) ....

import java.util.Scanner;
class test {
public static void main (String[] args) {
int number[]= new int[5];
int number2[]= new int[5];
int a=0,b=0,c=0,d=0,i=0;

[Code] .....

View Replies View Related

Making A Loop Go A Certain Amount Of Times?

Jun 14, 2014

I am having is not being able to print out the diamond the amount of times the user enters (for example, when it asks how many diamonds, I enter a 2 and only one diamond comes out.)

import java.util.Scanner;
public class Pattern5
{
public static void main(String[] args)
{
// For this pattern program, ask the user how many diamonds
// she would like to print to the screen. The following pattern is one diamond.

[code]...

View Replies View Related

Calculate Quantity / Price And Total Amount

Apr 10, 2015

How to calculate the qty and price and total of the amount in total column.

View Replies View Related

How To Get A Program To Repeat X Amount Of Times Automatically

Oct 27, 2014

Ii am trying run a do while loop on java a specific amount of times for example if i were to type in "Enter number of years" and enter 4. i need the loop to execute 4 times or if i said 6 times then i would be 6. the program i have repeats it and takes it back to reentering "Enter number of years" i need it to execute by its self x amount of times. here is what i have so far

System.out.println("Enter the number of years: ");
years = keyboard.nextInt();
rainfall = generator.nextInt(10) + 1;
System.out.println("Year " + "rainfall amounts were");;
for (int months = 1; months <= 12; months++)

[Code]...

View Replies View Related

JSF :: When Submit Html Form / Value Of Amount Does Not Appear In Second Page

Mar 24, 2014

i have this code
////////////////////////////////////////////
<form name="myform" action="http://localhost:8080/EASYPAY.COM/faces/newxhtml.xhtml"method="post">
amount
<input type="text" name="amount"value="">
<input type="submit" >
</form>

[code]...

when i submit the html form the value of amount does not appear in the second jsf page new.xhtml what might be the problem

View Replies View Related

Perform Action Only If Certain Amount Of Time Has Passed

Sep 18, 2014

public static void main(String[] args) {
boolean t=false;
long cuTime = System.currentTimeMillis()
while(t==false) {
System.out.println(cuTime);
long g=cuTime+2000;

[Code] ....

I tried this and it includes a while loop as the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop

View Replies View Related

How To Perform Action Only If Certain Amount Of Time Passed

Sep 18, 2014

public static void main(String[] args) {
boolean t=false; 
long cuTime = System.currentTimeMillis();
while(t==false) {
System.out.println(cuTime);
long g=cuTime+2000;

[Code] ....

I tried this and it includes a while loop. therefor the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop...

View Replies View Related

Multiply Two Numbers - Add X Number Y Amount Of Times

Jun 9, 2014

I am trying to make a program to multiplies two numbers without using the "*" operator. My idea was to add x number y amount of times, which is the same as multiplication. I did this with a for loop, but zero is always returned as the answer. How can I fix this?

public class secondMult {
public static void main(String[] args){
System.out.println(multWithSum(4,5));
}
public static int multWithSum(int x, int y){
int sum = 0;
for(int i = 0; i==y;i++){
sum = sum + x;
}
return sum;
}
}

View Replies View Related

How To Perform Action Only If Certain Amount Of Time Has Passed

Sep 18, 2014

public static void main(String[] args)
{
boolean t=false;
long cuTime = System.currentTimeMillis();
while(t==false)
{
System.out.println(cuTime);

[code].....

I tried this and it includes a while loop as the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop

View Replies View Related

Show Up Amount For Multiple Photo Books

Oct 9, 2014

import java.util.Scanner;
public class LM6Assignment
{
public static void main(String[] args)
{
Scanner inputDevice = new Scanner(System.in);
int numBooks = 0;
double onePhotoBook = 10.99;//each book cost 10.99
double costof1Book;
//mehtod calls
costof1Book = computeBill(onePhotoBook);

[Code] ....

How to code it so I can put in how many books they need and for it to show up with the amount for multiple photo books..

View Replies View Related

Get Character Count And Amount Of Vowels In String Array?

Jan 29, 2015

I have to write some code to take names from the user and then order them in alphabetical order and then print them out which i have managed to do. However, i can't get it to count the characters in the names that the user enters or count the amount of vowels in the names.

This is the code ive written:

import javax.swing.JOptionPane;
import java.util.Arrays;
String[] names = new String[9];
int i;
names[0] = JOptionPane.showInputDialog("Please enter a name");
names[1] = JOptionPane.showInputDialog("Please enter a name");

[code]....

View Replies View Related

Array With Occurrences - Gather Sales Amount For The Week

May 3, 2014

Here is what I'm trying to do using arrays.

gather sales amount for the week
display the total of sales
display the average of sale
display the highest sale amount
display the lowest sale amount

using occurrences determine how many times the amount occurred for the week

make a sales main
make a sales data

This is what i have so far but I'm confused on how to start the occurrence and where it would be placed in order to get the information from the array

public class SalesData {
private double[] sales; // The sales data
/**
The constructor copies the elements in an array to the sales array.
@param s The array to copy.
*/
public SalesData(double[] s) {

[Code] .....

View Replies View Related

Specify How To Delete Only Certain Amount Of Objects On Screen In Graphics Window

Oct 10, 2014

I have a question about how to delete only a certain amount of objects on screen in a graphics window. I have a method that will enable me to get rid of every object of the same type off screen, for example this method:

Java Code:

public void deleteTrees() {
//clears all tree trunks and leaves
for (Iterator<GRect> it = historyT.iterator(); it.hasNext();) {
GObject gobj = it.next();
this.remove(gobj);

[Code] ....

That Will delete all trees.

Now In my main method I populate the screen with trees by doing this

Java Code:

for (int xpos = 10; xpos < getWidth() - 40; xpos += getWidth() / 8) {
drawTree(150, 200, xpos, getHeight() / 2.0 - 50);
historyT.add(trunk);
historyL.add(leave);

} mh_sh_highlight_all('java');

My question is how to specify only deleting x amount of trees instead of the whole thing. I pretty sure I need to use something like history.remove(trunk) and to iterate through the amount of trees specified, but not sure how to implement that.

View Replies View Related

Amount Of Money - Compile Error / Unreachable Statement

Feb 14, 2014

This method accepts 1 integer, amount (the amount of money). Output the minimum number of in quarters, dimes, nickels and pennies used to make up the amount. For example, an amount of 32 would require 1 quarter, 1 nickel and 2 pennies.

This is the question^

My codes are:

public static int change (int amount) {
int quarters = amount / 25 ;
int firstresult = amount % 25 ;
return quarters ;
int nickel = firstresult / 5 ;

[Code] .....

The codes were working when i used System.out.println instead of return, but our teacher required us to use return (functions).

I get the compile error: Unreachable statement.

View Replies View Related

Program That Prompts The User To Enter Loan Amount And Years

Oct 21, 2014

so I had to make a program that prompts the user to enter a loan amount and the years for the loan and I have the conversions and everything my only issue is that when the chart pops up it just looks like a bunch of numbers and its missing the column headers

for example

Interest Rate Monthly Payment Total Payment

import java.util.Scanner; 
public class InterestRate { 
public static void main(String[] args) { 
double monthlypayment = 0; 
double totalpayment = 0; 
Scanner input = new Scanner(System.in);
System.out.println("Enter Loan Amount");

[Code]...

View Replies View Related

Calculations / Conversions - Calculate Correct Amount Of Change Due To A Customer

Sep 12, 2014

Here are the instructions to my assignment:

A shopkeeper in Diagon Alley needs you to write a program that will calculate the correct amount of change due to a customer. (In Diagon Alley they use three coins with different values, given below).

1. Prompt the user to input the amount of sale in Galleons, Sickles, and Knuts.

2. Prompt the user to input the amount of money given by the customer in Galleons, Sickles, and Knuts.

3. Create constants that represent:

a. 1 Galleon = 17 Sickles

b. 1 Sickle = 29 Knuts

4. Perform the necessary calculations and conversions to compute the correct change in the least number of coins.

5. create a formatted receipt recording the entire transaction.

Here are what is steps 1 and 2 and 5 but problem with are 3 and 4. I need to create the constants and use proper conversions to give the right amount of change back.

Java Code:

import java.util.Scanner;
public class OperatorFormatting {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Welcome to Flourish and Blotts");

[Code] ....

Basically, on steps 3 and 4 which are creating the constants and using the to make the proper conversions to give the customer the proper amount of change Due.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved