Post: My First Java Program
07-25-2011, 07:00 PM #1
Default Avatar
Brad
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); This is my first tool and release. what it does is tell you how much something is with vat added. thanks to xavious87 and Skurken (on tnb) for helping me with a few problems Smile

    
import java.util.Scanner;

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

//Choose to add or take vat.
System.out.println("Read Before Entering: ");
System.out.println("1) When it asks for current vat rate don't pu a % at the end.");
System.out.println("2) This was made by bradley");
System.out.println("3) Put the number 1 in and click enter if you have read this.");
Scanner opt = new Scanner(System.in);
int option = opt.nextInt();

//if option is 1 loads add vat.
if(option == 1){

System.out.print("Enter your current vat rate: ");
double inputVat = opt.nextDouble();

System.out.print("Enter the ammount of money to add vat to: ");
double inputAmount = opt.nextDouble();

//Works out price with vat added.
double Total = inputAmount / 100 * inputVat + inputAmount;

System.out.println("Value with vat added: " + Total);
//sees if they have picked the correct button.
}else{
System.out.println("Please choose a valid option.");
}
}
}



Download it here: use the batch if it doesn't load when you click the jar file. also make sure to extract it all first.
You must login or register to view this content.

is a virus scan : You must login or register to view this content.
thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Brad for this useful post:

Woof, MCPADDINGTON, Pichu, PsYcHoSiS, ResistElite,
07-25-2011, 07:13 PM #2
I can confirm it works with no viruses :lol:

Screenshot:

You must login or register to view this content.

The only thing is it forces the dollar Gaspkay:

The following user thanked MCPADDINGTON for this useful post:

07-25-2011, 07:16 PM #3
Default Avatar
Brad
Guest
Originally posted by MCPADDINGTON View Post
I can confirm it works with no viruses :lol:

Screenshot:

You must login or register to view this content.

The only thing is it forces the dollar Gaspkay:
yeah. i put it as that Happy ill update it so it won't have the dollar :P
07-25-2011, 08:03 PM #4
Woof
...hmm
Originally posted by Dr.
This is my first tool and release. what it does is tell you how much something is with vat added. thanks to xavious87 and Skurken (on tnb) for helping me with a few problems Smile

is a virus scan needed? for the batch they can just open that up in notepad.

thanks Smile

As it is a .rar file you have compressed, yes we will need a virus scan.
Nice program :y:

The following user thanked Woof for this useful post:

07-25-2011, 08:06 PM #5
Default Avatar
Brad
Guest
Originally posted by BAdmaNgLiTcHa View Post
As it is a .rar file you have compressed, yes we will need a virus scan.
Nice program :y:


thanks for the feedback. this is my first tool without following a tutorial so im still new to all of this .
07-25-2011, 08:14 PM #6
Woof
...hmm
Originally posted by Dr.
thanks for the feedback. this is my first tool without following a tutorial so im still new to all of this .


If you are new to it your going to well, java is my weak point :(
07-25-2011, 08:15 PM #7
Default Avatar
Brad
Guest
Originally posted by BAdmaNgLiTcHa View Post
If you are new to it your going to well, java is my weak point :(
I started 2 days ago. i get help from looking at other code and asking someone if they can help if im really stuck but i do almost all of it myself. ill pm you a link to what i think are the best java tutorials out there at the moment Winky Winky
07-25-2011, 08:19 PM #8
Woof
...hmm
Originally posted by Dr.
I started 2 days ago. i get help from looking at other code and asking someone if they can help if im really stuck but i do almost all of it myself. ill pm you a link to what i think are the best java tutorials out there at the moment Winky Winky


Cool I learned all my coding myself Smile (not even some help)
Also thanks! :y:
07-25-2011, 08:23 PM #9
Default Avatar
Brad
Guest
Originally posted by BAdmaNgLiTcHa View Post
Cool I learned all my coding myself Smile (not even some help)
Also thanks! :y:
no problem. just wanted to help :y:
07-25-2011, 08:26 PM #10
Woof
...hmm
Originally posted by Dr.
no problem. just wanted to help :y:

Thanks just got it, I'm on #4 already Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo