Lecture
Tasks 1-8 are for 1 subgroup, tasks 9-16 for the second group. Assignments marked with an asterisk are more difficult and recommended for students applying for a high grade in a subject.
Write a program for the election. Voters must first register with the system. The administrator fills out a list of candidates. Each member (on the network) or from the same computer logs in and votes. Voting data is accumulated in the database. You cannot vote twice. At the end of the voting period, the administrator starts the counting procedure and the system issues the result.
Basic algorithms
Подведение итогов выборов.
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для создания голосования.
Интерфейс для голосования.
Интерфейс для проверки результатов голосования.
Tables in the database:
Выборы (наименование, сроки и т.д.)
Кандидаты
Пользователи
Client server model
Предусмотреть голосование по сети
Write a program for drawing up the optimal pizza delivery route. Users wishing to order a pizza, leave a request in the system, indicating the area of their residence. In addition, the system constantly accumulates information about how to travel between neighboring areas of the city. When an order arrives, the program must find a shortcut from the current location of the pizza trailer to the customer’s area of residence.
Basic algorithms
Нахождение кратчайшего маршрута.
Recommended class diagram
Interfaces:
Интерфейс для создания «карты» (на самом деле это просто граф) города.
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для заполнения заявки.
Интерфейс для обработки результатов.
Tables in the database:
Пользователи
Карта города (районы и связи между ними)
Client server model
Предусмотреть возможность делать заказ и уточнять карту города по сети
Write a program for receiving bets and calculating winnings at the races. Users registered in the system can bet any amount on one of the seven horses. Previously, the system administrator makes a list of horses. According to the results of arrival (it can be modeled on the basis of random numbers) should be calculated the amount of winnings.
It is desirable that the system can handle several types of bets (which horse will come first, which horse will come last, etc.).
Basic algorithms
Моделирование результатов забега на основе случайных чисел (метод generateResults())
Подсчет и распределение суммы выигрыша (метод calculateMoney())
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для описания забега.
Интерфейс для приема ставок.
Интерфейс для подсчета суммы выигрыша.
Tables in the database:
Лошади
Ставки
Пользователи
Client server model
Предусмотреть возможность делать ставки по сети
Write a program for the distribution of vacancies. Users (employees and employers) are registered in the system, after which they can apply. You can offer a job (specifying the requirements for the employee, salary and other parameters), or look for a job (indicate the desired position, salary, etc.). After accumulating a sufficient number of applications, the system proceeds to their distribution in order to maximally take into account the wishes of users and returns the result in the form of employee-employer pairs.
Basic algorithms
Распределение заявок
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для регистрации заявки.
Интерфейс для распределения заявок.
Tables in the database:
Текущие заявки
Пользователи
Client server model
Предусмотреть подачу заявок по сети
Write a program to automatically schedule classes. Users registered in the system (teachers) make applications (indicate the number of the student group, the name of the subject and the number of classes per week). The administrator indicates the number of free audiences (and other parameters if necessary). Having accumulated all the applications, the system should make a schedule. It is desirable that the schedule be as high-quality as possible (lack of “holes” in students and teachers, uniform workload).
Basic algorithms
Автоматическое составление расписания
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей (преподавателей).
Интерфейс администратора (для указания числа аудиторий и др.)
Интерфейс для приема заявок.
Интерфейс для составления расписания.
Tables in the database:
Пользователи
Заявки
Информация об университете (число аудиторий и др.)
Client server model
Предусмотреть возможность делать заявки по сети
Write a program for testing. The administrator should be able to add questions to the program (indicating the answer options and noting the correct one). Users are tested by answering these questions and getting an estimate as a percentage of correct answers.
It is desirable that the program allows you to switch between tests. Those. the administrator may be able to create new tests and, when adding a question, indicate which test he belongs to, and the user can select the desired test from the list.
Basic algorithms
Вычисление результата тестирования
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для добавления вопросов (и тестов).
Интерфейс для прохождения тестирования.
Tables in the database:
Вопросы
Пользователи (и результаты их тестирования)
Client server model
Предусмотреть возможность тестирования по сети
It is necessary to develop an exclusive program for leaders of countries intending to organize a summit. Each leader can offer several options for the time and venue. The meeting place is a country (can be entered manually or selected from a list of previously entered countries), the time is set by a combination of month + from which day + to which day. The system summarizes the results by identifying possible options for the time and venue suitable for all leaders of countries. If there are no such options, leaders of the countries can continue to add their options.
Basic algorithms
Нахождение возможностей для проведения саммита.
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для добавления варианта проведения саммита.
Интерфейс для определения результатов.
Tables in the database:
Пользователи.
Варианты мест и дат проведения саммита.
Client server model
Варианты можно указывать по сети.
Write a program to play sea battle. Users register in the system and indicate the location of their ships. Then users take turns trying to “get” into the enemy ships (by entering the coordinates in the text field or pointing the cell on the map with the mouse, which is preferable). In the simplified version, two users can play and after each move the program ends the “session” of communication with the current user and asks for the next password.
In a more advanced version, the program can support a simultaneous game session with several users (in this case, you must specify whose ships should be bombarded).
In the network version of the game, you can make it possible for the game not to be interrupted after each turn, but simply blocked while waiting for the opponent's move.
Basic algorithms
Проверка попадания по кораблю и проверка окончания игры.
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации и расстановки кораблей.
Интерфейс для выстрела.
Tables in the database:
Игроки
Позиции кораблей и «прострелянных» точек каждого игрока.
Client server model
Игра по сети
Write a program for the remote exam. The teacher prepares a list of questions for the exam, indicating the correct answer for each of them. Students take the exam by answering five questions randomly selected by the system and receive an assessment.
It is advisable to make it so that several teachers can use the system. The student after registration must choose a subject. If the exam is already passed, it will not be in this list.
Basic algorithms
Проверка ответов и проставление оценки
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации студентов.
Интерфейс для добавления вопросов.
Интерфейс для сдачи экзамена.
Tables in the database:
Вопросы
Студенты (и их оценки)
Client server model
Студент отвечает на вопросы по сети.
Write a program for motorists, tracking traffic jams on the roads and offering the least loaded path between two points. Motorists can use this program to report traffic jams on the way from one point of the city to the next (these points may be adjacent areas of the city). Each traffic jam receives a load rating on a ten-point system. The program also, upon request for two points, finds a route on which the total duration of standing in traffic jams is minimal (we ignore the difference in distance between different adjacent areas).
Basic algorithms
Поиск пути сквозь пробки
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для сообщения о пробке (или ее отсутствии).
Интерфейс для запроса.
Интерфейс для отображения составленного маршрута.
Tables in the database:
Пользователи
Районы (точки)
Связи между районами (с указанием загруженности)
Client server model
Предусмотреть возможность делать запросы и сообщать о пробках по сети
Write a program for the competition. The program should distribute the grant fund of the competition among the participants, depending on the expert evaluations of each participant. At the same time, the amount allocated to each participant cannot be less than a certain minimum value (participants who “earned” below the minimum drop out of the competition). Applications from the participants have already received expert marks. The procedure for determining the results of the competition is started by the administrator (after the deadline for accepting applications).
Basic algorithms
Определение результатов конкурса
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для заполнения параметров конкурса (общий фонд и минимальная сумма).
Интерфейс для подачи заявки.
Интерфейс для расчета результатов.
Tables in the database:
Пользователи
Параметры конкурса
Заявки
Client server model
Предусмотреть возможность делать заявки по сети
Write a program for the bidding. Participants are registered in the system and submit applications for the sale and purchase of goods (in addition to the name and price of the product, additional parameters such as quality may be indicated). At the end of the day, the system (at the command of the administrator) compares the bids and issues the bidding results, trying to satisfy the needs of the participants to the maximum. Applications that are not satisfied are postponed the next day.
Basic algorithms
Расчет результатов торгов (на основе некоторого критерия оптимальности)
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации участников.
Интерфейс для добавления заявок.
Интерфейс для вывода результатов.
Tables in the database:
Участники торгов
Заявки
Client server model
Предусмотреть возможность подачи заявок по сети
It is necessary to develop a program to coordinate the group of project participants. Project participants need to set a time and place for the meeting. Each participant registers in the system and indicates his opportunities (a list of intervals and places where he can meet). The system summarizes the results by defining possible time and venue options suitable for all participants.
The possible meeting time should be set by the combination of the day of the week + from what hour + to what hour. The meeting place is selected from a list that is filled in advance.
Basic algorithms
Определение вариантов места встречи.
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для указания всех возможных мест встречи.
Интерфейс для добавления возможностей.
Интерфейс для расчета результатов.
Tables in the database:
Пользователи
Места встречи
Возможности
Client server model
Возможности можно указывать по сети.
Write a program for optimal distribution of production capacity. The production department receives orders for the manufacture of products. Each order requires a certain amount of resources. Let time of use of the equipment acts as resources. For simplicity, suppose that the list of necessary equipment and time is contained in the order itself, and the list is ordered according to the technological operations of the order (i.e. it matters in what order this equipment will be provided). The program should develop a priority for the provision of equipment in order to minimize the total time to complete the entire batch of orders.
Basic algorithms
Разработка очередности предоставления оборудования
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс для указания перечня оборудования.
Интерфейс для приема заказов.
Интерфейс для составления плана загрузки оборудования.
Tables in the database:
Пользователи
Заказы
Оборудование
Client server model
Предусмотреть возможность делать заказы по сети
Develop a system for the formation of a concert program on requests. Users (fans) are registered in the system and select songs from the list provided (or add their own). Each user can select any number of songs. When the time for submission of applications ends, a concert program is formed, including the songs that have collected the largest number of applications (the number of songs is determined in advance).
Basic algorithms
Составление программы концерта по заявкам
Recommended class diagram
Interfaces:
Интерфейс для входа в систему.
Интерфейс для регистрации пользователей.
Интерфейс администратора (указание основных параметров концерта: название, цена билетов, место проведения, из которых нас интересует только число песен).
Интерфейс для добавления песни в список
Интерфейс для подачи заявок.
Интерфейс для вывода результатов (программа концерта)
Tables in the database:
Голоса
Пользователи
Client server model
Предусмотреть голосование по сети
Write a program for playing checkers. Users are registered in the system and go in turn. The current batch can be paused and then resumed. In an advanced version of the system, several batches can be supported simultaneously.
Basic algorithms
Проверка допустимости сделанного хода.
Проверка окончания игры
Recommended class diagram
Interfaces:
Интерфейс для регистрации игроков.
Интерфейс входа в систему.
Интерфейс для начала и загрузки (выбора) партии.
Интерфейс для очередного хода.
Интерфейс для объявления результатов партии.
Tables in the database:
Игроки.
Партии.
Позиции шашек.
Client server model
Игра по сети
Practical classes in Java are designed for pair work. Students can study the manual, parse the examples given in it and do the exercises together. Each task is designed for two. In doing so, students should, if possible, share work to speed up the process. For example, a part of classes is programmed by one student, and a part by another (at another computer). When the report should be noted the contribution to the program of each of the developers.
Tasks are offered in the simplest formulation (with the expectation of an average student). Strong students applying for an “excellent” grade are encouraged to refine the condition of their task, bringing it closer to the more in-demand functionality (if necessary, creating your own class diagram and database schema).
Recommendations for improving the functionality of the program:
1. The classes required for building the user interface are absent in the proposed diagrams. Also there are no all the details regarding the client-server organization of the program. These classes should be developed independently at the appropriate stage of work on the program. In general, the proposed diagrams are not dogma and can be improved (or altered altogether).
2. In each program there are two types of users: administrator and clients.It is assumed that the administrator in the program is one. It should be added immediately after the first launch of the program.
Comments
To leave a comment
OOP and Practical JAVA
Terms: OOP and Practical JAVA