Stock System In Java

Jan 6, 2015

I'm making a stock system for the heck of it,so everything was going great until I hit the loop I am trying to use a for loop to add stock to the stock system,any way the question is maily about loops.How come I cannot declare a variable outside a loop and assign a value to it,for example I can declare as follows and I will not get an error,

for(int i=0;i<10;i++){
System.out.println("example");

}

but in my code(and yes its the only error I get I tested it) I get an error and can only declare and assign a value inside the loop,the reason for this is because I wanted to get the value from another class and use it in the loop ok so heres the code from both classes.

public class mainn{

public static void main(String [] args){
stock first = new stock();
int internal;
internal = first.wanted;

[code]....

View Replies


ADVERTISEMENT

Stock Program - Stop User From Entering In Textfield And Display Message When Stock Is Low

Jun 29, 2014

I'm trying to make a stock program that stops the user from entering in textfield and displays a message when stock is low. There's just 2 problem the entered value by the user is only decremented twice then the total stock resets for example with SofaTotal and the if statement doesn't work:

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.text.DecimalFormat;
import java.util.Arrays;

[Code] .....

View Replies View Related

Java MultiThreading Stock

Feb 13, 2014

I am doing a multi threading program . I am unable to get the output i want. I have no compilation error . But I cant get the result I , Null exception. This is my Test program

import java.util.*;
public class Test
{
public static void main (String[]args){
int totalShares = 0 ;
double totalCost = 0.0;
String name = "FCS";
double profit = 0.0;

[code]....

View Replies View Related

Map That Shows The Stock Of Some Company

Dec 16, 2014

Is there anyway i could clean this up. ??

package map;
import java.io.*;
import java.util.*;
public class Map {
public static void main(String[]args)throws Exception{

[Code] .....

View Replies View Related

Stock Database Query Class

Dec 14, 2014

I have a Stock Database query class, it compiles and runs well. Thing is when i enter a user, it shows a user stock information but it repeats showing the same user in the command prompt. the repetition is so fast, you can't see the information. All i wanted was the application to show a user's info, then asks you to enter another user again and so forth. Here is the code

import java.io.*;
import java.sql.*;
import java.util.*;
public class StockDatabaseQuery {
public static void main(String[] args)throws Exception {
String userID;
String firstName;

[Code] ....

View Replies View Related

Drawing A Graph Based On Stock Values From 2 ArrayLists?

Apr 19, 2015

[URL] I made a program that takes 2 stock values by URL tickers, and now I need it to draw a graph with the values for the 2 stocks, so they can be compared visually. So far my idea was to create 2 arraylists that consist of the values for each stock, so that I can draw the graph so that x always move with 1 step, and y0 is the first coordinate, and y1 is the second, and after that y1 is the first, y2 second etc.

View Replies View Related

Stock Tracker Application - Column Bot Found Exception

Dec 13, 2014

I have Stock Tracker application running, everything works just fine, but when i hit the List Users button, i get an SQL Exception which says "Column bot found". I tried searching for the exception from the internet, but the answers didn't suit my needs. below is the Stock Tracker DB i think the exception might be coming from.

public class StockTrackerDB
{
private Connection con = null;

// Constructor: makes database connection
public StockTrackerDB() throws ClassNotFoundException,SQLException

[Code] ......

View Replies View Related

Write A Small Program That Will Calculate Gain / Loss Of Sale Of Stock

Jan 24, 2014

I am trying to write a small program that will calculate the gain and/or loss of the sale of stock. The program will ask the user for the number of shares, the purchase price and the selling price. I am pretty sure that the errors is coming from my calculations in the program.

import java.util.Scanner;
public class investmentCalculator {
public static void main (String[] args) {
Scanner input = new Scanner(System.in);
//User input for number of shares
System.out.print("Enter the number of shares: ");
double shares = input.nextDouble();
 
[code]....

View Replies View Related

How To Get System Time In Java

Jun 1, 2014

I just want to calculate search time for my algorithm . How to get system time in java other than System.nanotime() and System.currenttimemillis() as these methods does not returns consistent time for same input is their another option to get system time???

View Replies View Related

Java Dicing System With Currency

Jul 31, 2014

I have been working on making a Java application for the Game RuneScape. My goal is to make an Application to where you register on the application and it saves the information in a file. I am also looking to make it so you can transfer money from Runescape to your Account on my Application by submitting a ticket. When you submit a ticket you get assisted by one of the moderators, they trade you in the game and take the money, and then they take that money out of their current account. Admins are allowed to give moderators money via their account or another method. My issue is creating the ticket system. I want to be able to do this all via the application. So basically what i have currently for the application is a chat room, with different rooms available to go into by the users. So I need to make the tickets show up only to Moderators and Admins in the general chat room.

View Replies View Related

JCreator - Error In Java Library System

Oct 8, 2014

I search this source code in google about library system then i run this in my JCreator then that error appear . I think that problem is all about "main". where can i put that main ?

View Replies View Related

Java Project On Medical Diagnosis System

May 2, 2014

I want start a project on a medical diagnoses system. i want to get a clue on how i will go about the development...

View Replies View Related

How To Kill System Process From Java Code

Sep 7, 2014

I need to kill or remove windows system process like cmd.exe from java code. Like removing it from end process in task mgr. I tried below code but its not removed. Is there a better way we can do this.

killing a system process from java code will create any issues?

public static void main(String[] args) throws Exception {   String[] cmd = { "cmd.exe" };  
Process p = Runtime.getRuntime().exec(cmd);   p.destroy();   }

View Replies View Related

Java Objects And Classes - System Of Linear Equation

Mar 15, 2015

The question states: Design a class named LinearEquation

for a 2 x 2 system of linear equations:

ax + by = e

cx + dy = f

Where

x =

ed − bf/ad − bc

y =

af − ec/ad − bc

The class contains:

- Private data fields a, b, c, d, e, and f.
- A constructor with the arguments for a, b, c, d, e, and f.
- Six get methods for a, b, c, d, e, and f.
- A method named isSolvable() that returns true if ad−bc is not 0.
- Methods getX() and getY() that return the solution for the equation.

Write a test program that prompts the user to enter a, b, c, d, e, and f and displays the result. If ad − bc is 0, report that "The equation has no solution."

I believe that my program is correct because I am able to compile it and get no errors, however I have no clue how to display the information for x and y or display this equation has no solution if ad-bc=0.

Java Code:

import java.util.Scanner;
public class Exer911 {
public static void main(String[] args){
// Create a scanner system to hold the numbers for each variable
Scanner input = new Scanner(System.in);
// Prompt the user to enter a number for each of the variables

[Code] ....

How to get the information to display ....

View Replies View Related

File Location Of Java Console On Windows XP System?

Dec 11, 2013

I've forgotten the file location of the Java Console contents on a Windows XP system.

View Replies View Related

Online Election System - Using Image In Java Class

May 19, 2013

I am doing a project "online election system" client-server base application.

I have a party registration class in my program. and I have a party registration form in which I want to upload a image(Poll Symbol) for newly register party. but I don't know how to do this.?

View Replies View Related

JSP :: Hide Sensitive System Properties Like Passwords Set By Java Applications?

Oct 28, 2014

I am maintaining an existing Java product (which has a HUGE code-base). I discovered that it is setting (and getting) two of its internal passwords as Java system properties, at no less than 4-5 different places (methods). Now, the problem is, the passwords are being stored as plain text in the Java system properties, and so, the same is visible to external entities, as the application is not using any Java Security Manager. For example, if the application (process) is running on port number 1234, we can run the Java command:

jinfo -sysprops 1234

to view both the passwords as values of the corresponding Java system properties. I wish to ask if there is any remedy to this without changing the existing code-base too much? The desired effect would be to "hide" the two Java system properties (denoting the two passwords) from all external entities.

It may be noted that introducing a Java Security Manager into the application may not be a solution, as if we revoke read permissions from the said two Java system properties using the Java Security Manager, the application codes which read those properties would crash. Same is applicable for storing the passwords in encrypted form, as that would crash all codes within the application which are expecting to read the passwords in clear text form.

To give a bit more context, the said two passwords we are storing as Java system properties are actually passwords to access two key-stores, and Tomcat requires that we store the said two passwords in plain-text format. Any workarounds, such that only Tomcat will be able to see the two passwords as-is, while they will be invisible to all other external entities?

Or, is there any way to place the said passwords in other in-memory locations (like static variables) which only Tomcat can (be made to) read instead of placing them as system properties which is exposed to anyone?

View Replies View Related

Solving / Roots Of Nonlinear System Of Equations - Java / Android

Oct 11, 2014

I am in search of a library that has been created in JAVA that can be utilized to solve for roots of a nonlinear system of equations. Each equation has 2 variables, x and y, and will need a library that uses higher calculus equations. No ones that just solve for x.

Most of the libraries that have been created to solve nonlinear equations are either in Fortran, C, or Python. There are a few libraries such minpack/scipy. The only libraries that I have been able to find or programming solutions that are in JAVA either require additional programs such as Matlab or are commercial products

I did find one library put together by a professor in Colorado State, but am unsure how to use it. There does not seem to be a way to enter your functions in the code.

Newton Raphson Method - Multivariable(x and y) Page Not Found

How to use this library or find a library that can be used in an android application would be amazing.

View Replies View Related

Java Database System - App For Nutritionists To Check What Their Clients Are Eating

Oct 23, 2014

I've been asked to create an app for nutritionists to check what their clients are eating.

I've found a database of all foods with nutritional values. In the past I've dealt with databases which just have are just one dimensional, so it's been easy to just create a string array for it. But this is absolutely huge, it's got about 10,000 rows and 30 or so columns, so that's not going to work any more.

The app needs to ask what the client ate at which times, and then save this along with the nutritional values.

What would be the best way to go about storing and calling a database of this size in java?

Should I learn SQL and JDBC to tackle it or is there any easier way?

View Replies View Related

Launch Windows Directly Into JAVA Based Password Entry System?

Apr 5, 2014

Is it possible to launch windows, specifically 8.1, directly into a java based program which would serve as the password entry screen? That is to say, instead of using the standard windows screen, could a java based alternative be used?

I have the source code used on jurassicsystems.com. I would absolutely kill to have a tweaked version of this system act as my password entry screen. It is literally something Ive wanted to have done for ages, and this emulation finally means it may be possible.

View Replies View Related

Java Caching System - Set Expire Time For Object Using Predefined Method

Jul 22, 2014

When we are caching an object, how to set expire time for that object by using pre defined methods?

View Replies View Related

Show System Tray Or Desktop Notification From Web Application Based On Java

Nov 23, 2014

The explanation is a bit lengthy because I just tried to explain everything in one shot.

Link to the question

java - Show a System Tray notification or Desktop notification from the web application

View Replies View Related

File System - Managing Secondary Memory Simulated As Byte Array In Java

Feb 11, 2014

I and a friend are working with a project to create a file system, who manages a secondary memory simulated as a byte array in Java. We want the file system to be a hierarchical tree structure like in UNIX.

We have come quite far, but the paths are not handled correct. I seem to have mistaken the relative folder ./ for the root folder, but it should mean "working directory folder", ie, where I stand now. That is, if I stand in /dir1 as my "working directory" and make mkdir ./dir2 then should dir2 end up as subfolder in dir1. But with me it appears in the root.

View Replies View Related

Solver For System Of Linear Equation In Java For Large Matrices (finite Element Program)

Jan 16, 2014

I develop a finite element code at java. I am looking for efficiency solver and fast for large, sparse , symmetric and positive define matrices .

i used in jblas but i encounter in problem when the matrix has high condition number(ill condition number) and i get error for singular matrix while in mathematica i succeed to solve that system without problems...

Any good solver and fast solver package in java can i use for solving that system?

View Replies View Related

Java Student Record System - Cannot Save Data To View Or Submit Record

Feb 19, 2014

I have written a program student record system but can not save data to view or submit record. Able to run the program but failed to submit record or view pre-submitted records.

Student.java

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
 class Student extends Frame implements ActionListener {
String greeding="";
Button btnNewStudent;

[Code] .....

View Replies View Related

The System Cannot Find The Path Specified

Feb 25, 2015

I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."

I checked the Environment Variables on Windows 7 and the Path says: C:Program Files (x86)Javajre1.8.0_31in

This is after many tries and i still can't change directory and i keep getting the same message.

View Replies View Related







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