Questions
Hi there, please write code in Python 3 and show what input you used for the...

Hi there, please write code in Python 3 and show what input you used for the program. I've been stuck on this for hours!

(1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. (1 pt)

Ex:

Enter a sample text:
we'll continue our quest in space.  there will be more shuttle flights and more shuttle crews and,  yes;  more volunteers, more civilians,  more teachers in space.  nothing ends here;  our hopes and our journeys continue!

You entered: we'll continue our quest in space.  there will be more shuttle flights and more shuttle crews and,  yes;  more volunteers, more civilians,  more teachers in space.  nothing ends here;  our hopes and our journeys continue!


(2) Implement a print_menu() function, which has a string as a parameter, outputs a menu of user options for analyzing/editing the string, and returns the user's entered menu option and the sample text string (which can be edited inside the print_menu() function). Each option is represented by a single character.

If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement the Quit menu option before implementing other options. Call print_menu() in the main section of your code. Continue to call print_menu() until the user enters q to Quit. (3 pts)

Ex:

MENU
c - Number of non-whitespace characters
w - Number of words
f - Fix capitalization
r - Replace punctuation
s - Shorten spaces
q - Quit

Choose an option:


(3) Implement the get_num_of_non_WS_characters() function. get_num_of_non_WS_characters() has a string parameter and returns the number of characters in the string, excluding all whitespace. Call get_num_of_non_WS_characters() in the print_menu() function. (4 pts)

Ex:

Number of non-whitespace characters: 181


(4) Implement the get_num_of_words() function. get_num_of_words() has a string parameter and returns the number of words in the string. Hint: Words end when a space is reached except for the last word in a sentence. Call get_num_of_words() in the print_menu() function. (3 pts)

Ex:

Number of words: 35


(5) Implement the fix_capitalization() function. fix_capitalization() has a string parameter and returns an updated string, where lowercase letters at the beginning of sentences are replaced with uppercase letters. fix_capitalization() also returns the number of letters that have been capitalized. Call fix_capitalization() in the print_menu() function, and then output the the edited string followed by the number of letters capitalized. Hint 1: Look up and use Python functions .islower() and .upper() to complete this task. Hint 2: Create an empty string and use string concatenation to make edits to the string. (3 pts)

Ex:

Number of letters capitalized: 3
Edited text: We'll continue our quest in space.  There will be more shuttle flights and more shuttle crews and,  yes;  more volunteers, more civilians,  more teachers in space.  Nothing ends here;  our hopes and our journeys continue!


(6) Implement the replace_punctuation() function. replace_punctuation() has a string parameter and two keyword argument parameters exclamation_count and semicolon_count. replace_punctuation() updates the string by replacing each exclamation point (!) character with a period (.) and each semicolon (;) character with a comma (,). replace_punctuation() also counts the number of times each character is replaced and outputs those counts. Lastly, replace_punctuation() returns the updated string. Call replace_punctuation() in the print_menu() function, and then output the edited string. (3 pts)

Ex:

Punctuation replaced
exclamation_count: 1
semicolon_count: 2
Edited text: we'll continue our quest in space.  there will be more shuttle flights and more shuttle crews and,  yes,  more volunteers, more civilians,  more teachers in space.  nothing ends here,  our hopes and our journeys continue.


(7) Implement the shorten_space() function. shorten_space() has a string parameter and updates the string by replacing all sequences of 2 or more spaces with a single space. shorten_space() returns the string. Call shorten_space() in the print_menu() function, and then output the edited string. Hint: Look up and use Python function .isspace(). (3 pt)

Ex:

Edited text: we'll continue our quest in space. there will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. nothing ends here; our hopes and our journeys continue!

In: Computer Science

Write a program in Python where you can swap only two consecutive elements. You have to...

Write a program in Python where you can swap only two consecutive elements. You have to show all steps to convert a string into another string (both strings will be anagrams of each other). E.g. GUM to MUG GUM GMU MGU MUG

In: Computer Science

explain oxides of sulphur,nitrogen oxides,nitric oxide,carbon monoxide,hydro carbons in details with examples.50marks Note:Its for 50 marks...

explain oxides of sulphur,nitrogen oxides,nitric oxide,carbon monoxide,hydro carbons in details with examples.50marks

Note:Its for 50 marks i need 10page answer and own answer no internet answer r else i will downvote

attempt only if you knownledge about the subject r else i il downvote and its for 50marks

NOTE:Its already there in chegg and its wrong answer .i need own answer with diagram and all r else i il downvote.

In: Computer Science

You are developing a software package for an online shopping site that requires users to enter...

You are developing a software package for an online shopping site that requires users to enter their own passwords. Your software requires that users' passwords meet the following criteria:

● The password should be at least six characters long.
● The password should contain at least one uppercase and at least one
lowercase letter.
● The password should have at least one digit.

Write a method that verifies that a password meets the stated criteria. Use this method in a program that allows the user to enter a password and then determines whether or not it is a valid password. If it is valid, have the program print "Valid Password". Otherwise, it should print "Invalid Password".

Sample Run
java PasswordVerifier

Enter·password·to·be·verified:ComputerScience4Life↵
Valid·password

In: Computer Science

What is the actual purpose of the Address Resolution Protocol? Specifically, what identifier does it connect...

What is the actual purpose of the Address Resolution Protocol? Specifically, what identifier does it connect with which other identifier?

In: Computer Science

(IN PYTHON) Write a program that asks the user repeatedly to enter a student's score or...

(IN PYTHON)

Write a program that asks the user repeatedly to enter a student's score or enter -1 to stop. When finished entering all the scores, the program should display the number of scores entered, the sum of the scores, the mean, the lowest and the highest score.

(IN PYTHON)

In: Computer Science

Write a program in Python to print all possible combinations of phone numbers. The length of...

Write a program in Python to print all possible combinations of phone numbers. The length of the number will be given. Also 3 digits will be given, which can not be used. No two consecutive digits can be same. A number containing 4 would always have 4 in the beginning.

In: Computer Science

What is an subprogram or subroutine and how is it defined? What is a subprogram: Call?...

What is an subprogram or subroutine and how is it defined?

What is a subprogram: Call? Header? Protocol? Signature?

What are formal and actual parameters for a subprogram?

How does a programming language match formal and actual parameters?

In: Computer Science

Q1. Write a Java program to do sequential search to find element 55 in array 10,20,35,45,55,65,75,85....

Q1. Write a Java program to do sequential search to find element 55 in array 10,20,35,45,55,65,75,85.

                                                                                                                                                                  

Q2.Write a Java program to find element 54 in array 45,41,65,53,76,90 using Binary Search. (Hint: Binary search is applied to sorted array elements)

Q4.   Write a java program to create array list subject

       - add English, Maths, Science to the list

       - add Computers at index 2

       - display first occurrence index of Maths

       - traverse the list using for each loop.

              

Q5. Write a java program to create an ArrayList of user-defined class forobjects (Employee): for id,name,age. The employee data are as follows for creating class objects.

1101    Aamna 25

1111    Amjad   30

In: Computer Science

Program in Java Create a stack class to store integers and implement following methods: 1- void...

Program in Java

Create a stack class to store integers and implement following methods:

1- void push(int num): This method will push an integer to the top of the stack.

2- int pop(): This method will return the value stored in the top of the stack. If the stack is empty this method will return -1.

3- void display(): This method will display all numbers in the stack from top to bottom (First item displayed will be the top value).

4- Boolean isEmpty(): This method will check the stack and if it is empty, this will return true, otherwise false.

In: Computer Science

An emergency change was made to an IT system as a result of a failure. Which...

An emergency change was made to an IT system as a result of a failure. Which of the following should be of GREATEST concern to the organization's information security manager?


A. The change did not include a proper assessment of risk.
B. Documentation of the change was made after implementation.
C. The information security manager did not review the change prior to implementation.
D. The operations team implemented the change without regression testing.

Correct Answer: ???????????????

___________________________________

Note

Not sure if regression testing is a security concern.  B maybe the answer??

In: Computer Science

Program in Java Create a queue class to store integers and implement following methods: 1- void...

Program in Java

Create a queue class to store integers and implement following methods:

1- void enqueue(int num): This method will add an integer to the queue (end of the queue).

2- int dequeue(): This method will return the first item in the queue (First In First Out).

3- void display(): This method will display all items in the queue (First item will be displayed first).

4- Boolean isEmpty(): This method will check the queue and if it is empty, this will return true, otherwise false.

In: Computer Science

How to do in C++ HTML Converter Create a program that reads an HTML file and...

How to do in C++

HTML Converter

Create a program that reads an HTML file and converts it to plain text.

Console

HTML Converter

Grocery List

* Eggs

* Milk

* Butter

Specifications

  • Your instructor should provide an HTML file named groceries.html that contains these HTML tags:

<h1>Grocery List</h1>

<ul>

    <li>Eggs</li>

    <li>Milk</li>

    <li>Butter</li>

</ul>

  • When the program starts, it should read the contents of the file, remove the HTML tags, remove any spaces to the left of the tags, add asterisks (*) before the list items, and display the content and the HTML tags on the console as shown above.

Note

  • The groceries.html file ends each line with a carriage return character (‘\r’), not a new line character (‘\n’). To account for that, when you read the file, you can use the third parameter of the getline() function to specify the end of the line. For more information, you can search online and check the documentation of the getline() function.

In: Computer Science

Given a list of 4096 sorted values, about how many comparisons can you expect to be...

Given a list of 4096 sorted values, about how many comparisons can you expect to be performed to look for a value that's not in the list using the
bubble sort algorithm?

In: Computer Science

Design a program using Raptor Flowcharts that tests your ESP, or extrasensory perception. The program will...

Design a program using Raptor Flowcharts that tests your ESP, or extrasensory perception. The program will randomly pick a color from Red, Green, Blue, Orange, Yellow, and Purple, and you will be asked to predict the program's selection before it is revealed. The program should ask the user to enter the color the computer has selected. The program should ensure user enters only one of the six colors. After user has entered his or her guess, the program should display the name of the randomly selected color. The program should repeat this 10 times and then display the number of times the user correctly guessed the selected color.  

In: Computer Science