Why are the passwords not created as per the demand

I am making a program of password manager whose source code is mentioned below

Whenever I am providing the input to the program I should get the outputs in the form of combinations of letters, numbers and symbols of the same size. But what I am receiving is not what I demand of.
THE OUTPUT I EXPECT

no. of suggestions: 2
no. of characters: 15
!@##$addDas187)
@#&:"543%2*Gjf
(if suggestions is 2)

THE OUTPUT I RECEIVE

no. of suggestions: 2
no. of characters: 14
%2DDavf23*&__-=
@#3223

Therefore, I would like to know what can I do in order to resolve this issue.
Every suggestion will be appreciated.
THANK YOU