Форум программистов, компьютерный форум, киберфорум
Python
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.60/25: Рейтинг темы: голосов - 25, средняя оценка - 4.60
0 / 0 / 0
Регистрация: 30.03.2014
Сообщений: 3

ЗАДАЧИ Python

31.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 di erence. 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 de ned and implemented the Student File Reader ADT for
extracting student records from an external source. We can de ne 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
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
31.03.2014, 00:04
Ответы с готовыми решениями:

Задачи python
Нужна помощь в решении задач в python, их всего 2.

Задачи по Python
Здравствуйте уважаемые коллеги,меня зовут Михаил,начинаю изучать Python буду рад общению и взаимопомощи по данной теме.В этой теме я хотел...

Задачи на Python
del Помогите разбирающиеся в Python'е, Python совсем не понимаю, препод аспирант, а я допереть не могу. Добавлено через 4 часа 12...

2
Эксперт Python
 Аватар для dondublon
4652 / 2072 / 366
Регистрация: 17.03.2012
Сообщений: 10,182
Записей в блоге: 6
31.03.2014, 09:13
Шпаргалка для вас:
Как запостить тему, чтобы не получить ответ

П. 6 и 10.
0
31.03.2014, 11:08
 Комментарий модератора 
Poseydon, правила форума:
5.16. "Запрещено создавать темы с множеством вопросов во всех разделах, кроме разделов платных услуг. Один вопрос - одна тема."
Создайте отдельные темы для каждой задачи, снабдив каждую информативным заголовком!

Закрыто!
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
31.03.2014, 11:08
Помогаю со студенческими работами здесь

Предложите задачи для python
Хочу улучшить свои знания в python. Уровень примерно "на два шага дальше, чем начинающий, но ещё не любитель". Хотел бы получить...

Нужны задачи для Python
Нужны задачи, которые можно решить с помощью языка Python. Требования к задачам: 1) они должны быть интересными 2) ответ можно было...

не могу разобраться в решении задачи Python
Доброго времени суток... Только начал изучать Пайтон, как на втором уроке поставили задачу.. Помогите разобраться.. всем спасибо за ответы....

Подходит ли Python под мои задачи и требования? Плюсы и минусы!
Здравствуйте. Уже очень много времени, я выбираю язык программирования для изучения и использования. Я понял, что точно сказать мне никто...

Формулировка задачи по заданному python-cod. Что делает программа?
def pol(): u1=random() u2=random() v1=2*u1-1 v2=2*u2-1 s=v1**2+v2**2 if s>= 1: ...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Закрытая тема Создать тему
Новые блоги и статьи
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. Пошагово создадим проект для загрузки изображения. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru