r/learnjava • • Oct 08 '17

Programing Assignment Help

My professor doesn't teach us since she expects us to know how to do everything although I'm taking an intro class in java. Anyway, any help is appreciated. This is the assignment itself https://imgur.com/a/iT0Wq I have some ideas on how to do this problem but no way of actually knowing how to do them because of my professor. This is a link to the code I wrote on pastebin https://pastebin.com/GjUiZnnb. I tried to make one array with the entire input but the space is considered another input instead of a white space. There's a lot that needs to be done and I don't really know where to even start. Any help is super appreciated, thanks.

1 Upvotes

5 comments sorted by

View all comments

1

u/RomanGuard Oct 09 '17 edited Oct 09 '17
  1. Use some kind of prompt "Enter number of students", "Enter name of student and grade" or whatever you decide to know where you are in the process and makes debugging a little easier.

  2. As the names and grades are entered, convert the string to a char array and store the inputs into a char array.

  3. Once that is done, using ascii codes count the number of letters using a int variable for letters and a different int variable for the numbers.

  4. If the inputs satisfy your requirements, pad the name and prefix some 0's according the int counters you used and print out the formatted string.

1

u/LocalPedo Oct 09 '17

I can’t do the first tip cause the program checker is very very specific on how it’s written, but thank you for everything else

1

u/RomanGuard Oct 09 '17

You can always remove the print out statements before you submit your code and it wont affect anything. Do however it makes sense to you.