Develop algorithmic solutions to programming problems

Assignment Help Programming Languages
Reference no: EM132364575

Introduction to Programming Assignment -

Purpose of the assessment - Assess student's ability to develop algorithmic solutions to programming problems using Python language.

Assignment Specifications -

Purpose: This assignment evaluates your understanding of basic programming principles using Python language. In particular, it assesses your ability to develop algorithms to solve simple problems, successfully run python programs, and your ability to write meaningful comments when required.

1. You may have noticed that some English words can be read both ways (from left to right or right to left). For example, Kayak, Racecar and Madam can all be read both ways. Most words however can only be read from left to right, for example, Melbourne, Python and Holmes. Write a program (name it, checkWord.py) that finds out if a given word can be read both ways. The program prompts the user to enter a word, and then either prints "Both ways" or "One way" as an output.

2. Write a program (name it, unique.py) that takes a text message as an input and prints out the same message, however with unique words only. In other words, all words repeated within the text must only appear once. You need to remove all punctuation marks from the returned message. Punctuation marks include ". , ; : ? !"

3. Three pets live in a happy house: dog, cat and a mouse. The dog often chases the cat, the cat likes to chase the mouse, however the mighty dog runs away when it sees the mouse. Develop a game (let's call it happyHouse.py) which can be played by two players. The program asks the two players (player1 and player2) to choose either 1 for dog, 2 for cat, or 3 for mouse. The rules for this game are simple:

The dog prevails over the cat.

The cat prevails over the mouse.

The mouse prevails over the dog.

So if player1 chooses a dog and player2 chooses a cat, player1 wins. If player1 chooses a dog and player2 chooses a mouse, player2 wins, and so forth. If both players choose the same pet, then the result will be draw. The players continue playing until either player hits enter without choosing a number (1, 2 or 3). Each time the game is run, the result is printed on the screen (for example, Player 1 wins or Player 2 wins).

Hint:

Define an indefinite loop which only breaks when either player enters an empty string (hits enter with no entry).

Within the loop, prompt Player 1 and Player 2 to enter 1 for dog, 2 for cat or 3 for mouse.

Based on the choices made by Player 1 and Player 2, your program prints out the appropriate message, which can either be "draw", "Player 1 wins" or "Player 2 wins".

Attachment:- Introduction to Programming Assignment File.rar

Reference no: EM132364575

Questions Cloud

Develop and apply skills in research project design : SLE761 - Research Planning And Communication - Deakin University - Research Proposal Project - Producing a good project title is a balancing act
What is jowers cost of capital : If the cost of common equity for the firm is 20.8%, the cost of preferred stock is 12.5%, and the before-tax cost of debt is 10.4%.
What is qm weighted average cost of capital : The target capital structure for QM Industries is 37% common stock, 8% preferred stock, and 54% debt. If the cost of common equity for the firm is 17.6%
What would be required of faithful follower of christianity : Discuss what would be required of a faithful follower of Christianity. How would this change depending on the denomination one follows?
Develop algorithmic solutions to programming problems : HS1031 Introduction to Programming Assignment, Holmes Institute, Australia. Develop algorithmic solutions to programming problems
What other factors that might influence your decision : What other factors that might influence your decision? Demonstrate how you would apply these criteria in a specific scenario. Do not repeat an example from.
Interest rate parity through covered interest arbitrage : List the transactions that enforce Interest Rate Parity through Covered Interest Arbitrage? Also mark the order in which these transactions will need to occur.
Discuss the importance of user technology security education : Discuss the importance of user technology security education within organizations. What topics should be included in security education and training?
Profit or loss on gretchen swiss franc call option : Calculate the profit or loss on Gretchen's Swiss franc call option at expiration as a function of the exchange rate S$/SF.

Reviews

len2364575

9/2/2019 2:15:34 AM

Submission Guidelines - There are three questions in this assignment which require you to write and submit three Python scripts. Please save each script in two different formats: .py and .txt prior to submission. For example, for the first question you need to submit checkWord.py and checkWord.txt. Combine all .py and .txt files into one zip or rar file (6 files in total). Finally, upload your compressed file (zip or rar) to Black Board and proceed with submission.

len2364575

9/2/2019 2:15:28 AM

Code must be appropriately commented. Make sure to add comments at each segment of your code to explain what it does. You may lose grades if you do not add comments. You may lose grades if you do not add comments. Make sure that your code runs successfully for all possible entries. Hint: test your code against the examples given in the question (if any). Try to approach the solution with the least number of steps. Your code must be clear, logical, and easy to understand. Your code must be written in Python 3. You get no marks if the code is written in Python 2 or any other language. All work must be submitted to Blackboard by the due date. You are encouraged to avoid last minute submissions so that you do not run into technical difficulties. You are allowed up to three attempts. All attempts must take place prior to assignment deadline. Please download the attached submission template and see the step-by-step instructions for submission.

Write a Review

Programming Languages Questions & Answers

  Get input from command line file1 & file2

Check if file1 is the same as file2, if yes, printout error message

  A slip class file with indicated methods defined

A customer Class file with indicated Methods defined - A boat Class file with indicated Methods defined and a slip Class file with indicated Methods defined.

  Two-level memory cache hierarchy

Explain how you would pipeline the four following pairs of statements.

  Prevent stack smashing within an executable program

What is pseudocode, and how does it assist in code translation? What are two methods that can be employed to prevent stack smashing within an executable program?

  Write application to compute and show parking charges

Write down the application which computes and shows parking charges for each customer who parked in garage yesterday. You must enter hours parked for each customer.

  Program to convert the currency

Display "Enter a currency value (positive number):"

  Program that uses for loop prompt user to input two integers

Write a program that uses for loop to preform the following steps: Prompt the user to input two integers: firstnum and secondnum.

  Program accept word from user and pass it to function

Your program should accept the word from user and pass it to function. Function requires to check if word is "freezing". If it is, program must alert user.

  Why is each criterion important to a program

When reviewing a program, these are the four criteria for style: Why is each criterion important to a program

  Write the function header of the default copy constructor

Write the function header of the default copy constructor for a class called A. Write one default constructor prototype of a class called A

  Program to use next character to create and return operator

Convert the string of digits into an integer. Otherwise, use the next character to create and return an operator.

  Implement the factorial function in the io monad

Use imperative-style programming to implement the factorial function in the IO monad. In other words, create and initialize variables (references) using newIORef, modify their values using a while loop with ,readIORef and writeIORef, then have th..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd