r/learnjava • u/LocalPedo • 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
1
u/RomanGuard Oct 09 '17 edited Oct 09 '17
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.
As the names and grades are entered, convert the string to a char array and store the inputs into a char array.
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.
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.