[SOLVED] ADS- Write assert based

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Write assert based programs.

  1. Text file contains ‘n’ numbers. Compute the sum of ‘n’ numbers present in file.
  2. Write function to generate square of a number. Numbers comes from text file. Squared number should be written to another file.
  3. Text file contains ‘n’ numbers, one number per line. Write function to store the numbers in other file in reversed order. (Let as assume that source.txt contains 10, 25, 30, 35, 50. Then dest.txt should contain 50, 35, 30, 25, 10).
  4. Text file contains some text data (some sentences). Write function to compute number of times a pattern present in the given text data. Pattern is passed as argument to function.
  5. Text file contain one sentence per line. Write function to find the length of each lines and write it to another file. Function should return length of longest sentence.

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.