0% found this document useful (0 votes)
5 views1 page

Validating Input String Method Guide

The document describes a programming assignment that requires writing a method to validate an input string based on specific rules: it must be at least eight characters long, consist only of letters and numbers, and contain at least three digits. The provided code attempts to compare the user input with a predefined string instead of implementing the required validation logic. The user is seeking clarification on whether their understanding and approach to the assignment are correct.

Uploaded by

johnernestlim20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Validating Input String Method Guide

The document describes a programming assignment that requires writing a method to validate an input string based on specific rules: it must be at least eight characters long, consist only of letters and numbers, and contain at least three digits. The provided code attempts to compare the user input with a predefined string instead of implementing the required validation logic. The user is seeking clarification on whether their understanding and approach to the assignment are correct.

Uploaded by

johnernestlim20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Hello I'm new to programming and I'm having a trouble understanding my assignment.

I
know that this might be a really simple problem for you guys and I'm sorry for that. As of
now, we've only discussed the fundamentals of programming, including methods. Is it
possible that he's just asking me to write a method that will perform the given instructions,
and if so, is my code correct?

Instruction: Write a method oriented program to find if the Input string is a valid string base
on the rules below.

1. a string must have at least eight characters


2. a string consists of letters and numbers (whole numbers) only.
3. a string must contain at least three digits.

Sample input/output1: String Input: ben65431 String is valid: ben65431

Sample input/output2: String input: Jack12 String is invalid

My Answer:

Scanner scan = new Scanner([Link]);


String loud = "jack687504";

[Link]("Enter Input:");
String quiet = [Link]();

if([Link](loud)){
[Link]("Valid String Input:" + loud);
}else{
[Link]("Invalid String Input");

}
}
}

You might also like