Post: Need help calculating percent of a number (NGU CREDITS)
04-14-2016, 12:11 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); You get 0.12% added daily if you keep your credits in the bank. So I want to calculate how many credits you'll have in the amount of days you enter. Here's my code:

    import java.util.Scanner;

public class project {
public static void main(String[] args){
Scanner input = new Scanner(System.in);

System.out.println("-------------------------");
System.out.println("| NextGenUpdate Credits |");
System.out.println("-------------------------");
System.out.println("Credits: ");
double credits = input.nextDouble();
System.out.println("Days: ");
int days = input.nextInt();

double total = //What do I put here?

System.out.println("You will have have " + total + " credits in " + days + " days.");

}
}
04-14-2016, 12:15 PM #2
Ben
Former Staff
It's geometric progression so:

a(0.12)^n

Where:

a= is the starting value

n= number of days.
04-14-2016, 12:28 PM #3
I did this and it seemed to work but i'm not sure if it's the proper way. Please respond if I did something wrong:

You must login or register to view this content.
04-14-2016, 12:33 PM #4
Originally posted by HipHopz View Post
I did this and it seemed to work but i'm not sure if it's the proper way. Please respond if I did something wrong:

You must login or register to view this content.


This wont take in to count if the user is depositing the earned credits from interest each day
04-14-2016, 12:35 PM #5
Originally posted by John View Post
This wont take in to count if the user is depositing the earned credits from interest each day


What should I do?
04-14-2016, 01:27 PM #6
Toxic
former staff
Originally posted by HipHopz View Post
You get 0.12% added daily if you keep your credits in the bank. So I want to calculate how many credits you'll have in the amount of days you enter. Here's my code:

    import java.util.Scanner;

public class project {
public static void main(String[] args){
Scanner input = new Scanner(System.in);

System.out.println("-------------------------");
System.out.println("| NextGenUpdate Credits |");
System.out.println("-------------------------");
System.out.println("Credits: ");
double credits = input.nextDouble();
System.out.println("Days: ");
int days = input.nextInt();

double total = //What do I put here?

System.out.println("You will have have " + total + " credits in " + days + " days.");

}
}


Thread has been moved to Computer Programming Inquires Section :p

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo