Pearson eText for Starting out with Visual C# -- Instant Access (Pearson+)
5th Edition
ISBN: 9780137502783
Author: Tony Gaddis
Publisher: PEARSON+
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 5AW
Program Plan Intro
DateTime object:
- The DateTime object is used to store both data and time.
- Initially, the date and time values are stored in the following properties:
- Month
- An integer in the range of 1 to 12.
- Day
- An integer in the range of 1 to 31.
- Year
- An integer in the range of 1 to 9999.
- Hour
- An integer in the range of 0 to 23.
- Minute
- An integer in the range of 0 to 59.
- Second
- An integer in the range of 0 to 59.
- Millisecond
- An integer in the range of 0 to 999.
- Month
- The statement used to create a DateTime instance named dt without initializing it is shown below:
//Create a DateTime object
DateTime dt = new DateTime();
- The properties such as Hour, Minute, Second, and Millisecond are set to the default value of 0, which is midnight.
TimeSpan object:
- The TimeSpan object is used for creating objects, which store data regarding an amount of time, like six days or 15 hours.
- Initially, a TimeSpan object stores time values in the following properties:
- Days
- An integer, positive or negative.
- Hours
- An integer in the range of -23 to 23.
- Minutes
- An integer in the range of -59 to 59.
- Seconds
- An integer in the range of -59 to 59.
- Milliseconds
- An integer in the range of -999 to 999.
- Days
- The statement used to create a TimeSpan object named tspan is shown below:
//Create a TimeSpan object
TimeSpan tspan = new TimeSpan();
- The above given statement creates a TimeSpan object named as tspan. It is set to the default value of 0 days, 0 hours, 0 minutes, 0 seconds, and 0 milliseconds.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Pearson eText for Starting out with Visual C# -- Instant Access (Pearson+)
Ch. 9.2 - Prob. 9.1CPCh. 9.2 - Prob. 9.2CPCh. 9.2 - Prob. 9.3CPCh. 9.2 - Prob. 9.4CPCh. 9.2 - Prob. 9.5CPCh. 9.2 - Prob. 9.6CPCh. 9.2 - Prob. 9.7CPCh. 9.2 - Prob. 9.8CPCh. 9.3 - Prob. 9.9CPCh. 9.3 - Prob. 9.10CP
Ch. 9.3 - Prob. 9.11CPCh. 9.3 - Prob. 9.12CPCh. 9.3 - Prob. 9.13CPCh. 9.3 - Prob. 9.14CPCh. 9.3 - Prob. 9.15CPCh. 9.3 - Prob. 9.16CPCh. 9.4 - Prob. 9.17CPCh. 9.4 - Prob. 9.18CPCh. 9.4 - Prob. 9.19CPCh. 9.5 - Prob. 9.20CPCh. 9.5 - Prob. 9.21CPCh. 9.5 - Prob. 9.22CPCh. 9.5 - Prob. 9.23CPCh. 9.5 - Prob. 9.24CPCh. 9 - Prob. 1MCCh. 9 - Prob. 2MCCh. 9 - Prob. 3MCCh. 9 - Prob. 4MCCh. 9 - Prob. 5MCCh. 9 - Prob. 6MCCh. 9 - Prob. 7MCCh. 9 - Prob. 8MCCh. 9 - Prob. 9MCCh. 9 - Prob. 10MCCh. 9 - Prob. 11MCCh. 9 - Prob. 12MCCh. 9 - Prob. 13MCCh. 9 - Prob. 14MCCh. 9 - Prob. 1TFCh. 9 - Prob. 2TFCh. 9 - Prob. 3TFCh. 9 - Prob. 4TFCh. 9 - Prob. 5TFCh. 9 - Prob. 6TFCh. 9 - Prob. 7TFCh. 9 - Prob. 8TFCh. 9 - Prob. 9TFCh. 9 - Prob. 10TFCh. 9 - Prob. 11TFCh. 9 - Prob. 12TFCh. 9 - Prob. 13TFCh. 9 - Prob. 1SACh. 9 - Prob. 2SACh. 9 - Prob. 3SACh. 9 - Prob. 4SACh. 9 - Prob. 5SACh. 9 - Prob. 6SACh. 9 - Prob. 7SACh. 9 - Prob. 1AWCh. 9 - Prob. 2AWCh. 9 - Prob. 3AWCh. 9 - Prob. 4AWCh. 9 - Prob. 5AWCh. 9 - Prob. 6AWCh. 9 - Prob. 7AWCh. 9 - Prob. 8AWCh. 9 - Prob. 9AWCh. 9 - WEATHER DATA In the student sample progr4n files...Ch. 9 - Prob. 2PPCh. 9 - Prob. 3PPCh. 9 - Prob. 4PPCh. 9 - Prob. 5PPCh. 9 - COURSE INFORMATION Write a program that creates a...Ch. 9 - Prob. 7PPCh. 9 - Prob. 8PPCh. 9 - Prob. 9PPCh. 9 - Prob. 10PPCh. 9 - Prob. 11PPCh. 9 - Prob. 12PP
Knowledge Booster
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education