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-30-2011, 10:46 PM #20
Luulz
Bounty hunter
Originally posted by Dr.
I'm a homo :O


Bradley, you never told me you released a java program :'(

---------- Post added at 12:46 AM ---------- Previous post was at 12:44 AM ----------

Dudes, welcome after Winky Winky btw, bradley. didnt i give you the link to thenewboston.com? :P

I Have subscribed to thenewboston almost over a year now :P still havent learned a shit xD coz i never have time to watch videos :/ btw, i have learned some php Happy
07-30-2011, 11:03 PM #21
these tutorials are pretty nice, if your starting off programming i prefer C++ its an easier language
07-30-2011, 11:25 PM #22
add a option to use other currenceys?
07-31-2011, 12:18 AM #23
Pichu
RIP PICHU.
Pretty cool. Now create a simple game. Smile
07-31-2011, 02:05 AM #24
Epic?
Awe-Inspiring
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

    
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


You named your class "apples"? You're clearly learning from Bucky.
07-31-2011, 02:06 AM #25
Default Avatar
Brad
Guest
Originally posted by AsianInvasion View Post
You named your class "apples"? You're clearly learning from Bucky.
yeah. im learning from bucky but i made this tool myself.
07-31-2011, 02:08 AM #26
Epic?
Awe-Inspiring
Originally posted by Dr.
yeah. im learning from bucky but i made this tool myself.


I don't doubt you made it yourself. Bucky's a great teacher. Good work.

The following user thanked Epic? for this useful post:

07-31-2011, 07:47 PM #27
Luulz
Bounty hunter
Originally posted by AsianInvasion View Post
I don't doubt you made it yourself. Bucky's a great teacher. Good work.


I Can't wait for Bucky's channel is coming with 800 new tutorials Happy
08-03-2011, 02:06 AM #28
kiwimoosical
Bounty hunter
Parse the digits from their input, use a loop so they don't have to restart the program each time. I have a lot more advice but those are the two main things, good job for a first program but don't develop bad habits :/

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo