Write a C function willH dle int copyFile (char filenamel, char filename2); Siven the names of a destination and of a source file (respectively, filenamel and filename2), the function should copy the content of the sourc nto the destination file, after transforming the alphabetic characters from lowercase to uppercase and vice-versa (all the other characters are copiec s they are). In case the copy operation is not successful, the function should return the value-1. Otherwise, it should return the total number of naracters that were successfully copied.
Q: Write a C++ function named louder which accepts a pointer to a C-string as its argument. It should…
A: #include <bits/stdc++.h>using namespace std;// function that takes a C string.int louder(char…
Q: In C++, find the 5 most frequent words and their frequency in a given text. User input should be the…
A: Read the files. For each line in the file do the following: parse the line into words. replace…
Q: 2. Write a function RightFill(s, n) which fills the string s with blanks from the right until its…
A: MATLAB means MATrics LABoratory , as the name suggests it is actually used for matrix. Though it is…
Q: Write a C function with the following prototype: int strFindSimilar(char str1[], char str2[]); Given…
A: // C program to compare the two strings // without using strcmp() function #include <stdio.h>…
Q: Create a C++ function to take a string as a parameter and then store every character of the string…
A: Create a C++ function to take a string as a parameter and then store every character of the string…
Q: I need help in creating a function that will show the first letter of the actual word. It is to be…
A: According to the question , we have to creating a function that will show the first letter of the…
Q: Question 4 Write a Python function, named UniqueChars , that will that will take a string as an…
A: Algorithm: Start Open file in read mode and store the data in text Implement a ,method named…
Q: Write a C function with the following prototype: int copyFile(char *filenamel, char *filename2);…
A: #include <stdio.h>#include <stdlib.h> int copyFile(char *filename1,char *filename2){…
Q: Write a function in C language to swap two numbers passed by reference. In main function test the…
A: /* C program to swap two numbers passed by reference*/ #include <stdio.h> //Function to swap…
Q: Write a C++ program, using functions only, with the following features. Program reads paragraph(s)…
A: #include <bits/stdc++.h>using namespace std; // Function to print frquency of each wordvoid…
Q: Write a C++ program to swap two numbers using pass-by-value and pass-by-reference swap functions.…
A: Note: you are asking to create a variable as int. then asking to assign value as 1.5 and 6.1 which…
Q: Ask the user to enter the following statement: "I like programming in C++ because C++ is fun and…
A: #include <bits/stdc++.h> using namespace std; #define int long long int int Count(string s…
Q: In C, we can define pointers to which of the following? Check all that apply. O functions O pointers…
A: The solution contains basics of C language of pointers, strings.
Q: Write a C++ function which receive two files as parameter and display its common words. Write helper…
A: ifstream firstFile("c:/a.txt"),secondFile("c:/b.txt"); string fFileStr,sFileStr;…
Q: Write a function in C++ "createPassword()" with no return value to randomly select 8 capital letters…
A: //include headers#include<iostream>#include<stdlib.h> //rand functionusing namespace…
Q: Define a C function that takes two char arrays ca1, ca2, and the size of the arrays s1, s2 as the…
A: Define a C function that takes two char arrays ca1, ca2, and the size of the arrays s1, s2 as the…
Q: Write a C function readFile() that will open the StudentInfo.txt file created in last question and…
A: #include<iostream>#include<fstream>using namespace std; // define a class to store…
Q: Given the input file mark.txt which contain of student information such as student ID including 3…
A: #include <stdio.h>#include <stdlib.h>#include <string.h> char grade(int marks) {…
Q: Write a c++ beginner level program that takes a date in the following format: December 24th, 2021…
A: Here I written C++ Code for given problem below. I hope you like it.
Q: 14. Create a functional program in C++ that takes a string as the parameter. The string will contain…
A: Create a functional program in C++ that takes a string as the parameter. The string will contain…
Q: Write a function to replace all instances of character c1 with character c2 and vice versa. Examples…
A: Algorithm - Create a method with name doubleSwap with three argument. Loop over the string…
Q: Write a complete C++ program with the two alternate functions specified below, of which each simply…
A: In call by reference, the actual value that is passed as an argument is changed after performing…
Q: C++ : .Write a function that, given two strings, creates another string that contains only the…
A: Code: #include<iostream>using namespace std;#include <string>void func(string s1,string…
Q: plz redo this code in C using system functionsinstead of the standard functions i have: #include…
A: Below i have answered:
Q: 3) Write a function m-file called div5.m that takes as input a real number and checks to see if it…
A: Below is the required code in Matlab:
Q: Write a function in C++ that outputs to string using ostringstream. Have it output to the screen and…
A: C++ function Output string using ostringstream.
Q: Ising C, write a program called buffer.c that uses no other function calls but calls to the…
A: It is defined as a request made by a program or script that performs a predetermined function.
Q: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
A: GIVEN: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
Q: 2) write a C+ program to generate the following pattern using the append predefined anction of data…
A: C++ Code to generate the given pattern using predefined function is as given below.
Q: Write a C function with the following prototype: int strFindSimilar(char strl[], char str2[]); Given…
A: Given, we have two strings str1 and str2. We have to find whether the two strings are similar or not…
Q: 4.Write a c program for the following string of operation. Read monitor divide the given string into…
A: EXPLANATION: - The string input is read from the user using the scanf statement in the readInput…
Q: (1.13) A binary number is passed as a parameter to a function in the form of a binary string. Write…
A: Since the programming language is not mentioned so I have used the C++ programming language.…
Q: Write a function in C++ that outputs to the screen or file using ostream. Have it output to the…
A: Function in c++ that output to the screen using ostream . Have it output to the screen and to a…
Q: With the aid of c++, code a function which does the task listed below. i.Being able to do a…
A: #include <iostream>using namespace std; void String_rev(string& greet, int n,int i){…
Q: Language: C++ Adapt and extend your previous source code for working with complex numbers…
A: The solution for the above given question is given below:
Q: Write a C function strSumNums() that takes a string as parameter, computes and returns the sum of…
A: The program is written in C #include<stdio.h>#include<stdlib.h>#include<string.h>…
Q: Write a c++ program, using functions only, with the following features. 1. Program reads…
A: Actually, c++ is a powerful general purpose language.
Q: write a c++ function called exchange() the functions receives two integer variables x and y the…
A: A C++ program is as follows, File name: “main.cpp” #include<iostream> using namespace std;…
Q: 2. Write a function RightFill(s, n) which fills the string s with blanks from the right until its…
A: Note: As no lanagauge, therefore answering the given question in python. # Define the Rightfill…
Q: 22. Create a C++ function that takes two integers p and q as the parameters and then returns true in…
A: C++ Code: #include <iostream>using namespace std; bool fun(int p, int q){ if (p == 10) return…
Q: A. What are the minterms and maxterms representations of this function? R Simlif: the freotion…
A: Minterm and maxterm
Q: write a function with the following requirements *pass words from istream to ostream *if the word…
A: The code of these is given below.
Q: lp in creating 2 C functions that will help to split a string that is present in each line of the…
A: It is defined as a group of statements that together perform a task. Every C program has at least…
Q: Question: Write a function, changename(), which takes a filename as input and produces a filename…
A:
Q: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
A: Required: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string.…
Q: Solve the Heads-or-Tails problem in C or C++. Read the H-or-T data from either a file or from STDIN.…
A: The function longestRun() will take an infile object as a parameter. The file will be read for the…
Step by step
Solved in 2 steps
- Task: Write a C++ program, using functions only, with the following features. Only Do It Through C++ 1. Program reads paragraph(s) from the file and stores in a string.2. Then program counts the occurrence of each word in the paragraph(s) and stores all words with their number of occurrences.3. If that word has appeared more than one time in whole string, it should store the word only once along its total number occurrences.4. The output described in above (int part 3) must be stored in a new file. Sample input:is the is and the is and the and is and only that isSample output:is 5the 3and 4only 1that 1Write a C program that, 1. writes an n x n matrix into a file named "matrix.txt" the matrix has to contain the number as it is given in the example, and n has to be given by the user 2. contains a function with the name "averageM", which o input parameters are the main diagonal (in the example: [0,1,3]) o of the matrix and the size of the main diagonal (in the example: 3) o and returns with the average of the numbers in the main diagonal (in the example: 1.33) 1. calls the "averageM" function on the matrix.txt" and displays the result on the screen Instruction for the user: "n=": Example: Input: 3 Output in the file: 001 112 223 Output on the screen: 1.33Write a c++ program, using functions only, with the following features.1. Program reads paragraph(s) from the file and stores in a string. 2. Then program counts the occurrence of each word in the paragraph(s) and stores all words with their number of occurrences. 3. If that word has appeared more than one time in whole string, it should store the word only once along its total number occurrences. 4. The output described in above (int part 3) must be stored in a new file
- Write a c++ program, using functions only, with the following features. 1. Program reads paragraph(s) from the file and stores in a string. 2. Then program counts the occurrence of each word in the paragraph(s) and stores all words with their number of occurrences. 3. If that word has appeared more than one time in whole string, it should store the word only once along its total number occurrences. 4. The output described in above (int part 3) must be stored in a new file.Write a C++ function that meets the following specification.Name: wordFinderInputs: 1) input filename (string)2) pattern to find (string)Output: An integer representing the number of lines that contain the provided patternPurpose: The goal of this function is to open the file and read it line by line. In each line, you want to see if the pattern exists. If it does, then a counter should be incremented. If the file is unable to be open for any reason, a -1 should be returned. Otherwise, the number of lines containing the pattern should be returned. Assuming line is a string variable that holds the current line and pattern is a string variable holding the pattern to check for, the following code will determine if the pattern is in a string holding the current line:if (line.find(pattern) != string::npos)//Then the pattern is in the lineelse//The pattern is not in the lineWrite a C++ function that meets the following specification.Name: wordFinderInputs: 1) input filename (string)2) pattern to find (string)Output: An integer representing the number of lines that contain the provided patternPurpose: The goal of this function is to open the file and read it line by line. In each line, you want to see if the pattern exists. If it does, then a counter should be incremented. If the file is unable to be open for any reason, a -1 should be returned. Otherwise, the number of lines containing the pattern should be returned. Assuming line is a string variable that holds the current line and pattern is a string variable holding the pattern to check for, the following code will determine if the pattern is in a string holding the current line:if (line.find(pattern) != string::npos)//Then the pattern is in the lineelse//The pattern is not in the lineOptional Test: You can use the TOOP_Final.txt file and your answer from above to check how many lines contain " the "…
- Solve the following C++ question correctly. Implement File handling in C++.Write a C++ program, using functions only, with the following features. Program reads paragraph(s) from the file and stores in a string. Then program counts the occurrence of each word in the paragraph(s) and stores all words with their number of occurrences. If that word has appeared more than one time in whole string, it should store the word only once along its total number occurrences. The output described in above (int part 3) must be stored in a new file. Sample input: is the is and the is and the and is and only that is Sample output: is 5 the 3 and 4 only 1 that 1Write a C++ function (along with helper functions if required) that takes a file stream as a parameter and prints out the maximum negative number in the given file. Do not need to write the main function. An example: [Example file contents] 4 -2 8 12 -8 9 3Prints: Maximum Negative number -2
- How do I create a function in C++ that takes in a file name, ie. data.txt, on input and reads the data contained in the file and prints to screen the most frequently occurring integer in the file. Also, if two or more of the most frequently occurring integers occur equally often, it should return the largest.I need help in creating 2 C functions that will help to split a string that is present in each line of the text file. For instance, these are 5 lines of the text file wherein there is a word and its respective definition. The words can vary from 7-10 letters (min-max) followed by their descriptive clue. observe clue- to inspect or take note of as an augury, omen, or presage With the function I want it to seperate the these above strings in terms of words and their defintion for example I want the functions to seperate "observe" and "clue- to inspect or take note of as an augury. I want the function to work for any words and not just oneWrite a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ...