Allen Watts

Greenhorn
+ Follow
since Jul 18, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Allen Watts

Awesome!  your suggestions were exactly what I needed!  It is working with the expected output!  Thank you so much!
6 years ago
Hello everyone,

I have hit a rut and I cant figure out where my problems are.

I need to create a class called course and then create an object for each course.

I need to have an output that looks like this:

Course objects have a code (e.g. IT1006) and credit hours (e.g. 6)
The number inside the [] is the display order number
The number inside of the () is the credit hours for the course

[1] IT1006 (6)
[2] IT4782 (3)
[3] IT4789 (3)
[4] IT4079 (6)
[5] IT2230 (3)
[6] IT3345 (3)
[7] IT2249 (6)


Here is what I have written this far...



Any help would be greatly appreciated!

-Allen
6 years ago
Hello everyone,
Thank you for the interest in my post!

Any code that was entered UNDER the 6 digits would not be considered valid.  

Code: hu47 is not valid
Too short, not 6 characters (or some equivalent message)

would work perfectly.  

I have considered reading string input with IndexOf and then somehow validating each character in the string that way, but I can't figure out how to do it- it is the only way I can think of in order to code the output in the required way...

Thanks,
Allen
6 years ago
Hello everyone,
This is my first time posting here, I can not seem to find resources that I can apply in order to make this work!
I need to validate a 6 character string that is user input.  
The first 2 characters HAVE to be IT, either upper or lower case and the last 4 characters can be any numbers...  If the user inputs anything else, like for example TP2345 I need to print that the input was invalid.
I have read a lot about other types of validation, but I can not seem to apply them to this char inside of a string application...

output should look like this...

Enter a code for validation (e.g. IT8877):  IT2258
Code: IT2258 is valid.

or

Enter a code for validation (e.g. IT8877):  hu47hu
Code: hu47hu is not valid
First character is not an I or i
Second character is not a T or t
Fifth character is not a digit
Sixth character is not a digit

Any advice or sample code would be very much appreciated!!!

Thank you,
Allen

 
6 years ago