redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Saturday 17 November 2018 12:58

Ask your IT question here

Array Problems



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
mario.beka
Guest Programmer




Hey everybody, I'm trying to make a program that calculates the salary of a person in two variants for 25 years.

After doing that i need to show in the end which variant is better and from which year.

until now i can just do the array, but i cannot figure out how to show compare this 2 arrays.
this is my code so far.

Code:

public class Lohnerhohung {
     public static void main(String[] args){
        double kapitalA=1200,kapitalB=1200;
        double sumA = 0,sumB= 0;
        double []varianteA= new double[100];
        double []varianteB= new double[100];
        int i=0;
        System.out.println("Year | Year A | Sum A | Year B | Sum B");


        for (i=0;i<25>kapitalB){
         System.out.println("A is greater"+varianteA[i]+"from year"+i);}
    }

    }

I need some help with this....

Reply with quote
 
mario.beka
Guest Programmer




mario.beka wrote:
Hey everybody, I'm trying to make a program that calculates the salary of a person in two variants for 25 years.

After doing that i need to show in the end which variant is better and from which year.

until now i can just do the array, but i cannot figure out how to show compare this 2 arrays.
this is my code so far.

Code:

public class Lohnerhohung {
     public static void main(String[] args){
        double kapitalA=1200,kapitalB=1200;
        double sumA = 0,sumB= 0;
        double []varianteA= new double[100];
        double []varianteB= new double[100];
        int i=0;
        System.out.println("Year | Year A | Sum A | Year B | Sum B");


           if(varianteA[i]>kapitalB){
         System.out.println("A is greater"+varianteA[i]+"from year"+i);}
    }

    }

I need some help with this....



sorry guys this is the real code...

Code:

public class Lohnerhohung {
     public static void main(String[] args){
        double kapitalA=1200,kapitalB=1200;
        double sumA = 0,sumB= 0;
        double []varianteA= new double[100];
        double []varianteB= new double[100];
        int i=0;
        System.out.println("Year | Year A | Sum A | Year B | Sum B");


        for (i=0;i<25>kapitalB){
         System.out.println("A is greater"+varianteA[i]+"from year"+i);}
    }

    }

[/code]

Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo