• Post Reply Bookmark Topic Watch Topic
  • New Topic

Course Splitter  RSS feed

 
kerwin john abrinica
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me in my java problem,

i have examples here in my problem in Course Splitter .

Normally a course is described as follow: ABC 123 : Course Description. Design and implement a Java program named CourseSpliter.java that contains a method that will split then print the 3 components of the following course description: ICS 102 : Introduction to Computing I as shown below:
Course Name: ICS
Course Number: 102
Course Description: Introduction to Computing I

After displaying the output ask the user if another input will be given.

THANKS ..
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kerwin,

Welcome to the Ranch

Have you analyzed the set of inputs and the respective outputs for the assignment?

Disintegrate the problem into pieces like getting course input from the user, splitting the input into course details and asking user whether to continue. Start code to finish each requirement.

Please show the code you have tried and we will be happy to help you in the problem.
 
Korhan Rankin
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey John,

you might have a look here, I guess you are in same class?!

http://www.coderanch.com/t/564212/java/java/Java-String-Spliter-substring-string
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Korhan Rankin wrote:Hey John,

you might have a look here, I guess you are in same class?!

http://www.coderanch.com/t/564212/java/java/Java-String-Spliter-substring-string


your marker will notice if all 3 of you have indentical answers.
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the easiest way to go about this is to use the String class's split() method: and use a simple regex to differentiate between the word separators ( i.e. whitespace and ':')



So I have given you the basic structure, it's your job to fill in the rest. Find a regex that accounts for whitespace and ':"; then place the correct indexes in the array assignments.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find a lot of useful information in the other threads. Also in the Java Tutorials.

I have edited Hunter McMillen’s most recent post to make the link work better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!