or HW 3, you should use a main() function to

or HW 3, you should use a main() function to control the program you write. You should also use other functions as appropriate (or as specified). 

  1. String Manipulation – Write a program that asks the user to enter a word or phrase and then displays the word or phrase with all occurrences of the letter “r” removed. Example: “Park the car in Harvard Yard” becomes “Pak the ca in Havad Yad.”
  2. Special Number – Write a program that can find a four-digit number that has the four digits reversed when multiplied by four. For example, rstu * 4 = utsr. The program should report the number to the user. 
  3. Check for Palindromes – Write a program that prompts the user to enter a word or phrase. Then check to see if the word is a palindrome. A palindrome reads the same forward and backward ignoring punctuation and spaces. For example, “racecar,” “Madam, I’m Adam,” and “Anna.” You can use these palindrome sentences (Links to an external site.) as a source for checking if your program works. 
  4. Calculate the Factorial – The factorial of a positive integer is the product 1 * 2 * 3 * 4 … * n where n represents the positive integer. Write a program that asks the user to enter a positive integer and calculates the factorial. Use a main() function to control the program flow. Write a function to get an integer from the user and verify the user entered a positive integer value. Write a different function to calculate the factorial for a number. 
  5. [REMOVED FROM PY HW 3 BECAUSE WE DID NOT COVER FILE I/O IN CLASS YET] Crayon Colors – The file “Colors.txt Download Colors.txt” contains the names of 123 crayon colors with one color per line. Write a program that asks the user to enter a letter of the alphabet and then displays all the colors that start with that letter. Write three separate functions: one to get the user input, one to read the colors.txt file into a list, one to build a list with the colors that start with the letter, and one to display the output. 
  6. Anagram Checker – Write a program that asks the user to enter two words or phrases. Then check to see if the words or phrases are anagrams of each other. Two words or phrases are anagrams of each other if they use the same letter with the same frequency in both phrases. Examples include night & thing, inch & chin, elbow & below, little big man & labeling mitt, another day & a hearty nod. 
  7. [REMOVED FROM PY HW 3 BECAUSE WE DID NOT COVER FILE I/O IN CLASS YET]Sorting States List – The data file “States.txt Download States.txt” contains the 50 US states in order they joined the union with one state per line. Write a program to read the file contents into a list. Then sort the list based on the number of consonants contained in the state name in ascending order. HINT: You will need to write a function to count the number of consonants in a word. 
  8. Reading Numbers – Write a program that asks the user to enter a number with 27 digits or less. The convert that number into a set of three-digit numbers and associated place values. Display the results to the user. The following table shows the output if the user entered 293452000450041006950254586. 

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

This week you will write a current day news article

 This week you will write a current day news article using the main points from a childhood fairytale. First, to understand the elements of a news article, be sure to watch the video posted under Lesson 2. Then, select the fairytale or children’s story you would like to spin into

each question half page one reference Q1 Engaged employees are

each question half page one reference Q1    Engaged employees are known to be passionate and feel a profound connection to their company. I currently work at Duly Health and Care as an Ancillary Receptionist and I believe the employee engagement within myself and my coworkers within my work group

statement of purpose, incorporate insights from Scholtes’ work on systems. Understand that all systems, including individuals and organizations,

statement of purpose, incorporate insights from Scholtes’ work on systems. Understand that all systems, including individuals and organizations, inherently have a purpose that can range from implicit to explicit, and from ineffective to highly influential. For organizations, strong strategic leadership enhances the clarity and utility of their purpose. Similarly, individuals

Write about Organisational Behavior

Organisational Behaviour Assessment 1 (worth 50% of your overall mark) Scenario You are working as a HRM manager for a large organisation and the HRM Director has asked you to prepare a recruitment and selection strategy. The strategy should be for a senior management position. In a 700 word report

Deliverable Length: 350–500 words Primary Task Response: Within the Discussion

Deliverable Length:   350–500 words Primary Task Response: Within the Discussion Board area, write up to 350–500 words that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your fellow classmates. Be substantive and clear, and use examples to reinforce

Discussion 1 – Sport Organizations Merger

 Explain the fundamental accounting differences between using the pooling of interests method versus the purchase of assets methods when dealing with the merger of two sport organizations. Please post what you view as the appropriate responses to the above prompts. You must justify your answer. Your post must have a

ONE PAGE REFLECTION – DOUBLE SPACED 1. Please read David

ONE PAGE REFLECTION — DOUBLE SPACED 1. Please read David Foster Wallace’s “Tense Present: Democracy, English, and the Wars over Usage” 2. Please complete a Synthesis Table, 1 point: Complete one Synthesis Table and let the Synthesis Paragraph be the start of the write up assigned in No. 3 below. 3.

Q1 – Napoleon destroyed much of the old order of

Q1 — Napoleon destroyed much of the old order of Europe, spreading, and embedding many of the ideas of the French Revolution. How did Napoleon expand his power? How did the old powers of Europe seek to restrain the ideas of Republicanism and Bonapartism with the Concert of Europe? Q2

When a business competes locally, it primarily needs to consider

  When a business competes locally, it primarily needs to consider the factors that affect the local community. As it expands, so do the factors for consideration. One region may respond to a product differently than another because an existing product is already in place. Have you ever traveled to

Discussion Prompt Initial Post: Describe the physiology of blood pressure

  Discussion Prompt Initial Post: Describe the physiology of blood pressure control. Causes of Primary Hypertension may include overactivity of the SNS; overactivity of the RAAS; alterations in other neurohumoral mediators of blood volume and vasomotor tone such as ANP, BNP, and adrenomedullin; inflammation; a complex interaction involving insulin resistance

PLease send me your rate and how long it will

 PLease send me your rate and how long it will take to complete. Thanks Topic 1: “Happy Accidents” in Science One of the greatest scientific developments in the past 150 years is the discovery of antibiotics. For some basic background on antibiotics, refer to the following resources: There is, however,

United Savings Bank (USB) is a large bank with branches spanning the United States. They are already collecting information on their customers in the

United Savings Bank (USB) is a large bank with branches spanning the United States. They are already collecting information on their customers in the following systems. Core Banking System Online Banking Lending System (Auto/Personal Loans) Credit Card System Mortgage Lending System Insurance Policy System Financial Investment System They are interested

Many organizations are concerned about the rising cost of employee

  Many organizations are concerned about the rising cost of employee benefits and question their value to the organization and to the employees. List and detail employee and organization benefits. In your opinion, what benefits are of greatest value to employees? Include detail on at least 2. To the organization? Why? 

Write: For this discussion, you will address the following prompts:

  Write: For this discussion, you will address the following prompts: Identify the global societal issue you have chosen to research , and explain why further research on this topic is important. Provide a clear and concise thesis statement that includes a solution to the global societal issue (see Writing

Regression analysis is a statistical tool that is used for

  Regression analysis is a statistical tool that is used for two main purposes: description and prediction.  Provide an example of an application using regression analysis for decision making in a hospital setting that involves either description or prediction. Be sure to respond to at least one of your classmates’