Answered You can hire a professional tutor to get the answer.

QUESTION

it's visual studio homework.

it's visual studio homework. please help

Summary

work with the String and DateTime data types and perform operations on them.

Learning Objectives

  1. Reinforce the concept of converting strings to numbers and convert numbers back to strings,
  2. Work with various String methods, designed to manipulate the contents of a string,
  3. Perform operations with the DateTime and TimeSpan data types,

Exercises

Begin by creating a new project named LastName_FirstNameExercise3, replacing LastName_FirstName with your last name and first name. It is imperative that you name the project correctly. Points will be deducted if the project is not correctly named or property copied to the file server in the correct folder. The following questions are not related. For each question create the necessary code to complete the task. Please try to organize the user interface so that your answer to each question is visually separated and clearly marked.

You must enable strict type checking for this assignment. 

  1. Declare module-level variables as follows: Declare a String named MyName and initialize the value to your first name followed by your last name. Declare a DateTimevariable named MyBirthDate and initialize the value to 1/1/1985. Do not use your actual birth date for privacy reasons. Declare a DateTime variable named CurrentDateand initialize the value to the current date (System.DateTime.Today) Declare a Stringvariable LongStringDate. Initialize the variable to store the current date converted to a long date string. Declare all of the above variables as private module-level variables. Display these values in output labels. Create the labels as necessary and name them as appropriate. Do not use names like Label1, Label2 and so on.
  2. Create a multi-line TextBox named txtInput. Create two Button control instances named btnUpper and btnLower. In the Click event handler for the respective buttons, write the code to make all of the text in the TextBox upper case or lower case, respectively. Create a button named btnClean that will remove any leading and trailing spaces from the text in the text box. 
  3. Create a Button control instance named btnAddDate. In the Button's Click event handler, write the statement to to get the current date. Then, add 30 days to the current date. Display the result in a Label named lblDateFuture. Display only the date. Do not display the time. Create a prompt to describe the output, as necessary.
  4. Many types of credit cards have the same format. This format is XXXX-XXXX-XXXX-XXXX, where X is a digit. Create a Button named btnParseCredit and a TextBox named txtCreditCard. The dashes are embedded into the string containing the card number. Write the statements to extract each four-digit segment into String variables named Part1, Part2, Part3, and Part4. Display the results in Label control instances named lblPart1 through lblPart4.
  5. Create a Button control instance named btnDates. Declare two variables named StartingDate and EndingDate having a data type of DateTime. Initialize the starting date to your birth date. Again, don't use your real birth date. Initialize the ending date to the current date. Write the statements that will display, in other Label controls, the number of elapsed days, hours, minutes, and seconds between the two dates. Use the TimeSpan structure to store the interval.
  6. Create a Button control instance named btnDateCharacteristics and two Labelsnamed lblDaylight and lblLeap. Get the current date from the system. Now determine whether daylight savings time is enabled for this date. Determine whether this date is a leap year.
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question