Q6-Write a menu driven program to do the following tasks with the help of user-defined functions
1)Replace 's' with 'S' in new file
2)Count & display no. of words beginning with 'a' OR 'A'
3)Count the no. of words beginning with 'a' or 'A' and ending with 'e' or 'E'
4)Replace 'DELHI' with 'NEWDELHI' in address.txt
'''
print("1. create a file")
print("2.Count & display no. of words beginning with 'a' OR 'A'.")
print("3.Count the no. of words beginning with 'a' or 'A' and ending with 'e' or 'E'.")
print("4.Replace 'DELHI' with 'NEWDELHI' in address.txt.")
print("5.Replace 's' with 'S' in new file.")
print("6. Read the file")
Answers
Answered by
5
Explanation:
Ferrel's law involves the deflection of a particle (water, air, ice, or the like) in motion of the Coriolis effect. ... As a result of this action, winds, oceanic currents, and drift ice are deflected rightward (with reference to their original motion) in the Northern Hemisphere and leftward in the Southern Hemisphere
Answered by
5
Explanation:
1) A function or a method is a sequence of statements grouped together and given a name. This group of statements can be called at any point in the program using its name to perform a specific task.
First line of function definition that tells about the type of value returned by the function and the number and type of arguments is called function prototype.
2) when a function returns a value, we can assign the entire function call to a variable. Below example illustrates the same:
public class Example { public int sum(int a, int b) { int c = a + b; return c; } public static void main(String args[]) { Example obj = new Example(); int x = 2, y = 3; int z = obj.sum(x, y); System.out.println(z); } }
Similar questions