ورود

View Full Version : 1 برنامه ی جاوا



ronak_a
یک شنبه 09 اسفند 1388, 13:05 عصر
سلام به همه ی دوستان. لطفا به منه سال اولی که از جاوا چیزی نمیدونم کمک کنید. برنامه ی زیر رو به جاوا میخوام.



__________________________________________________ _
Problem specification

Given a text containing sentences, you need to implement

the methods of class String, apply it on your string and

evaluate your methods by String methods.

The methods that you are going to implement is

substring(int,int), replace(char, char), replaceAll(char, char),

compareto(string), length().

You need to define an array of character at first and run

above methods on them. Then transform the array of char to

a String and apply the same methods that have been

provided by Java. The result should be the same.

You need to enter the String and ask the user which method

she is going to run. Depending on the method that user

chooses, you are required to ask related info. For example if

user chose compareto(string) you need to ask which string

should be compared with the original one.

Error conditions

Think of different possibilities that make the program

incorrect.

Hints

The java API is there to help you.

To create a string from your character array use

String(char[] value) method from String class.

Typical input

Input: A bad workman blames his tools.

1- substring(int,int)

2- replace(char,char)

3- replaceAll(char, char)

4- compareto(string)

5- length()

6- Exit.

Choose the method: 1

Begin: 6

End: 12

Corresponding output

The result is “workman

jlover
یک شنبه 09 اسفند 1388, 20:56 عصر
جالبه که دقیقن همین سوال ( منتها به فارسی ) ، چند روز قبل پرسیده شد و دیگه آغازگر اون بحث ( که احتمالن همکلاسی شما بوده:چشمک: ) دیگه دنبال نکردن،شما هم میتونید از همونجا دنبال کنید

http://barnamenevis.org/forum/showthread.php?t=206676

saeedIRHA
یک شنبه 09 اسفند 1388, 20:59 عصر
سلام به همه ی دوستان. لطفا به منه سال اولی که از جاوا چیزی نمیدونم کمک کنید. برنامه ی زیر رو به جاوا میخوام.



__________________________________________________ _
Problem specification

Given a text containing sentences, you need to implement

the methods of class String, apply it on your string and

evaluate your methods by String methods.

The methods that you are going to implement is

substring(int,int), replace(char, char), replaceAll(char, char),

compareto(string), length().

You need to define an array of character at first and run

above methods on them. Then transform the array of char to

a String and apply the same methods that have been

provided by Java. The result should be the same.

You need to enter the String and ask the user which method

she is going to run. Depending on the method that user

chooses, you are required to ask related info. For example if

user chose compareto(string) you need to ask which string

should be compared with the original one.

Error conditions

Think of different possibilities that make the program

incorrect.

Hints

The java API is there to help you.

To create a string from your character array use

String(char[] value) method from String class.

Typical input

Input: A bad workman blames his tools.

1- substring(int,int)

2- replace(char,char)

3- replaceAll(char, char)

4- compareto(string)

5- length()

6- Exit.

Choose the method: 1

Begin: 6

End: 12

Corresponding output

The result is “workman


اینجا جای حل تمرینات دانشجویی نیست عزیز ! (طبق قوانین سایت)