Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Download the text file Activity10.txt (linked here) and save it in the same directory where you save the source code for this activity. Write a Python program that reads the Activity10.txt file’s contents and determines the following:

  • The number of uppercase letters in the file
  • The number of lowercase letters in the file
  • The number of digits in the file
  • The number of whitespace characters in the file

Use the string functions isupper()islower()isdigit()isspace() introduced in Section 8.3.





Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


Program Requirements:


1. Define a function that will check first if the input fraction is a VALID fraction.


2. Define a function that will split a VALID fraction and return a list that consists the numerator and denominator.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output:


Input a fraction?: 5/0


Invalid fraction

Kaye Keith C. Ruden


Machine Problem 3


Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


Program Requirements:


1. Define a function that will check first if the input fraction is a VALID fraction.


2. Define a function that will split a VALID fraction and return a list that consists the numerator and denominator.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output:


Input a fraction?: 5/0


Invalid fraction

Make a program that allows the user to select the operation he or she wishes to perform. Furthermore, your program will keep asking the user to pick until he or she selects exit to stop the execution.

searchBook( )

for a searching book by name or author. It asks the user to enter the

type of search he/she wants i.e. by Book name or by author name.



Design a C++ program that takes character input from user and checks whether that letter is vowel alphabet or not using if...else statement


Create a class in Python called Sorting which takes in a file name as an argument. An object of class Sorting will have methods called:

  •  Create a method called GetData which reads in the numbers found in the file and stores them in a list or array.
  •  Create a method called SortData which sorts the data collected by the GetData method in ascending order.

Hint: Use BubbleSort and take in the array or list from the GetData method as an argument.

  • Create a method called ReverseData which sorts the data contained in the file in descending order.

 Hint: You can use any method of reversing a list or array for this requirement. This can be done using slicing, by using the build in reversed() method, or by importing/using modules like array and NumPy. Keep in mind the last two methods require pip installs!

  •  Create a function called main which creates an object of class Sorting and calls the GetData, SortData, and ReverseData methods. Use __main__ to automatically call this main method at runtime.

3.1 Write a function named "reverse” that takes as its arguments the following:

(a) an array of floating point values; (15)

(b) an integer that tells how many floating point values are in the array. (15)

The function must reverse the order of the values in the array.


Thus, for example, if the array that's passed to the function looks like this:

0 1 2 3 4

5.8 | 2.6 | 9.0 | 3.4 | 7.1


then when the function returns, the array will have been modified so that it looks like this:


0 1 2 3 4

7.1 | 3.4 | 9.0 | 2.6 | 5.8

The function should not return any value.


Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output 1:


Input a fraction: 4/6


Reduced fraction is 2/3

Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


Sample Output 1:


Input a fraction: 4/6


Reduced fraction is 2/3

LATEST TUTORIALS
APPROVED BY CLIENTS