Started By
Message

re: C# Help. I always have dumb face on.

Posted on 2/4/15 at 3:36 pm to
Posted by Doldil
The Ham
Member since Jan 2010
6214 posts
Posted on 2/4/15 at 3:36 pm to
quote:

I need some help with C#.


not to be that guy...but could you give an example as to what it is you need help with. Is it the basics...such as setting your variables, or is it a certain type of coding issue...say if/then statements or do loops or...?

maybe give an example as to a problem you have to do and what is throwing you for a loop.
Posted by Hu_Flung_Pu
Central, LA
Member since Jan 2013
22234 posts
Posted on 2/4/15 at 3:38 pm to
1. Implement a console application that does the following: Prompt and read in two DateTime values from the user. Calculate and output a) if the first date is before the second or not; b) the difference in hours between the two dates, and c) if the second date falls in a leap year.

2. Write a console program for the following (you can add this to the same program as above if desired). Prompt the user to enter a value.
• If it is a date, write it in long date format (ex.: February 11, 2015).
• If it is numeric, write it twice (on the same line), once as a currency value, and the second in “9,990.000” style format.

3. Write a form application that does all the following (have a separate button for each on the form):
a. Given a number of days N that a user specifies in a textbox, calculate and output to a label the date N days from the current date (in short date format). N can be negative, but must be numeric. Validate user input is numeric before attempting the calculation.
b. Without using the C# date functions, write the number of days in a month to a label given a user specified month and year. In addition to the basic rule of "30 days hath September, April, June, and November; All the rest have thirty-one except February (which has 28)", there are the rules concerning leap years (which adds an extra day):
A year is a leap year if it is divisible by 4
EXCEPT when the year is a centennial
UNLESS it is also divisible by 400.
Also write the result from the C# DateTime .IsLeapYear() function to a separate label.


I was eventually able to do 1 and 2 but needed some help. 3b is where I am stuck. Teacher wants us to do cases.
first pageprev pagePage 1 of 1Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram