java

posted by .

Write the following methods and test them.this need to be execute it in Eclipse IDE for Java Developers

1. printVowels - this method should take a String as a parameter and print all the vowels contained in that String one character per line.

2. printConsonants - this method should take a String as a parameter and print all the consanants contained in that String one character per line.

3. printDigits - this method should take a String as a parameter and print all the numeric digits contained in that String one character per line.

4. processExpression - this method should take a String in the format: "integer [[+-*/] integer]*]" Your method should then process this expression and return the result as an integer. You must solve this problem using ONLY tools that were taught thus far in CSC535.

Examples:

"125" -> 125

"125 + 7" -> 132

"125 + 7 - 2" -> 130

"125 * 2" -> 250

"10 / 3" -> 3

and this what i take so far

cou;d you please make the answer easy because i am beginner in programming and use just this code this is what i took so far

while
if
boolen

not!

<

<=

>

=>

==

!=

or//

and &&

String

int length()

char chaeAt(int index)

string to Upper Case()

string to Lower Case()

mathod(subroutines, procedures, functiond)

return_type methodName(comma_delim_list of params)

{

//do stuff

}
this assignment is java language

  • java -

    Here are some Java Tutorials to help:

    http://search.yahoo.com/search?fr=mcafee&p=Java+Tutorials

    Plus, don't forget to check the "Related Questions" below.

    Sra

  • java -

    Learning how to programme can be done by attending lectures, reading code by others, and many other ways.

    However, the best and probably the only way to learn is to code a problem yourself. You will have to make mistakes (code), find mistakes (debug), make corrections and recompile and run your programme.

    In that respect, I would welcome posts of any code that works or does not work. I can help you point in the right direction as you go on.

    I could write the code, and you will compile and submit to your teacher, but you will not have learned anything about the code-debug-run cycle.

    To help you get started, I will show you a method that will print the letters A, B and C from a given string.

    public static void printABC(String s){
    int index=0; // points to each character
    String S=s.toUpperCase(); // compare only in uppercase
    while(index<s.length()){ // loop through each character of the string
    if(S.charAt(index)=='A')System.out.println(s.charAt(index)); // print original character
    else if(S.charAt(index)=='B') System.out.println(s.charAt(index));
    else if(S.charAt(index)=='C') System.out.println(s.charAt(index));
    index++;
    }
    }

    Try to understand every statement of the example. If you do, you will have no problem coding your method. If you don't, feel free to post and request explanations on the part that you do not understand.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Java Help

    I am just starting out in programming. If someone could help me with these assignments, it would be greatly appreciated. "Write a Rectangle class. This class represents Rectangles. Each Rectange has the X and Y coordinates of its center …
  2. Computer Science-Java

    Hi, I have to write a method that returns my first name, middle initial, and last name as a single String and call the method in java. So far, I have: public class ReturnName { static String fullname(String firstname, String middleinitial, …
  3. COMPUTER SCIENCE JAVA

    Assignment problems: Write Java programs for each of the following. 1. Students in a university class are being organized into groups of three for an upcoming research project. To model this situation: a. Write a Student class that …
  4. COMPUTER SCIENCE JAVA

    Assignment problems: Write Java programs for each of the following. 1. Students in a university class are being organized into groups of three for an upcoming research project. To model this situation: a. Write a Student class that …
  5. Java

    Write a method that will take in a String parameter and return true if the first 2 chars in the string also appear at the end of the string, such as with the word "edited", which starts and ends with 'e' and 'd'.
  6. Computer Programming using python

    Assume s is a string of lower case characters. Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o', and 'u'. For example, if s = 'azcbobobegghakl', your program should …
  7. programming

    Assume s is a string of lower case characters. Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o', and 'u'. For example, if s = 'azcbobobegghakl', your program should …
  8. Python programming Language

    Assume S is a string of lower case characters. Write a program that counts up the number of vowels contained in the string S. Valid vowels are 'a', 'e', 'I', 'o', and 'u'. For example, if S='azcbobobegghakl' your program should print: …
  9. java.please help

    Write a Java program that prompts the user for a string. If the string entered by the user does not start with Hello and does not end with a digit, print incorrect and re-prompt the user. Otherwise, print Thank you.
  10. Basic Computer Science

    Write a method in Java that takes two parameters. If the first parameter is equal to the second parameter multiply both and print the result. Thanks.

More Similar Questions