Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Suggestions/Tips needed. Newbie here! :)

    I don't know if it's right to post it here. But I'm just so desperate. Sorry.


    Well I don't want to be a spoiled or anything but I really need help. My internet was out for couple of week because of a typhoon and it came back like a few hours ago, can any one help me with this? ASAP.


    A Java program that will do this things basically an idea or theme. Any suggestions? And also tips? Just basic. (programs that I can implement this things)


    Interface (JOption or Scanner) - I already know a little bit of this but I prefer scanner because I use it more often.

    If else -

    Do while loop -

    At least 3 classes -

    Array -

    Try Catch statements - I still don't know how to do this and what it does.

    String Manipulation (concatenation + method is not counted) - I only know the "+" method, sadly.

    At least 3 Mathematical Computation (basic arithmetic techniques are not counted, produce methods of formula) - If not arithmetic what can I do?

    Instance Variables - I also don't know this and what it does.


    I'm a newbie at Java and my teacher already gave us this project. Can you help me? Help is very much appreciated. And oh I will appreciate some sample programs too. And sorry for the crappy english I'm not brilliant with it.

  • #2
    New Coder
    Join Date
    Aug 2011
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hmm i'm not really sure what you are asking. are u saying yr teacher wants u guys to do a program, any java program that includes these stuff?

    Interface (JOption or Scanner)
    If else loop -
    Do while loop -
    At least 3 classes -
    Arrays-
    Try Catch statements - these are for error handling, google it or something
    String Manipulation - if concatenation isnt allowed you can try separating 1 long string data into several strings
    At least 3 Mathematical Computation - there shld be lots of math libraries around, so just do a search
    Instance Variables -

  • #3
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes any java programs that included those stuffs. I can't seem to think of anything and there were things that have to be included that I'm not familiar with. Thanks.

  • #4
    New Coder
    Join Date
    Aug 2011
    Posts
    49
    Thanks
    1
    Thanked 0 Times in 0 Posts
    if it were me i would find something that relates to the math and string manipulation. all the other "conditions" are actually basic stuff that programmers use in almost every program.

  • #5
    New Coder
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is a simple code me and my partner created today in java class. We had to make a program to convert a year (1-3000) to a roman numeral using loops. Has many of the requirements you need. feel free to add and adjust accordingly. Thanks is appreciated as this took us a good 1.5 hours to code.
    Code:
    import java.util.Scanner;
    
    public class Roman {
    	public static void main(String[] args) {
    	Scanner keyboard = new Scanner(System.in);
    	System.out.println("Please insert a year:");
    	int year = keyboard.nextInt();
    	while((year > 3000) || (year < 1)){
    	System.out.println("Year given is invalid! Please give a year i
    n the range 1 - 3000.");
    	year = keyboard.nextInt();
    	}
    	System.out.printf("The year %d is ", year);
    	int year1 = year;
    	int d1 = (year1 / 1000) % 10;
    	int d2 = (year1 / 100) % 10;
    	int d3 = (year1 / 10) % 10;
    	int d4 = (year1 / 1) % 10;
    	int i = 1;
    	while (i <= d1){
    		System.out.print("M");
    		i++;
    	}
    	int l = 1;
    	while (l <= d2){
    		if (d2 <= 3) {
    		System.out.print("C");
    		l++;
    		}
    		else if (d2 == 4) {
    		System.out.print("CD");
    		l = 5;
    		}
    		else if ((d2 >= 5) && (d2 <= 8)) {
    			System.out.print("D");
    			int m = 5;
    			while (m < d2){
    			System.out.print("C");
    			m++;
    			}
    			l = 10;
    		}
    		else {
    		System.out.print("CM");
    		l = 10;
    		}
    	}
    	int n = 1;
    	while (n <= d3){
    		if (d3 < 3) {
    		System.out.print("X");
    		n++;
    		}
    		else if (d3 == 4) {
    		System.out.print("XL");
    		n = 5;
    		}
    		else if ((d3 >= 5) && (d3 <= 8)) {
    			System.out.print("L");
    			int o = 5;
    			while (o < d3){
    			System.out.print("X");
    			o++;
    			}
    			n = 10;
    		}
    		else {
    		System.out.print("XC");
    		n = 10;
    		}
    	}
    	int p = 1;
    	while (p <= d4){
    		if (d4 < 3) {
    		System.out.print("I");
    		p++;
    		}
    		else if (d4 == 4) {
    		System.out.print("IV");
    		p = 5;
    		}
    		else if ((d4 >= 5) && (d4 <= 8)) {
    			System.out.print("V");
    			int q = 5;
    			while (q < d4){
    			System.out.print("I");
    			q++;
    			}
    			p = 10;
    		}
    		else {
    		System.out.print("IX");
    		p = 10;
    		}
    	}
    
    
    	System.out.println(" in roman numerals.");
    }
    }

  • #6
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @capypara I thought of programs that was all about math but for some instance I cannot put string manipulation in it. -___- Having a hard time there. And I can't think of any formulas that will make sense to the program. Basically the program should be "themed" if I call it right.

    @Fahey thanks for the program! I really appreciated it. I think I can use it for some preference. But for some reason thr Thank User for this post button in your post is not really working for me. It's redirecting me in something that says, You don't have the enough priveledge blablabla etc. But I really appreciated it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •