Learn creating a library of reusable modules and defining classes
⦁ Close all your open projects by right click on a project > Close Project.
⦁ Create a Python project named FirstName-LastName-HW3 (e.g., Jane-Doe-HW3) with a src folder. (How? See the HW1 instructions).
⦁ Add a new package named lib to the src folder. Note that a Python package must contain an init .py module.
⦁ Add a module named geometry to the package lib.
⦁ Note 1: When you add a module that will contain one or more class definitions, you might want to pick the Module: Class option from the list of module templates. But it is not recommended the template follows the Python 2 style.
⦁ Note 2: In Python a module name should consist of only lowercase letters and underscores. However, class names in a module should begin with a capital letter. You may find that many built-in classes do not follow this convention. These are holdovers from earlier stages of Python when there was a much bigger difference between user- defined classes and built-in classes.
⦁ Define a class named Triangle in the geometry module as follows:
⦁ Define an instance constructor that initializes three instance variables, say, side1, side2, and side3.
⦁ Define a method named isTriangular.
⦁ It returns True if the values of the instance variables that are taken as arguments could be the sides of a triangle (i.e., none of them is greater than or equal to the sum of the other two), and False otherwise. Note that True and False are reserved keywords of Python. They are not string values but are Boolean ones.
⦁ Your implementation of this method must include nested if and return statements only.
⦁ Test the class by adding a tester snippet to the module.
⦁ The output is shown below. Note that you need two instance of the class Triangle to print this output. Note: When possible, use variable references to construct output.
⦁ Add a module named algebra to the package lib.
⦁ Define a class named Max in the algebra module as follows:
⦁ Do not define a constructor.
⦁ Define a method named max3 that takes three int or float arguments and returns the largest one.
⦁ Define a method named max5 that takes five int or float arguments and returns the largest one. This method must utilize the method max3.
⦁ Test the class by adding a tester snippet to the module.
⦁ The output is shown below. Note that you need just one instance of the class Max to print this output. Note: When possible, use variable references to construct output.
⦁ Add a new package named hw3p1 to the src folder. Note that a Python package must contain an init .py module.
⦁ Add a module named myapp to the package hw3p1.
⦁ This module is going to reuse the modules in the lib package. Such a module is known as a launcher or main module. When you add a launcher module like myapp, you might want to pick the Module: Main option from the list of module templates to auto-add the if name__ == '__main ': that should be included in every main module. Note that you need to code a complete tester snippet by adding a main method to this myapp module. Recall that the name of a main method can be any valid name.
⦁ Import the Triangle and Max classes from the lib package created above and call the methods of the classes to print the combined output shown below. Your output must match exactly, including a blank line between the output from each class.
Learn the built-in random module, random.randrange(), input(), int(), while loop, if…elif…else, and try: except ValueError:. Also learn importing a module with the keyword import only.
⦁ Add a new module named gamemd to the package lib.
⦁ Write code right in the module (no functions or classes) so that, when it is run by a launcher or main module, it prints output similar to the one shown below. Hints: Declare a variable ceiling and use it to generate a random integer, such as secret = random.randrange(1, ceiling+1).
⦁ Add a package named hw3p2 to the src folder and add a launcher module named myapp2.
⦁ Import the gamemd to the myapp2 module from the lib package by using only the keyword import (no from).
⦁ Run the imported module.
Learn how to wrap global code into a class by converting the module of the Problem2 to a class. Also learn importing a module with the keywords import and from.
⦁ Add a new module named gamecs to the package lib.
⦁ Define a class named Game in the module with an instance constructor and a method.
⦁ The instance constructor init is used to instantiate the Game class with a value for the ceiling variable.
⦁ The method named play lets the user play the game. Don't forget to add a tester snippet to test this class.
⦁ Add a package named hw3p3 to the src folder and add a launcher module named myapp3.
⦁ Import the gamecs module to the myapp3 module from the lib package by using only the keywords import and from.
⦁ Add a tester snippet to myapp3 and write code to run the gamecs module. Try with 30, 50, and 100 for the ceiling.
Problem #4 (5 points): Learn creating a class, for and while loop, logical operator, and string concatenation
⦁ Consider the code below. You are required to implement similar functionalities using a class. Please try this code first before you implement a class.
⦁ Add a new module named highroller to the package lib and define a class named HighRoller as follows. You are supposed to write code based on the code above to replicate the output given below. Note that the wager, number of loops, win rate, and average number of bets will vary depending on the user input. The example output below shows the results of three runs.
⦁ Don't forget to add a tester snippet to test this class.
⦁ Add a package named hw3p4 to the src folder and add a launcher module named myapp4.
⦁ Import the highroller module to the myapp4 module from the lib package in your preferred way.
⦁ Add a tester snippet to myapp4 and write code to run the highroller module.
⦁ Start Eclipse
⦁ Open your project to export
⦁ Right click on the project name and select Export. (See the image below)
⦁ Expand General and choose Archive File and then click Next
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme