Develop algorithmic solutions to programming problems

Assignment Help Programming Languages
Reference no: EM132366616

Purpose of the assessment (with ULO Mapping)

Assess student's ability to develop algorithmic solutions to programming problems using Python language.

Individual 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.

For example:
If the input word is: "Kayak" The output would be: Both ways

If the input word is: "Holmes" The output would be: One way

Hint:
• Start by prompting the user for a word
• Convert the word into small letters
• Write the rest of the program

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 ". , ; : ? !"

For example:
If the input message is: "You're an insomniac, you tell yourself: there are profound truths revealed only to the insomniac by night like those phosphorescent minerals veined and glimmering in the dark but coarse and ordinary otherwise; you have to examine such minerals in the absence of light to discover their beauty, you tell yourself."

The output message would be: "you're an insomniac you tell yourself there are profound truths revealed only to the by night like those phosphorescent minerals veined and glimmering in dark but coarse ordinary otherwise have examine such absence of light discover their beauty"

Hint:
• Use the message in the example as a test case. Store it in a variable called text.
• You will need to convert the message into small case letters, and remove punctuation marks.
• Your final output must be similar to the output in the example above.

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".

Reference no: EM132366616

Questions Cloud

What do you hope to gain by researching the topic : Explore the background and significance. What do you hope to gain by researching this topic? Analyze the relationship between research and evidence-based.
Professionalism-work ethic : Mae has a keen ability to form meaningful relationships with coworkers. People confide in her and feel that she really listens and understands them.
How to find the info of the intra group transaction : For the intra group transaction presentation which parts should included and how to find the info of the intra group transaction from the company annal report?
Describe the national healthcare issue : Describe the national healthcare issue/stressor you selected and its impact on your organization. Use organizational data to quantify the impact.
Develop algorithmic solutions to programming problems : HS1031 - Introduction to Programming - Develop algorithmic solutions to programming problems using Python language - write meaningful comments when required
Journalize the adjusting entry required at january 31 : Journalize the adjusting entry required at January 31, the end of the first month of the current fiscal year, to record the accrued product warranty.
Reflect on the results of the five categorical strengths : Reflect on the results of the five categorical strengths from your CliftonStrengths assessment, including what those results might indicate
Distribution-inequality of wealth and income : The gap between rich and poor people (the distribution/inequality of wealth and income) in America and globally; and its impact on US management with future
Calculate the amounts omitted in lines : Calculate the amounts omitted in lines. Journalize the entry to record the payroll accrual. Journalize the entry to record the payment of the payroll.

Reviews

len2366616

9/5/2019 10:41:47 PM

Question Marking criteria Marks Question 1 Appropriate commenting 2 Sound logic 2 Code running successfully 2 Total 6 Question 2 Appropriate commenting 2 Sound logic 2 Code running successfully 2 Total 6 Question 3 Appropriate commenting 2 Sound logic 3 Code running successfully 3 Total 8 Total Marks 20

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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