TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Freddy Abreu
NA
40
9.4k
Problem with PADLEFT
Apr 3 2013 10:29 AM
Hi everyone , first thank you for reading this, I'm very rookie to develop in C#, and I'm trying to develop an app for university (just for practice), well it's not finished yet, But I have a Problem with the "Padleft", take a look please I need Help. Sorry for the code I'm really very rookie here you are.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
namespace
Payment
{
class
Program
{
public
struct
University
{
public
string
StudentName;
public
DateTime InscriptionDate;
public
DateTime EndDate;
public
decimal
Payment;
//public string Signatures;
public
int
StudentID;
}
public
static
void
Main
(
string
[] args)
{
int
TotalData =
5
;
int
Capacity =
0
;
University[] Regedit =
new
University[TotalData];
string
PleaseSelect;
Console.
WriteLine
(
"Wellcome to the university!:"
);
Console.
WriteLine
();
Console.
Write
(
"\nSelect the option:"
);
Console.
WriteLine
(
"\n1-Create a new student:"
);
Console.
WriteLine
(
"2-Search for Student payment"
);
Console.
WriteLine
(
"3-No paid"
);
PleaseSelect = Console.
ReadLine
();
switch
(PleaseSelect)
{
case
"1"
:
if
(Capacity < TotalData)
{
Console.
WriteLine
(
"First data:"
, Capacity +
1
);
Console.
WriteLine
(
"Write the name of the student please!"
);
Regedit[Capacity].StudentName = Console.
ReadLine
();
Console.
WriteLine
(
"Student' ID"
);
Regedit[Capacity].StudentID = Convert.
ToInt32
(Console.
ReadLine
());
/*Console.WriteLine("Selection of signatures");
Regedit[Capacity].Signatures = Console.WriteLine();*/
string
[] Signatures =
new
string
[
5
];
string
Selections;
int
i;
for
(i =
0
; i<=
4
; i++)
{
Console.
WriteLine
(
"Start your selection:{0}"
,i+
1
);
Signatures[i] = Console.
ReadLine
();
}
Selections =
string
.Empty;
for
(i =
0
; i <=
4
; i++)
Selections += Signatures[i];
Console.
WriteLine
(
"Your selection:{0}"
,Selections.
PadLeft
(Signatures[i]));
Console.
WriteLine
(
"Payment"
);
Regedit[Capacity].Payment = Convert.
ToDecimal
(Console.
ReadLine
());
if
(Regedit[Capacity].Payment !=
50
) {
Console.
WriteLine
(
"No Enough for the quarter"
);
}
else
Console.
WriteLine
(
"You payment is good have a good luck!:"
);
}
break
;
default
:
break
;
}
Console.
Write
(
"Press any key to continue . . . "
);
Console.
ReadKey
(
true
);
}
}
}
Reply
Answers (
6
)
how to display another dropdown on select item frm differnet
Data type mismatch in criteria expression.