Электронный журнал старосты

Заказать уникальную курсовую работу
Тип работы: Курсовая работа
Предмет: Программирование
  • 47 47 страниц
  • 11 + 11 источников
  • Добавлена 18.06.2024
1 496 руб.
  • Содержание
  • Часть работы
  • Список литературы
Введение 4
1 Техническое задание 6
1.1 Назначение разработки 6
1.2 Требования к программе 6
2 Создание приложения 8
2.1 Выбор средств реализации 8
2.2 Проектирование структур данных 9
2.2 Проектирование приложения 10
2.4 Создание приложения 16
4 Руководство пользователя 18
5 Тестирование 21
Заключение 24
Список использованных источников 25
Приложение 1 26

Фрагмент для ознакомления

dat"); } catch (Exception^ e) { MessageBox::Show("Не могу открыть файл БД"); return; } sw->WriteLine(stud->Count); // Список студентов for each (dbStudent^ p in stud) sw->WriteLine("{0};{1};{2}",p->Surn, p->Name, p->Midl); sw->WriteLine(subj->Count); // Список предметов for each (dbSubject^ p in subj) sw->WriteLine("{0}",p->Title); sw->WriteLine(rate->Count); // Баллы for each (dbRateStore^ p in rate) p->Save(sw); sw->Close(); }};}ФайлRateForm.h#pragma once#include "dbData.h"namespace Journal { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; ///

/// Summary for RateForm /// public ref class RateForm : public System::Windows::Forms::Form { public:RateForm(dbRateStore^ rate) {InitializeComponent(); // //TODO: Add the constructor code here // bsRate->DataSource = rate->Rate; } protected: /// /// Clean up any resources being used. /// ~RateForm() { if (components) { delete components; } } private: System::Windows::Forms::TableLayoutPanel^ rateLayout; protected: private: System::Windows::Forms::Label^ lblAvg; private: System::Windows::Forms::Button^ btnBack; private: System::Windows::Forms::DataGridView^ gridRate; private: System::Windows::Forms::BindingSource^ bsRate; private: System::Windows::Forms::DataGridViewTextBoxColumn^ colDate; private: System::Windows::Forms::DataGridViewTextBoxColumn^ colRate; private: System::Windows::Forms::Button^ btnAdd; private: System::ComponentModel::IContainer^ components; private: /// /// Required designer variable. /// #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->components = (gcnew System::ComponentModel::Container()); this->rateLayout = (gcnew System::Windows::Forms::TableLayoutPanel()); this->lblAvg = (gcnew System::Windows::Forms::Label()); this->btnBack = (gcnew System::Windows::Forms::Button()); this->gridRate = (gcnew System::Windows::Forms::DataGridView()); this->colDate = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->colRate = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->bsRate = (gcnew System::Windows::Forms::BindingSource(this->components)); this->btnAdd = (gcnew System::Windows::Forms::Button()); this->rateLayout->SuspendLayout(); (cli::safe_cast(this->gridRate))->BeginInit(); (cli::safe_cast(this->bsRate))->BeginInit(); this->SuspendLayout(); // // rateLayout // this->rateLayout->ColumnCount = 3; this->rateLayout->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, 50))); this->rateLayout->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, 50))); this->rateLayout->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute, 101))); this->rateLayout->Controls->Add(this->lblAvg, 1, 2); this->rateLayout->Controls->Add(this->btnBack, 2, 2); this->rateLayout->Controls->Add(this->gridRate, 0, 0); this->rateLayout->Controls->Add(this->btnAdd, 0, 2); this->rateLayout->Dock = System::Windows::Forms::DockStyle::Fill; this->rateLayout->Location = System::Drawing::Point(0, 0); this->rateLayout->Name = L"rateLayout"; this->rateLayout->RowCount = 3; this->rateLayout->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50))); this->rateLayout->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50))); this->rateLayout->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Absolute, 29))); this->rateLayout->Size = System::Drawing::Size(543, 316); this->rateLayout->TabIndex = 0; // // lblAvg // this->lblAvg->AutoSize = true; this->lblAvg->Dock = System::Windows::Forms::DockStyle::Fill; this->lblAvg->Location = System::Drawing::Point(226, 291); this->lblAvg->Margin = System::Windows::Forms::Padding(5); this->lblAvg->Name = L"lblAvg"; this->lblAvg->Size = System::Drawing::Size(211, 20); this->lblAvg->TabIndex = 0; this->lblAvg->Text = L"Средний бал"; // // btnBack // this->btnBack->Dock = System::Windows::Forms::DockStyle::Fill; this->btnBack->Location = System::Drawing::Point(445, 289); this->btnBack->Name = L"btnBack"; this->btnBack->Size = System::Drawing::Size(95, 24); this->btnBack->TabIndex = 1; this->btnBack->Text = L"Назад"; this->btnBack->UseVisualStyleBackColor = true; this->btnBack->Click += gcnew System::EventHandler(this, &RateForm::btnBack_Click); // // gridRate // this->gridRate->AllowUserToAddRows = false; this->gridRate->AllowUserToDeleteRows = false; this->gridRate->AutoGenerateColumns = false; this->gridRate->AutoSizeColumnsMode = System::Windows::Forms::DataGridViewAutoSizeColumnsMode::Fill; this->gridRate->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize; this->gridRate->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(2) { this->colDate, this->colRate }); this->rateLayout->SetColumnSpan(this->gridRate, 3); this->gridRate->DataSource = this->bsRate; this->gridRate->Dock = System::Windows::Forms::DockStyle::Fill; this->gridRate->Location = System::Drawing::Point(3, 3); this->gridRate->Name = L"gridRate"; this->gridRate->RowHeadersVisible = false; this->rateLayout->SetRowSpan(this->gridRate, 2); this->gridRate->Size = System::Drawing::Size(537, 280); this->gridRate->TabIndex = 2; this->gridRate->CellEndEdit += gcnew System::Windows::Forms::DataGridViewCellEventHandler(this, &RateForm::gridRate_CellEndEdit); // // colDate // this->colDate->DataPropertyName = L"Date"; this->colDate->HeaderText = L"Дата"; this->colDate->Name = L"colDate"; // // colRate // this->colRate->DataPropertyName = L"Rate"; this->colRate->HeaderText = L"Бал"; this->colRate->Name = L"colRate"; // // btnAdd // this->btnAdd->Location = System::Drawing::Point(3, 289); this->btnAdd->Name = L"btnAdd"; this->btnAdd->Size = System::Drawing::Size(75, 23); this->btnAdd->TabIndex = 3; this->btnAdd->Text = L"Добавить"; this->btnAdd->UseVisualStyleBackColor = true; this->btnAdd->Click += gcnew System::EventHandler(this, &RateForm::btnAdd_Click); // // RateForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(543, 316); this->Controls->Add(this->rateLayout); this->Name = L"RateForm"; this->Text = L"Баллы"; this->Load += gcnew System::EventHandler(this, &RateForm::RateForm_Load); this->rateLayout->ResumeLayout(false); this->rateLayout->PerformLayout(); (cli::safe_cast(this->gridRate))->EndInit(); (cli::safe_cast(this->bsRate))->EndInit(); this->ResumeLayout(false); }#pragma endregion private: void Average() { List^ rate = (List^)(bsRate->DataSource); float sum=0; for each(dbRate^ p in rate) sum += p->Rate; lblAvg->Text = (sum / rate->Count).ToString("0.00"); } private: System::Void RateForm_Load(System::Object^ sender, System::EventArgs^ e) {Average(); } private: System::Void btnAdd_Click(System::Object^ sender, System::EventArgs^ e) { bsRate->Add(gcnew dbRate(DateTime::Now, 5));Average(); } private: System::Void btnBack_Click(System::Object^ sender, System::EventArgs^ e) {Close(); } private: System::Void gridRate_CellEndEdit(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {Average(); }};}ФайлdbData.h#pragma onceusing namespace System;using namespace System::IO;using namespace System::Collections::Generic;using namespaceSystem::Diagnostics;// Описание предметаpublic ref class dbSubject{private: String ^title;// Наименованиеpublic: // КонструкторdbSubject(String^ _title) { title = _title; } // Свойства property String^ Title { String^ get() { return title; }; void set(String^ val) { title = val; } };};// Описание студентаpublic ref class dbStudent{private: String^ surn; // Фамилия String^ name; // Имя String^ midl; // Отчествоpublic: // КонструкторdbStudent(String^ _surn, String^ _name, String^ _midl) { surn = _surn; name = _name; midl = _midl; } // Свойства property String^ Surn { String^ get() { return surn; }; void set(String^ val) { surn = val; } }; property String^ Name { String^ get() { return name; }; void set(String^ val) { name = val; } }; property String^ Midl { String^ get() { return midl; }; void set(String^ val) { midl = val; } };};// Оценкаpublic ref class dbRate{private: DateTime date;// Дата int rate; // Оценкаpublic: // КонструкторdbRate(DateTime _date,int _rate) { date = _date; rate = _rate; } // Свойства property DateTime Date { DateTime get() { return date; }; void set(DateTime val) { date = val; } }; property int Rate { int get() { return rate; }; void set(int val) { rate = val; } };};public ref class dbRateStore{private: intnStud;// Номер студентаintnSubj;// Номер предметаList^ rate; // Оценкиpublic: // КонструкторыdbRateStore(int stud,int subj) { rate = gcnew List(); nStud = stud; nSubj = subj; }dbRateStore(StreamReader^ sr); // Свойства property List^ Rate { List^ get() { return rate; } }; // Для поиска bool Is(int stud, int subj) { return nStud == stud && nSubj == subj; } // Добавление оценки void addRate(dbRate^ mark) { rate->Add(mark); } // Сохранениевфайлvoid Save(StreamWriter^ sw);};ФайлdbData.cpp#include "dbData.h"// КонструкторсзагрузкойзаписирейтингаdbRateStore::dbRateStore(StreamReader^ sr){ array^ sa = sr->ReadLine()->Trim()->Split(';'); rate = gcnew List(); nStud = Convert::ToInt32(sa[0]); nSubj = Convert::ToInt32(sa[1]); int cnt = Convert::ToInt32(sa[2]); for (int i = 0; i < cnt; i++) {sa = sr->ReadLine()->Trim()->Split(';');rate->Add(gcnew dbRate(Convert::ToDateTime(sa[0]),Convert::ToInt32(sa[1]))); }}// Сохранение записи рейтингаvoid dbRateStore::Save(StreamWriter^ sw){sw->WriteLine("{0};{1};{2}", nStud, nSubj, rate->Count);for each(dbRate^ p in rate)sw->WriteLine("{0};{1}", p->Date, p->Rate);}

1. Староста группы в университете. Обязанности и привилегии. [Электронный ресурс]. URL: https://times.bntu.by/news/5589
2. Язык программирования C++. [Электронный ресурс] URL: https://metanit.com/cpp/tutorial/1.1.php
3. Объектно-ориентированное программирование. [Электронный ресурс] URL: https://prog-cpp.ru/oop/
4. Знакомство с Visual Studio. [Электронный ресурс] URL: https://learn.microsoft.com/ru-ru/visualstudio/get-started/visual-studio-ide?view=vs-2022
5. Возвращение к C++ — современный C++. [Электронный ресурс]. URL: https://learn.microsoft.com/ru-ru/cpp/cpp/welcome-back-to-cpp-modern-cpp?view=msvc-170
6. Национальная рабочая группа по стандартизации С++. [Электронный ресурс]. URL: https://stdcpp.ru/
7. Руководство по классическим приложениям (Windows Forms .NET). [Электронный ресурс]. URL: https://learn.microsoft.com/ru-ru/dotnet/desktop/winforms/overview/?view=netdesktop-8.0
8. Особенности работы CLR в .NET Framework [Электронный ресурс]. URL: https://habr.com/ru/post/90426
9. Событийно-управляемое программирование. [Электронный ресурс]. URL: https://studfile.net/preview/9457758/page:2/
10. Особенности моделирования предметной области с помощью ООП. [Электронный ресурс] URL: https://habr.com/ru/post/249165/
11. Тест-кейс: задачи, правила создания. [Электронный ресурс]. URL: https://gb.ru/blog/test-kejs/