- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
re: C# Help. I always have dumb face on.
Posted on 2/4/15 at 3:36 pm to Hu_Flung_Pu
Posted on 2/4/15 at 3:36 pm to Hu_Flung_Pu
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 on 2/4/15 at 3:38 pm to Doldil
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.
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.
Popular
Back to top
![logo](https://images.tigerdroppings.com/images/layout/TDIcon.jpg)