C# BASICS
T r a in i n g As s ig n m en t s
Document Code 25e-BM/HR/HDCV/FSOFT
Version 1.1
Effective Date 20/11/2012
Hanoi, 06/2019
Lab Guides C# Basics Issue/Revision: x/y
RECORD OF CHANGES
No Effective Date Change Description Reason Reviewer Approver
1. 01/Oct/2018 Create new Draft
2. 01/Jun/2019 Update template Fsoft DieuNT1
template
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 2/6
Lab Guides C# Basics Issue/Revision: x/y
Contents
Assignment 3: DateTime....................................................................................................................4
Objectives:....................................................................................................................................4
Business needs:...........................................................................................................................4
Prerequisites:................................................................................................................................4
Technologies:...............................................................................................................................4
IO:...................................................................................................................................................4
Technical Requirements:.............................................................................................................4
1. Exercise 1: Caculate datetime values.....................................................................................5
2. Exercise 2: Convert Datetime..................................................................................................6
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 3/6
Lab Guides C# Basics Issue/Revision: x/y
CODE: NPL.M.A003
TYPE: MEDIUM
LOC:
DURATION: 180 MINUTES
Assignment 3: DateTime
Objectives:
» Understand and practice DateTime of C#.
» Use formats DateTime and Convert DateTime
Business needs:
» TBD
Prerequisites:
» Working environment: Visual Studio 2022 or higher.
» Practice code in Visual Studio
» Each exercise is one project inside 1 solution.
Technologies:
The product implements one or more technology:
» DateTime data type
IO:
» Console windows
Technical Requirements:
» Solution name must be NPL.M.A003.
» Must create projects corresponding to each exercise:
NPL.M.A003.Exercise1.
NPL.M.A003.Exercise2.
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/6
Lab Guides C# Basics Issue/Revision: x/y
1. Exercise 1: Caculate datetime values
Function Requirement:
A system A allows employees to submit payment invoices, to post to the browser manager. Every time the
employee submits the invoice, a record of the invoice is created in the database. To remind you to manage
the invoice approval, the system has the following reminder and operation functions:
- If the record has been submitted 7 days earlier, but has not approved the record, send a reminder
notice for the first time.
- If prompted for the first time, but the manager has not approved then after 2 days, reminded the
second time.
- If the second reminder, but the manager still hasn't approved, then send a reminder email every 3
days, 4 times, 5 times.
- Only send up to 5 reminders.
Software requirements:
Write the console application to make the request as follows:
Input: Allows users to enter 1 day in the format: date / month / year.
Output: Print all dates that will send a reminder notice:
Example: Enter date is 08/01/2019, Print out the day:
1st reminder: 15/01/2019
2nd reminder: 17/01/2019
3rd reminder: 18/01/2019
4th reminder: 19/01/2019
5th reminder: 20/01/2019
Technical requirements:
- Write on console application, comply with Fsoft coding conventions
- Check input data according to date / month / year format. Display format error if entered incorrectly
Expand the problem:
In case of day, only working days (from Monday to Friday, excluding Saturday and Sunday). That is, after 7
working days, send a reminder notice for the first time ...
Example: Enter date is 08/01/2019, Print out the day:
1st reminder: 17/01/2019
2nd reminder: 21/01/2019
3rd reminder: 22/01/2019
4th reminder: 23/01/2019
5th reminder: 24/01/2019
Estimated time: 90 mins
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 5/6
Lab Guides C# Basics Issue/Revision: x/y
2. Exercise 2: Convert Datetime
Function Requirement:
Input data is a multi-line piece of text, each line is an information about creating and editing records:
Example:
“Created at 28/02/2018 10:15:35 AM by Andy.
Updated at 03/03/2018 02:45:10 PM by Mark
Clear name at 02/03/2018 11:34:05 AM by Andy”
Include information:
Include informationThe update time is one of the formats: dd / MM / yyyy or dd / MM / yyyy hh: mm: ss tt or dd /
MMM / yyyy
Lines are not saved in the correct order in time. Therefore, it is necessary to standardize by, rearranging the
lines in the right order of increasing time.
Software requirements:
Students write the console application to make the request as follows:
Input: Allows the user to enter multiple lines of text, press Ctrl + Enter to finish typing.
Output: Standardize by, rearranging lines in the right order of increasing time.
Technical requirements:
- write on console application console application, comply with Fsoft coding conventions
Estimated time: 90 mins
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 6/6