c# - Concat return values from different methods in same class to one value in another method -
is possible concat different return values different methods in same class 1 method? trying want take return values methods/functions , trying bring them 1 string or number in public static int generateid().
here code:
static void main(string[] args) { int dateofbirth; string name; string surname; string firstletr; console.writeline("please enter date of birth in next sequence: yymmdd"); int dob = int.parse(console.readline()); dateofbirth = idenity.dateofbirth(dob); console.clear(); console.writeline("please enter firsletter of name :"); name = console.readline().toupper(); console.writeline("please enter firsletter of surname:"); surname = console.readline().toupper(); firstletr = idenity.firstletters(name, surname); console.clear(); } } class idenity { int dateofbirth, x, y, z; string name, surname, male, female; public static int dateofbirth(int dateofbirth) { int firstsixdigits = dateofbirth; return firstsixdigits; //6 } public static string firstletters(string name, string surname) { dictionary<string, int> firstletters = new dictionary<string, int>(); firstletters.add("a", 1); firstletters.add("b", 2); firstletters.add("c", 3); firstletters.add("d", 4); firstletters.add("e", 5); firstletters.add("f", 6); firstletters.add("g", 7); firstletters.add("h", 8); firstletters.add("i", 9); firstletters.add("j", 10); firstletters.add("k", 11); firstletters.add("l", 12); firstletters.add("m", 13); firstletters.add("n", 14); firstletters.add("o", 15); firstletters.add("p", 16); firstletters.add("q", 17); firstletters.add("r", 18); firstletters.add("s", 19); firstletters.add("t", 20); firstletters.add("u", 21); firstletters.add("v", 22); firstletters.add("w", 23); firstletters.add("x", 24); firstletters.add("y", 25); firstletters.add("z", 26); int valuefirstletters = int.parse(firstletters[name].tostring() + firstletters[surname].tostring()); return valuefirstletters.tostring();//3 } public static string gender(string male, string female) { dictionary<string, int> gender = new dictionary<string, int>(); gender.add("m", 1); gender.add("f", 2); int valuegender = 0; if (male == "m") { valuegender = gender[male]; return valuegender.tostring(); } else { valuegender = gender[female]; return valuegender.tostring(); }//1 } public static int randomize(int x, int y, int z) { random first = new random(); x = first.next(0,9); random second = new random(); y = second.next(0, 9); random third = new random(); z = third.next(0, 9); int valuerandomize = int.parse(x.tostring() + y.tostring() + z.tostring()); return valuerandomize;//3 } public static int generateid() { int idnumber = 0; idnumber = dateofbirth(dateofbirth); } }
}
Comments
Post a Comment