Show Balance In Simple ATM

Nov 25, 2014

This code models a simple ATM machine that can deposit, withdraw, and show the 10 latest transactions in an array of 10 index values.

My problem is that I can't get the balance right after 10 deposits, the balance only seems to sum the values in my array, not including the transactions made before those ten.

import java.util.Scanner;
public class cashier2 {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int amount = 0;

[Code] ....

View Replies


ADVERTISEMENT

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

How To Sort A List By Balance

Mar 26, 2014

Add accounts on a list, each account contain: name, accountCode, pinCode, balance.

How to show list sort by balance?

View Replies View Related

For Loop Declining Balance

Apr 10, 2015

This is my current code:

import java.util.*;
public class Testing
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int loanAmount, loanDurationYears, periods;
double interestRate, monthlyPayment, totalInterest, balance;
 
[Code] .....

Output:

Enter loan amount:90000
Enter loan duration in years:15
Enter interest rate as a percent:6.75
Loan amount: $90000
Loan duration: 15 years

[Code] ....

How the output should look:

Enter loan amount: 90000
Enter loan duration in years: 15
Enter interest rate as a percent: 6.75
 
** RESULTS **
 
For a 15 year loan of $90000.00 at 6.75% interest --
 
Monthly payment = $796.42
Total interest =$53355.33
 
Yearly balances
 
YearInterestLoan Balance
15965.23 86408.21
25715.14 82566.33
35447.64 78456.94
45161.51 74061.43
54855.46 69359.87

[Code] ....

There seems to be a lot of things wrong with the output I get, but I'm not sure why. How do I get the output to print in columns? Also, how do I get the numbers to round?

View Replies View Related

Account Balance Does Not Change

Apr 13, 2014

I need to make a program that uses an object to calculate balance

import java.util.Date;
public class Account {
/** Setup Default Variables */
private int id = 0;
private double balance = 0;
private double annualInterestRate = 0;

[Code] ....

View Replies View Related

Bank Account - Balance Must Be A Floating Point Number

Sep 21, 2014

Develop the class “Account” to be used by a bank. The Account class should have a single instance variable “balance”. Remember that balance must be a floating point number. The required methods for the Account class are shown below.

The Account class “debit” method should return a Boolean and should not allow an overdraft. If a withdraw greater than the current balance is attempted, the function should immediately return “false” and do nothing else.

Develop a test class to thoroughly test all aspects of the Account class. DO NOT change the class name or instance variable name given or the required method names as detailed below.

Account
1 constructor with no parameters (default balance to 0)
1 constructor with a balance parameter
setBalance method
getBalance method
credit method
debit method

I have the test class done, I won't need to put that in till later. My main problem is I'm not sure how I'm going to be able to get debit and setBalance to work together with each other.

public class Account
{
protected double balance;
// Constructor to initialize balance
public Account( double amount ) {
balance = amount;

[Code] ....

You can see I'm stressed out by not reading over my code. I already have the "Debit" in use, just have to change it. Which I did.

View Replies View Related

New Lines Don't Show Up In File But They Do Show Up On Console

Apr 30, 2015

I have the following code.

class A {
List<StringBuilder> list;
public void output(List<StringBuilder> objectToOutput){
try(BufferedWriter bw = new BufferedWriter(new FileWriter("temp.txt"))){
for(StringBuilder row:objectToOutput) bw.write(row.toString());
}catch(IOException e){}

[code]....

Why don't the a's show up on the console? I put them in as part of the debugging process and now I don't understand why they don't show up in both places.

View Replies View Related

Make Date Column Show Only Date And TimeIn And TimeOut Column Only Show Time

Mar 11, 2014

How do i make the 'date' column show only the date and 'timeIn' and 'timeOut' column only show the time. In my database table my 'date' column is a date type and 'timeIn' and 'timeOut' column is time.

View Replies View Related

GUI Show ODD Numbers

Dec 3, 2014

I want to make app in netbeans. When i write numbers in JTextField like 1,2,3,4,5,6... it should show me in JOptionPane information window result of ODD numbers.

View Replies View Related

JPanel Won't Show

May 8, 2015

I want my program to show 1st panel and when a person press image label 2nd panel showup which will have 2 tabs "oneway" and "round trip". But rightnow I only see 2nd panel with only 1 tab and don't see 1st panel at all.

import java.awt.*;
import static java.awt.Font.BOLD;
import java.awt.event.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.*;
import javax.swing.Timer;
import javax.swing.border.*;
import javax.swing.event.*;

[code]....

View Replies View Related

Why Does PNG Image Not Show In Applet

Aug 3, 2014

The PNG Image is already in the src package thingie...

It's a 400 * 258 image...

Java Code: package frame;
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class Temperature_Convert extends Applet
implements AdjustmentListener {
private Image temp;
private Scrollbar bar;

[code]....

View Replies View Related

Swing/AWT/SWT :: How To Show A JButton

Sep 25, 2014

I'm not sure what I'm doing wrong but none of the buttons will show below. I tried using .add with the container name but it kept giving me an error. When I just put add.(); it seems fine but then nothing shows. Is there something I'm missing that's required?

import java.awt.Container;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@SuppressWarnings("serial")

[code]....

View Replies View Related

How To Hide Or Not Show Output

Aug 8, 2014

My code is already running. But the problem is, i don't want to see 0 denomination. like for example if i input 3.86 in (dollars).

dollars: 3
quarters: 3
dimes: 1
pennies: 1

so my problem is. it still showing 0 denomination like this:

dollars: 3
quarters: 3
dimes: 1
nickels: 0
pennies: 1

Currently using latest netbeans and if im correct we are using methods and class runner?.. Anyways here's the code..

for method:

package MyPrograms;
public class Mp3Method {
public int dollars(int dollars,int remainingAmount){
return dollars = remainingAmount / 100;
}
public int quarters(int quarters, int remainingAmount){
return quarters = remainingAmount / 25;

[Code] .....

View Replies View Related

Get Answer To Only Show Two Decimals

May 25, 2014

I have tried as much as I can to place code to give me only two decimals in answers but cannot get it to work not sure if placement or syntax.This is code so far and it works but gives answers to 8 decimals.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

[code]...

View Replies View Related

Show Max And Min Value Of Float Integer

Feb 20, 2014

How do I write a program that shows the max and the min value of a float integer? I found out that in order to get the long I just type in

System.out.println(Integer.MAX_VALUE); and System.out.println(Integer.MIN_VALUE);

I don't know how to do it to a float integer.

View Replies View Related

JSP :: How To Show Loading Image

Feb 11, 2014

I have to show a loading image which should tell some proper loading message in jsp.

View Replies View Related

JLabel Will Not Show Up In Frame

Apr 5, 2014

So Im making a game with a start screen followed by my game. I have a button centered but Im having a hard time displaying my label. Here's my code:

import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
 import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JFrame;
 public class TitleScreen extends JPanel implements ActionListener{
 
[Code] ....

View Replies View Related

Tic Tac Toe Game - X And O Do Not Show In The Board

Apr 12, 2014

I have a tic tac toe game and when i run it it works and there are no errors. but the X's and O'x do not show in the board. I know the problem is in the "gameBoard" method and its cause i am telling the code to print the same board every time but i dont know how to do it the right way....

package chap7MDA;

import java.util.Scanner;
public class chapexe7we {
public static void main(String[] args) {
char[][] board = new char [3][3];//make a game board
gameBoard(board);// call the method game board to make the board

[Code] ....

View Replies View Related

JSF :: 2.0 - How To Show Dialog Without Using Any Faces

Mar 19, 2014

How can I display a modal dialog in JSF 2.0 without using any faces like primefaces, icefaces...

View Replies View Related

Cannot Show SQL Data In JTable?

Feb 27, 2014

I'm trying to display the data from database in a jtable by following the jtable demo example in Java Tutorials Sample Code; but, I couldn't output the data to the jtable. The following code is what I've done so far.
 
import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.util.ArrayList;
public class Patient { static String szJdbcURL = "jdbc:oracle:thin:@129.78.110.188:1521:MyDB";                
static String szUser = "...";                
static String szPasswd = "...";                
static String szModelName = "...";

[Code] .....

View Replies View Related

Swing/AWT/SWT :: Get Image To Show Up On Compiled GUI?

Feb 16, 2014

trying to get my image to show up on my compiled GUI.

Here is my GUI, I just need to know how to get the image to show, where do I save an image file so that it comes up in my GUI.

import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

[code]...

View Replies View Related

Swing/AWT/SWT :: Getting Key Labels To Show In Textfield?

Apr 2, 2014

I am working on a keypad for a phone app for school. I cannot get the numbers from the keys to show up in the textField. I have made multiple tweaks, but think maybe my case statement is the problem?We did a calculator application in the class, so I have based my code off of that. Although the telephone keypad seemed much simpler to code, I can't seem to get the numbers to show up.

public void actionPerformed(ActionEvent e) {
//test for button clicks
foundKey = false;
//search for clicked key
for (int i=0; i<keys.length && !foundKey; i++)

[Code] ....

View Replies View Related

JLabel Won't Show Until JFrame Is Resized

Dec 20, 2014

I am trying to make movingLabel move to a different JPanel each time the JButton is clicked. I can see that the random integer is changing each time the button is clicked, but the movingLabel wasn't doing anything. I noticed that if I click the button and then resize the JFrame with my mouse, it shows in the correct panel. Is there something I am missing, or is there a way to make it automatically display in the correct panel without having to manually resize the JFrame each time? I was thinking that I could add something that resizes the window slightly each time the button is clicked to show it, but I don't think that is probably the "right" way to do it.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
public class JMovingFrame extends JFrame implements ActionListener

[code]...

View Replies View Related

JSF :: Rich Faces Always Show GMT As TimeZone

Oct 31, 2014

<rich:column>
<f:facet name="header">
<h:outputText
value="#{msgs.viewErrorSearchCriteria_createDateTime}" />

[Code] .....

Above code is always showing date as "31-Oct-2014 10:28:57 AM GMT". I want to display this in "31-Oct-2014 10:28:57 AM EDT".

View Replies View Related

Swing/AWT/SWT :: How To Get One Value From JTextField To Show In Another Classes

May 17, 2014

I want the text that the user inputs into the JTextField in the user input panel to be what shows up in the JTextField in the totals panel.

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Scanner;
import javax.swing.*;
import javax.swing.border.TitledBorder;

[Code] ......

I know that I will need to take advantage of the get and set methods, could I get an example of this? How to write the code.

View Replies View Related

Image Doesn't Show In JFrame?

Dec 18, 2014

I'm trying to open an image within a JFrame but the image doesn't show. The directory path is correct. The JFrame opens perfectly but no image is showing.

JFrame frame = new JFrame("IMAGE");
frame.setSize(500,500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon image = new ImageIcon("images/main.jpg");
JLabel label = new JLabel("", image, JLabel.CENTER);
JPanel panel = new JPanel(new BorderLayout());
panel.add( label, BorderLayout.CENTER );
frame.setVisible(true);

View Replies View Related







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