Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Question 1: Assume s is a string of numbers.

Write a program that checks the strings for the values '2', '3', '5' and '7'. When one of the values is found in the string, record its position within the string and continue to check for more occurrences. Finally, output the results found.

For example, if s = '568714523645873', your program should print:

Give Five (5) different examples with its output.

2. Assume s is a string of numbers.

Write a program that prints the longest substring of s in which the numbers occur in descending order. For example, if s = '561984235870154755310', then your program should print

Longest substring in numeric descending order is: 755310

In the case of ties, print the first substring. For example, if s = '742951', then your program should print

Longest substring in numeric descendingorder is: 742

3. You have recently returned to Australia after a holiday abroad. You have some unspent foreign currency that you need to convert back into AUD (Australian Dollars). Write a program that will allow you to enter two or more amounts of foreign currency and theirassociated exchange rate. Convert the amounts back into AUD and print the total sum of AUD received once all conversions are complete.

Resulting program output might look similar to:

Enter currency amount: 100

Enter exchange rate: 0.75

100.0000 / 0.7500 = 133.33

Enter currency amount: 100

Enter exchange rate: 0.50

100.0000 / 0.5000 = 200.00

Total AUD received = $333.33

4. Write a python program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program quits. Otherwise, the program prints the line associated with that number.

5. Write a program that encrypts and decrypts the user input. Note - Your input should be only lowercase characters with no spaces.

Your program should have a secret word that will be used for encryption/decryption. Each character of the user's input should be offset by the value of the same character in your secret word. For example, if my secret word is "cab" and the user wants to encrypt "apples".

The encrypted output would be "dqrofu".

The program should ask the user for input to encrypt, and then display the resulting encrypted output. Next your program should ask the user for input to decrypt, and then display the resulting decrypted output.

Enter phrase to Encrypt (lowercase, no spaces): apples

Result: dqrofu

Enter phrase to Decrypt (lowercase, no spaces): dqrofu

Result: apples

6. Write a python program that accepts a text file as input. The program should read the text file and display all unique words in alphabetical order. It should then display the non-unique words and the number of times that they occurred in the input text.

Input file contains the following text:

how much wood would a woodchuck chuck if a woodchuck could chuck wood

Expected outcome should resemble:

Non-unique words and number of occurrences in no particular order:

wood : 2

a : 2

woodchuck : 2

chuck : 2

Unique words in alphabetic order:

could

how

if

much

would

Information related to above question is enclosed below:

Attachment:- Assignment1201814.rar

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M93089002
  • Price:- $120

Priced at Now at $120, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As