• August 28th, 2018

Python Assignment

Paper , Order, or Assignment Requirements

Question 1 Marks 05

Assume s is a string of numbers.
Write a program that checks the string s 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:

2 – 7
3 – 8 14
5 – 0 6 11
7 – 3 13

Give Five (5) different examples with its output.

Question 2 Marks 05
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

Question 3 Mark 05
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

Question 4 Mark 05

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.

Latest completed orders:

Completed Orders
# Title Academic Level Subject Area # of Pages Paper Urgency