Thread: Need some help.

Results 1 to 9 of 9
  1. #1
    ZeroInsanity's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    root@Insanity
    Posts
    362
    Reputation
    10
    Thanks
    138
    My Mood
    Yeehaw

    Need some help.

    Soon, I will be able to take AP computer science. Should I? If you've taken it, what was it like? I'm just worried it will be like some shitty "Scratch Class".

  2. #2
    liquidsystem's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    507
    Reputation
    135
    Thanks
    680
    My Mood
    Happy
    If it's anything like mine, it is nothing like Introduction to Programming... It's a serious class that actually challenges you.
    If you wish to thank me, don't forget to click the button!

    Currently Playing: Osu, OldSchool Runescape (pm for username)


    Bitcoin Address: 1HUdLVM7DnT9gC1i5kNKzcKWekSbFoKNp2


    Steam
    Main Account
    Sales Account

    Feel free to PM me if you have any other questions relating Java, Python, or Physics, or general schoolwork


  3. #3
    Bernard.'s Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    24,514
    Reputation
    2110
    Thanks
    2,985
    My Mood
    Bored
    Quote Originally Posted by liquidsystem View Post
    If it's anything like mine, it is nothing like Introduction to Programming... It's a serious class that actually challenges you.
    ^ I heard the same thing so I didn't take it.
    Rep. Power: 111

    Minion: 11/28/12-3/15/14

  4. #4
    liquidsystem's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    507
    Reputation
    135
    Thanks
    680
    My Mood
    Happy
    Quote Originally Posted by Bernard. View Post


    ^ I heard the same thing so I didn't take it.
    Well he also made a rage thread about learning Java...
    If you wish to thank me, don't forget to click the button!

    Currently Playing: Osu, OldSchool Runescape (pm for username)


    Bitcoin Address: 1HUdLVM7DnT9gC1i5kNKzcKWekSbFoKNp2


    Steam
    Main Account
    Sales Account

    Feel free to PM me if you have any other questions relating Java, Python, or Physics, or general schoolwork


  5. #5
    We always want to see what is hidden by what we see.
    Former Staff
    Premium Member
    Cataclypse's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    ಠ_ಠ
    Posts
    13,907
    Reputation
    1725
    Thanks
    1,742
    My Mood
    Pensive
    For my class we did Scratch for a few days and dived right into Java afterwards. I would take the class but my teacher is an expert so I may be biased.


    Skype: MPGH.Cataclypse
     


    Member - IX.MMX
    Donator - XII.MMXI
    Middleman - IV.MMXII
    League of Legends Minion - V.MMXIV
    Editor - VI.MMXIV
    Other MMORPGs Minion - X.MMXIV
    Call of Duty Minion - XII.MMXIV
    CrossFire Minion - II.MMXV
    Steam Games Minion - III.MMXV
    Minion+ - IV.MMXV
    Former Staff - XI.MMXV



  6. #6
    ZeroInsanity's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    root@Insanity
    Posts
    362
    Reputation
    10
    Thanks
    138
    My Mood
    Yeehaw
    Quote Originally Posted by liquidsystem View Post


    Well he also made a rage thread about learning Java...
    I don't like Java. But, I've done some small things in it. Anyways, thanks for answering. What do you mean by challenge though?

  7. #7
    Hunter's Panda's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    BT
    Posts
    542
    Reputation
    68
    Thanks
    108
    I am interested in this as-well, I just started C++ :P

  8. #8
    liquidsystem's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    507
    Reputation
    135
    Thanks
    680
    My Mood
    Happy
    Quote Originally Posted by ZeroInsanity View Post


    I don't like Java. But, I've done some small things in it. Anyways, thanks for answering. What do you mean by challenge though?
    "challenge" in the sense that it's new material that you get drilled into your head, you either learn it or fail.
    GG NO RE

    shit like this:
    Code:
    int numerator = (Math.abs(gen.nextInt()%ENDING_NUMBER) + STARTING_NUMBER);
    or here's a fucking fantastic one...
     

    Code:
    import javax.swing.JOptionPane;
    
    public class bankTeller {
    
    	// Scrum idea:
    	/* Bank Teller program ---------
    	 * Pre-Planning: make a list of pins, and give a balance to them to use
    	 * 1. ask the user for their pin
    	 * 2. check to see if the pin exists, if it does, find the variable associated with it
    	 * 3. allow them to deposit, withdraw from their account
    	 * 
    	 */
    	
    	private static double account_balance;
    	private static int pin;
    	
    	public static int[] getUsersList() 
    	{
    		int[] user = {1234, 2019, 2100, 1900, 1111, 0000};
    		return user;
    	}
    	
    	public static double[] getBalanceList()
    	{
    		double[] balance = {200, 5, 100, 10000, 1241.21, 5000};
    		return balance;
    	}
    	
    	public static void getPin()
    	{
    		boolean invalid_format = true;
    		while(invalid_format)
    		{
    			String input = JOptionPane.showInputDialog("Please enter your Personal Identification Number","Enter your PIN");
    			if(input==null)
    			{
    				System.exit(0);
    			}
    			try
    			{
    				pin = Integer.parseInt(input);
    				invalid_format = false;
    			}
    			catch(NumberFormatException e)
    			{
    				JOptionPane.showMessageDialog(null,"I'm sorry, but it appears you did not enter a pin in the form of an integer.","Error",JOptionPane.ERROR_MESSAGE);
    			}
    		}
    		setPin(pin);
    	}
    	
    	public static void setPin(int p)
    	{
    		pin = p;
    	}
    	
    	public static void welcome()
    	{
    		JOptionPane.showMessageDialog(null,"Good day! Welcome to the Bank of Middleton","Welcome!",JOptionPane.PLAIN_MESSAGE);
    	}
    	
    	public static void preCheck()
    	{
    		getPin();
    		boolean noPin = false;
    		int i = 0;
    		int[] users = getUsersList();
    		double account_balance = 0.0;
    		double[] balance = getBalanceList();
    		JOptionPane.showMessageDialog(null,"Thank you for entering your pin, please hold while we check to see if your pin is correct...","Please Wait...",JOptionPane.PLAIN_MESSAGE);
    		
    		
    		
    		for(i=0;i<users.length;i++)
    		{
    			if(users[i] == pin)
    			{
    				account_balance=balance[i];
    				noPin = false;
    				break;
    			}
    			else
    			{
    				noPin = true;
    			}
    		}
    		if(noPin == true)
    		{
    			JOptionPane.showMessageDialog(null,"It apppears that you have entered a pin that does not exist in our database. Try again.","Error",JOptionPane.ERROR_MESSAGE);
    			preCheck();
    		}
    		
    			setBalance(account_balance);
    			createGUI();
    	}
    	
    	public static void setBalance(double a)
    	{
    		account_balance = a;
    	}
    	
    	public static void createGUI()
    	{
    		Object[] choices = {"Deposit","Withdraw","Go Back"};
    		int choice = JOptionPane.showOptionDialog(null,"Hello! What would you like to do with your account?"+"\nYour current balance is: $"+account_balance,"Account",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,choices,choices[0]);
    		if(choice==0) // User has chosen deposit
    		{
    			deposit(account_balance);
    			JOptionPane.showMessageDialog(null,"Your new balance: $"+account_balance,"Balance",JOptionPane.PLAIN_MESSAGE);
    		}
    		else if(choice==1)
    		{
    			withdraw(account_balance);
    			JOptionPane.showMessageDialog(null,"Your new balance is: $"+account_balance,"Balance",JOptionPane.PLAIN_MESSAGE);
    		}
    		else if(choice==2)
    		{
    			account_balance = 0;
    			pin = 0;
    			preCheck();
    		}
    		else
    		{
    			System.exit(0);
    		}
    		
    	}
    	
    	public static void deposit(double user_input)
    	{
    		double addMoney=checkNumber(user_input,"add"); 
    		account_balance+=addMoney;
    		createGUI();
    	}
    	
    	public static void withdraw(double user_input)
    	{
    		double removeMoney=checkNumber(user_input,"remove");
    		if(removeMoney > account_balance)
    		{
    			JOptionPane.showMessageDialog(null,"I'm sorry, but you cannot withdraw more than you have in your account","Error",JOptionPane.ERROR_MESSAGE);
    			withdraw(account_balance);
    		}
    		else
    		{
    			account_balance-=removeMoney;
    			createGUI();
    		}
    	}
    	public static double checkNumber(double user_input,String addOrRemove)
    	{
    		boolean invalid = true;
    		double changeMoney = 0;
    		while(invalid)
    		{
    			String input = JOptionPane.showInputDialog(null, "How much money would you like to "+ addOrRemove +" to your account?",addOrRemove+" Money",JOptionPane.PLAIN_MESSAGE);
    			try
    			{
    				changeMoney = Double.parseDouble(input);
    				invalid = false;
    			}
    			catch(NumberFormatException e)
    			{
    				JOptionPane.showMessageDialog(null,"Sorry, you did not enter a proper number.","Error",JOptionPane.ERROR_MESSAGE);
    			}	
    		}
    		
    		changeMoney = Math.abs(changeMoney);
    		return changeMoney;
    		
    	}
    	
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		welcome();
    		preCheck();
    	}
    
    }


    - - - Updated - - -

    Quote Originally Posted by Cataclypse View Post
    For my class we did Scratch for a few days and dived right into Java afterwards. I would take the class but my teacher is an expert so I may be biased.
    Sounds like Intro to me...
    In Advanced (Or AP...) the teacher assumes you know what the fuck you're doing and know what an IDE is, so we began with a simple number guessing game.
    Last edited by liquidsystem; 03-11-2015 at 09:47 PM. Reason: edited longest program on MPGH
    If you wish to thank me, don't forget to click the button!

    Currently Playing: Osu, OldSchool Runescape (pm for username)


    Bitcoin Address: 1HUdLVM7DnT9gC1i5kNKzcKWekSbFoKNp2


    Steam
    Main Account
    Sales Account

    Feel free to PM me if you have any other questions relating Java, Python, or Physics, or general schoolwork


  9. The Following User Says Thank You to liquidsystem For This Useful Post:

    ZeroInsanity (03-11-2015)

  10. #9
    Before the gods, there were the Titans.
    Premium Member
    Batman's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Location
    Wherever the road wishes to take me.
    Posts
    3,811
    Reputation
    515
    Thanks
    582
    My Mood
    Sneaky
    I'm taking the test this May for it.

    I recommend it if you can have a good grasp of programming logic and mathematics.

Similar Threads

  1. [Help Request] Need some help with my Project
    By Vertual~ in forum Call of Duty Modern Warfare 3 Help
    Replies: 2
    Last Post: 01-30-2012, 05:33 PM
  2. [Help Request] need some help plz
    By crappule20 in forum Combat Arms Help
    Replies: 2
    Last Post: 12-10-2011, 12:25 PM
  3. [Help Request] Need some help with my server premisions
    By pero122 in forum Minecraft Help
    Replies: 5
    Last Post: 11-07-2011, 11:55 PM
  4. [Help Request] Need some help to make a bot
    By Domo in forum Vindictus Help
    Replies: 6
    Last Post: 05-21-2011, 11:15 AM
  5. [Help Request] I need some help with binding eps7
    By v1zhaixingv1 in forum Vindictus Help
    Replies: 3
    Last Post: 05-18-2011, 10:25 PM