https://archive.is/inv77

https://anonymousfiles.io/fE8l1Ebd/


viewimage.php?id=2ab4c42ef0d0&no=24b0d769e1d32ca73cec81fa11d02831ce3cef1b9542c00ceb084720fba3823a75e872cdd9f8473bc34da1d95d3eb2fd853eb58ac47eb53ad536eaa5793af851b0


https://drive.google.com/file/d/1l8KXkKSW_O2qaZa_hlb8Dm-piJsxdwwJ/view?usp=sharing

C#인데 정말 급한일이라서 이렇게 올려봅니다

부탁좀 드리겠습니다 ㅠㅠㅠ


(3페이지 부터 번역본입니다.)
Using the supplied working example and the Visual Studio project please complete the following:
(I’ve added a TODO comment where your code is required)
1. (3 marks) Using the sequential text file (Salutations.dat) load each line of the file as a new item into the
salutationCombo object.
2. (3 marks) Using the binary encoded file (EmployeeTypes.dat) load each object of the file as a new item into the
typeList object.
3. (4 marks) Construct and display a preview string when changes are made to any employee field
The format must be as follows:
field1: the salutation and name in a left justified field with a width of 50.
if there is a comma display it as first last
field2: format the SIN as a left justified field with a width of 12
field3: format the employee type left justified with a field width of 14
field4: format the startingRate as currency, right justified with a width of 10.
Display this string the previewLabel object.
4. (2 marks) Create the method formIsComplete. Return a TRUE value when the user has entered the required info; if
any of the required information is not met return FALSE
The required info is defined as:
a non-blank salutation
a non-blank name
an employeeType is selected
5. (4 marks) Create a new Employee object using the default constructor. Use the form data to update the employee
fields (salutation, name, SIN, type, rate) and add this object to the employeeList component.
6. (3 marks) Update the “Save Employees” event to store all employees to a binary encoded file (Employees.dat)
7. (3 marks) Update the “Export Employees” event to create a colon delimited text file (Employees.csv).
The file should have a line for each employee and these lines should have all fields separated by colons.
8. (5 marks) Update the Employee class to include:
a. A default constructor to set employeeNumber using the static class field named nextEmployeeNumber.
This will be used as a unique number for each employee
b. A ToString method; the returned string’s format should be:
i. employeeNumber: right justified width of 3
ii. Salutation: left justified width of 5
iii. Name: left justified width of 30
iv. SIN: left justified width of 9
v. Type: left justified width of 14
vi. HourlyRate: right justified currency width of 7
9. (3 marks) Update the EmployeeType class to include:
a. A ToString method; the returned string’s format should be:
i. Type: left justified width of 14
ii. StartingRate: right justified currency width of 7
Once you are finished, please make sure your complete project folder with source files (*.cs) are
uploaded to Canvas as a zipped file. 
1. salutationCombo 오브젝트에 Salutations.dat 파일의 각 행을 새로운 아이템으로 불러오십시오.

2. typeList 오브젝트에 이진코딩파일 (EmployeeTypes.dat) 의 각 행을 새로운 아이템으로 불러 오십시오.

3. employee 필드의 변화를 미리보기 할 수있는 스트링을 구성하십시오.
형식은 다음과 같습니다
필드 1: 칭호와 이름을 왼쪽에 넓이 50으로 정렬된 필드에 나타나게 하십시오
이름 중간에 쉼표가 있다면 First name 과 Last name으로 구분하여 나타나게 하십시오
필드 2: 넓이 12의 SIN(Social Insurance Number, 주민번호) 필드를 구성하십시오.
필드 3: 넓이 14의 employee type 필드를 구성하십시오.
필드 4: 넓이 10의 startingRate 화폐(Currency)타입의 필드를 구성하십시오.
이 스트링을 previewLabel 오브젝트로 나타나게 하십시오.

4. formIsComplete 메소드를 작성하십시오. 작성자가 필요한 정보를 기입하였다면 true를 리턴, 만약 필요하지 않은 정보라면 false을 리턴 하십시오.
필요한 정보는 다음과 같습니다:
1. 공백이 없는 인사
2. 공백이 없는 이름
3. 직군 (사용자가 employeeType중 하나를 select 한 경우)

5. 기본 구성자를 이용하여 Employee 오브젝트를 구성하십시오. 이 폼을 이용하여 employee 의 정보를 수정합니다. (칭호, 이름, SIN, 직군, 급여) 이 정보들은 employeeList 오브젝트의 구성요소에 추가 됩니다.

6. employees.dat 이진법 파일에 모든 데이터를 저장하는 “Save Employees” 이벤트를 구성하십시오.

7. “Export Employees” 이벤트를 구성하여 콜론 (:) 으로 분리된 텍스트 파일 (Employees.csv)을 생성하게 하십시오. 이 텍스트 파일은 한명의 직원을 위한 하나의 행이 존재해야 하며, 각 정보 (필드)들은 콜론 (:)으로 분리되어 있어야 합니다.

8. Employee 클래스를 다음을 포함하게 수정하십시오:
a. nextEmployeeNumber의 정적인 클래스 필드를 이용하여 기본 구성자로 만든 employeeNumber를 구성하십시오.
상기 필드는 각 직원을 위한 직원 번호로 사용 될 것입니다.
b. ToString 메소드; 리턴되는 스트링의 형식은 다음과 같아야 합니다:
i. employeeNumber: 오른쪽으로 정렬, 넓이 3
ii. salutation: 왼쪽으로 정렬, 넓이 5
iii. Name: 왼쪽으로 정렬, 넓이 30
iv. SIN: 왼쪽으로 정렬, 넓이 9
v. Type: 왼쪽으로 정렬, 넓이 14
vi. HourlyRate: 오른쪽으로 정렬, 넓이 7

9. EmployeeType 클래스를 다음을 포함시키게 수정하십시오:
a. ToString 메소드; 리턴되는 스트링의 형식은 다음과 같아야 합니다:
i. Type: 왼쪽으로 정렬, 넓이 14
ii. StartingRate: 오른쪽으로 정렬, 넓이 7

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CS_Exam
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

// load up predefined data
LoadSalutation();
LoadEmployeeTypes();

// create a default EmployeeType just in case define types are missing
if (typeList.Items.Count < 1)
{
typeList.Items.Add(new EmployeeType("", 0));
}
}

private void LoadSalutation()
{
// TODO
// using the sequential text file (Salutations.dat)
// load each line of the file as a new item in the salutationCombo object


}

private void LoadEmployeeTypes()
{
// TODO
// using the binary encoded file (EmployeeTypes.dat)
// load each object of the file as a new item in the typeList object


}

private void employeeInfoChanged(object sender, EventArgs e)
{
// TODO
// construct and display a preview string when changes are made to any employee field
// the format must be as follows:
// field1: the salutation and name in a left justified field with a width of 50
// if there is a comma display it as first last
// field2: format the SIN as a leftjustified field with a width of 12
// field3: format the employee type left justified with a field width of 14
// field4: format the startingRate as currency with a width of 10
// display these in the previewLabel object.

}

private void addButton_Click(object sender, EventArgs e)
{
if (formIsComplete())
{
// TODO
// Create a new Employee object using the default constructor
// use the form data to update the employee fields (salutation, name, SIN, type, hourlyRate)
// add this object to the employeeList component.




salutationCombo.SelectedIndex = -1;
nameBox.Text = "";
sinBox.Text = "";
typeList.ClearSelected();
}
else
{
MessageBox.Show("The data is not yet complete");
}
}


// TODO
// Complete the method formIsComplete
// Return a TRUE value when the user has entered the required info
// required info is defined as:
// a non-blank salutation
// a non-blank name
// a employeeType is selected
//
// a SIN is not required
// if any of the required information is not met return FALSE
private bool formIsComplete()
{
return false;
}


private void saveButton_Click(object sender, EventArgs e)
{
// TODO
// Save all employees to a binary encoded file (Employees.dat)

}

private void exportButton_Click(object sender, EventArgs e)
{
// TODO
// Export all employees to a colon delimited text file (Employees.csv).
// one line for each employee
// each line should have all fields separated by colons


}
}


public class Employee
{
private static int nextEmployeeNumber = 0;
private readonly int employeeNumber;

public string Salutation { get; set; }
public string Name { get; set; }
public int SIN { get; set; }
public string Type { get; set; }
public double HourlyRate { get; set; }

// TODO
// Create default constructor that assigns employeeNumber using nextEmployeeNumber
// each employee should have a unique employeeNumber



// TODO
// Create ToString method
// employeeNumber: right justified width of 3
// Salutation: left justified width of 5
// Name: left justified width of 30
// SIN: right justified width of 9
// Type: left justified width of 14
// HourlyRate: right justified currency width of 7


}


public class EmployeeType
{
public string Type { get; set; }
public double StartingRate { get; set; }

public EmployeeType(string type, double rate)
{
Type = type;
StartingRate = rate;
}


// TODO
// Create ToString method
// Type: left justified width of 14
// StartingRate: right justified currency width of 7



}
}

viewimage.php?id=2ab4c42ef0d0&no=24b0d769e1d32ca73cec81fa11d02831ce3cef1b9542c00ceb084720fba3823a75e872cdd9f8473bc34da1d95a3ab3fce177fd5263a44b717a9b92095f47459df1

소유자: 기세진