Code Monkey home page Code Monkey logo

final's Introduction

final

This repo contains solution of final exam in SDwP

angle.py

This file contain solution of task 1 from exam. You can test it with main_task1_task2.py.

More details:

This class works with coordinates of some object. User can write degrees, minutes and direction and class method print_angle() will print it beautifully.

obj.py

This file contain solution of task 2 from exam. You can test it with main_task1_task2.py. More details: This class creates objects and gibe

main_task2_task2.py

This file is created to test angle.py and obj.py

Here is the example of usage:

Input: 
45
45
W
Output:
0°0' W # this is autimatically created Class Object
45°45.0' W # this is coordinates with your parameters

Input:
181
43
E
Output:
Incorrect input #because you coordinates must be from 0 to 180 degrees

Input:
170
54
R
Output:
Incorrect direction #because direction must be W, E, N or S
#repeat it for 2 times

As a minus, you have to do it 5 times, before you get access to the second task results. Be careful, this program doesn't check if minutes are less than 60.

After repeating previous steps there will be output:

Output:
My number is 21 with time of creation 2021-10-07 15:55:40.247668
My number is 34 with time of creation 2021-10-07 15:55:40.249080
My number is 55 with time of creation 2021-10-07 15:55:40.250080

It's result of creating and printing of 3 objects with different labels and time of its creation

sheep.py

This is the solution of 3 task. It works with location of ships and numbers of existing ships. You can test it in main_task_3.py. Requirements: obj.py, angle.py, sys More details: Sheep - is a class that store the name of ship, it's capacity, location and its unique label. It also print all information and doesn't allow user to create more than certain number of ships.

main_task_3.py

This file was created to test sheep.py

Input:

Output:
My location is 56°67' E
My name is Maria
 My capacity is 32
My number is 21 with time of creation 2021-10-07 18:43:51.189100
My location is 13°54' N
My name is Mary
 My capacity is 54
My number is 34 with time of creation 2021-10-07 18:43:51.191095
My location is 12°35' S
My name is Friend
 My capacity is 45
My number is 55 with time of creation 2021-10-07 18:43:51.191095
Too many sheeps in the ocean
Only 3 ships are allowed in the ocean #this messages occurs while trying create 4th ship.

final's People

Contributors

guzelsafiullina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.