Help .. java in netbeans

can anybody help me with some java programs in netbeans:

1. a Java program to identify and deploy simple interest from the formula:

i = c * r * t / 360, where i = interest, capital = c, r = rate, t = time

2. a Java program that captures keyboard gross salary (SB) from an employee. The program should calculate and print the discount (D) using a 5% to Gross (SB) empleado.Asimismo of the program should calculate and display the net salary (SN) of the employee to perform the remainder of Gross (SB) less The discount (D)

some one said the first one is something like:

public class Main {
public static void main(String[] args) {

double p; // Principle
double r; // Rate example .06 = 6%
int t; // Year

p = 50000.00;
r = 0.05;
t = 1;

double answer = p * r * t / 360;


1 answer Last reply
More about help java netbeans
  1. If by "help me", you mean "do it for me" ... no. I saw way too many bad developers get a diploma to help it. However, if you have specific question like "Why does this code give me the wrong answer?" and "How do I do this specific operation?", then I will answer any question you have.

    First, you can use the tag to show code, it is much better as it preserves spacing and even numbers the lines for you so people can reference the code directly:[code]cHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIAogICAgICAgIGRvdWJsZSBwOyAvLyBQcmluY2lwbGUKICAgICAgICBkb3VibGUgcjsgLy8gUmF0ZSBleGFtcGxlIC4wNiA9IDYlCiAgICAgICAgaW50IHQ7IC8vIFllYXIKICAgICAgICAKICAgICAgICBwID0gNTAwMDAuMDA7CiAgICAgICAgciA9IDAuMDU7CiAgICAgICAgdCA9IDE7CiAgICAgICAgCiAgICAgICAgZG91YmxlIGFuc3dlciA9IHAgKiByICogdCAvIDM2MDsKICAgICAgICAKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oYW5zd2VyKTsKICAgIH0KfQ==[/code]

    For your first task, the above code does work, you would know if you tried it. If you can, I would put it in a separate function so it it "reusable". Also make sure you of the units used for every parameter (capital and interest in $, rate as a simple real number between 1 (100%) and 0 (0%) and time in years?). Was the interest formula given to you or did you come-up with it? It would "work", but it isn't the "real" interest rate formula (which is a bit more complicated).

    For the second task, you can find how to read from keyboard [url=]here[/url] (found using google, learn to search, it will be your best developer asset). To convert from String to whatever other type, look at the [url=]Integer.parseInt(String)[/url] and [url=]Double.parseDouble(String)[/url].
Ask a new question

Read More

Programming Java Apps