|
0 / 0 / 0
Регистрация: 30.03.2014
Сообщений: 3
|
|
ЗАДАЧИ Python31.03.2014, 00:04. Показов 4949. Ответов 2
Метки нет (Все метки)
ВОТ ССЫЛКА НА КНИГУ В КОТОРОМ ЭТИ ЗАДАНИЯ (EXERCISES №1.1 ....1.4) AND (PROGRAMMING PROJECTS 1.1....1.7), А НИЖЕ САМИ ЗАДАНИЯ ИЗ ТОЙ КНИГИ, НУЖНА ПОМОЩЬ ПОТОМУ ЧТО НЕ УСПЕВАЮ ИЗУЧАЯ ПАРАЛЛЕЛЬНО С++, А СДАВАТЬ НУЖНО В ТЕЧЕНИИ НЕДЕЛИ
https://www.google.ru/url?sa=t... aWVdkO2jCg 1.1 Complete the partial implementation of the Date class by implementing the remaining methods: monthName(), isLeapYear(), numDays(), advanceBy(),and isValidGregorian(). The isValidGregorian() method should determine if the three components of the given Gregorian date are valid. 1.2 Add additional operations to the Date class: (a) dayOfWeekName(): returns a string containing the name of the day. (b) dayOfYear(): returns an integer indicating the day of the year. For ex- ample, the rst day of February is day 32 of the year. (c) isWeekday(): determines if the date is a weekday. (d) isEquinox(): determines if the date is the spring or autumn equinox. (e) isSolstice(): determines if the date is the summer or winter solstice. (f) asGregorian(divchar = '/'): similar to the str() method but uses the optional argument divchar as the dividing character between the three components of the Gregorian date. 1.3 Implement a function named printCalendar() that accepts a Date object and prints a calendar for the month of the given date. For example, if the Date object passed to the function contained the date 11/5/2007, the function should print November 2007 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1.4 Modify the Date() constructor to make each of the three arguments optional, with an initial value of zero. When no argument is supplied to the constructor, the object should be initialized to the current date. Hint: You will need to use Python's date() function from the time.py module. Programming Projects 1.1 A click counter is a small hand-held device that contains a push button and a count display. To increment the counter, the button is pushed and the new count shows in the display. Clicker counters also contain a button that can be pressed to reset the counter to zero. Design and implement the Counter ADT that functions as a hand-held clicker. 1.2 A Grab Bag ADT is similar to the Bag ADT with one dierence. A grab bag does not have a remove() operation, but in place of it has a grabItem() operation, which allows for the random removal of an item from the bag. Implement the Grab Bag ADT. 1.3 A Counting Bag ADT is just like the Bag ADT but includes the numOf(item) operation, which returns the number of occurrences of the given item in the bag. Implement the Counting Bag ADT and defend your selection of data structure. 1.4 The use of the Student File Reader ADT makes it easy to extract student records from a text le no matter the format used to store the data. Implement a new version of the ADT to extract the data from a text le in which each record is stored on a separate line and the individual elds are separated by commas. For example, the following illustrates the format of a sample le containing three student records: 10015, John, Smith, 2, 3.01 10334, Jane, Roberts, 4, 3.81 10208, Patrick, Green, 1, 3.95 1.5 In the chapter, we dened and implemented the Student File Reader ADT for extracting student records from an external source. We can dene and use a similar ADT for output. (a) Design a Student File Writer ADT that can be used to display, or store to an output device, student records contained in a StudentRecord object. (b) Provide an implementation of your ADT to output the records by display- ing them to the terminal in a neatly formatted fashion. (c) Provide an implementation of your ADT to output the records to a text le using the same format described in the text. (d) Design and implement a complete program that extracts student records from a text le, sorts them by either student id or student name, and displays them to the terminal using your ADT. The choice of sort keys should be extracted from the user. 1.6 We can use a Time ADT to represent the time of day, for any 24-hour period, as the number of seconds that have elapsed since midnight. Given the following list of operations, implement the Time ADT. Time( hours, minutes, seconds ): Creates a new Time instance and ini- tializes it with the given time. hour(): Returns the hour part of the time. minutes(): Returns the minutes part of the time. seconds(): Returns the seconds part of the time. numSeconds( otherTime ): Returns the number of seconds as a positive integer between this time and the otherTime. isAM(): Determines if this time is ante meridiem or before midday (at or before 12 o'clock noon). isPM(): Determines if this time is post meridiem or after midday (after 12 o'clock noon). comparable ( otherTime ): Compares this time to the otherTime to de- termine their logical ordering. This comparison can be done using any of the Python logical operators. toString (): Returns a string representing the time in the 12-hour format hh:mm:ss. Invoked by calling Python's str() constructor. 1.7 Design and implement a TimeDate ADT that can be used to represent both a date and time as a single entity.
0
|
|
| 31.03.2014, 00:04 | |
|
Ответы с готовыми решениями:
2
Задачи python
|
|
|
|
| 31.03.2014, 09:13 | |
|
0
|
|
| 31.03.2014, 11:08 | ||||||||
0
|
||||||||
| 31.03.2014, 11:08 | |
|
Помогаю со студенческими работами здесь
3
Нужны задачи для Python не могу разобраться в решении задачи Python Подходит ли Python под мои задачи и требования? Плюсы и минусы! Формулировка задачи по заданному python-cod. Что делает программа? Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |
|
Новые блоги и статьи
|
|||
|
SDL3 для Web (WebAssembly): Реализация движения на Box2D v3 - трение и коллизии с повёрнутыми стенами
8Observer8 20.02.2026
Содержание блога
Box2D позволяет легко создать главного героя, который не проходит сквозь стены и перемещается с заданным трением о препятствия, которые можно располагать под углом, как верхнее. . .
|
Конвертировать закладки radiotray-ng в m3u-плейлист
damix 19.02.2026
Это можно сделать скриптом для PowerShell. Использование
. \СonvertRadiotrayToM3U. ps1 <path_to_bookmarks. json>
Рядом с файлом bookmarks. json появится файл bookmarks. m3u с результатом.
# Check if. . .
|
Семь CDC на одном интерфейсе: 5 U[S]ARTов, 1 CAN и 1 SSI
Eddy_Em 18.02.2026
Постепенно допиливаю свою "многоинтерфейсную плату". Выглядит вот так:
https:/ / www. cyberforum. ru/ blog_attachment. php?attachmentid=11617&stc=1&d=1771445347
Основана на STM32F303RBT6.
На борту пять. . .
|
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
|
|
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу,
и светлой Луне.
В мире
покоя нет
и люди
не могут жить в тишине.
А жить им немного лет.
|
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила»
«Время-Деньги»
«Деньги -Пуля»
|
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога
Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
|
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога
Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
|