Q1: write a program which take data as input and show that data in reverse order?
Q: Question: Write a program that reads a series of dates in day/month format, from the file…
A: Given:
Q: What does the variable someVar store at the end of execution? A. It is the number of words in the…
A: Correct Answer will be Option C Explanation: At the end of the execution someVar is going to store…
Q: What is the output of the following code, assuming variables are declared and header files are all…
A: Program Approach: The header file “<iostream>” is declared that contains all standard…
Q: Write a program that includes a function that calculates the equation F= x" sin x. Write the values…
A:
Q: print ("W", end="") try : inFile = open ("test.txt", "r") line = inFile.readline () value = int…
A: I have given an answer in step 2.
Q: Q 2:\ (a) What are the output of following code? float a,b,c a=5; b=3; c=a/b; setfil(); -…
A: main.cpp: In function ‘int main()’: main.cpp:17:14: error: ‘setfill’ was not declared in this scope…
Q: What is the output of the following segment ? int y,x = 1,wW = while ( x <= 5 ) { y = x * x /s; WW…
A: 1) The above code segment calcaute the sum of series(x*x/2) from x =1 to x = 5 1*1/2 + 2*2/2 +…
Q: What is the output ofthe following code? count = 0; put << count << " "; ile (count < 5);
A: the output for the above program is.....
Q: Consider the block of code and find the output printed on the screen after the program finishes. The…
A: The given C++ program uses the file operations and its output is described as comments in the next…
Q: Explain what the following program does. #include int main() { FILE *ifp = fopen("input.txt", "r");…
A: FILE *ifp = fopen("input.txt", "r"); ---> Will open file named "input.txt" in read mode and…
Q: Question3: Write a program that adds the even numbers between 1 and 100, and save it as an M-file.
A: find your code below
Q: Write a code that outputs variable numObjects
A: Program code://import the required packagesimport java.util.Scanner; //define a class…
Q: What is the output of the following program segment? int count = 5;while (--count > 0)cout…
A: Explanation of the program segment: An int variable is declared and initialized to 5. A while…
Q: Q1: write a program which take data as input and show that data in reverse order?
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions…
Q: void copy (int& a, int& b, int& c) { a *= 2; b*= 2; c*= 2; int main () { int x = 2, y = 5, z = 7;…
A: Given: We have the c program given in which we have to find out the return values.
Q: What is the output of the following code fragment? (please don't add an empty space before and after…
A: I have provided C++ CODE, along with CODE SCREENSHOT and OUTPUT , OUPUT…
Q: Implement the following programs in cpp code; Write a program to convert all the characters in…
A: note: we are only allowed to solve one question in one post. please post other questions in a…
Q: int count 8; printf("%f",count); What is the output of the program?
A: In the above code an integer variable named count is initialized with assigned value of 8. In the…
Q: The following code will print Int x=10; Printf(“x=%d”,x++);
A: x++ means first we use the assigned value and then increment it after the use.
Q: What is the output of the following program? function start(){ var arr } [2, 15, 12, 65, 17, 83];…
A: arr.remove function remove the element which is passed as parameter. In this case 2 will be removed…
Q: 3. Write a program that takes as an input file the number of chapters in each book of the Bible. The…
A: #include <stdio.h>#include <stdlib.h>#include <string.h>// structure to store book…
Q: a large corporation with two plants has discovered that some of its employees are on the payrolls of…
A: #include…
Q: 6) What will be the output of the following code fragment? check = False total = 4 while not check:…
A: Introduction: In this question we need to find out the output of the following code snippets.
Q: Write code that uses the input string stream inSS to read input data from string userlnput, and…
A: Program: //Import the required packages import java.util.Scanner; //Define a class named…
Q: Write the statements to do the following: A.declare an array of 10 strings with room for 60…
A: As per our company guidelines we are supposed to answer ?️only first 3️⃣ sub-parts. Kindly repost…
Q: 5. What is the output of the following code? int count = 0; do cout << count <<""; count++; } while…
A: the output for the above code will be.....
Q: Q4. Write a program that read 2 matrices and has a function which finds their sum.
A: Coded using Python 3. According to the guidelines we are supposed to answer only `1 question. So I…
Q: Q Write a program to initialize a block of memory starting at BA00OH with English alphabet (A to Z)…
A: Given:
Q: How do you create an object for reading data from file test.txt? How do you create an object for…
A: File handling: To perform file handling in C++, header file must be included in the source file. It…
Q: Write code that uses the input string stream inSS to read input data from string userlnput, and…
A: Please find the answer below :
Q: I have a text file and I want to read it in C++. variables to use: fname, lname , Id nr, Gender…
A: Actually, the given information is: The file is : Tommy James 23456731667 Streetname 45 , 154…
Q: Exercise 5: Write m-file to find the number of ways to write a number as the sum of numbers smaller…
A: Actually, program is a executable software that runs on a computer.
Q: Write a program that reads input until encountering either the # character or the % character and…
A: - We need to highlight the code to read the characters until # or % is seen and return the count of…
Q: Use the functions from the previous three problems to implement a pro-gram that computes the sum of…
A: Use the functions from the previous three problems to implement a pro-gram that computes the sum of…
Q: 1. Write Lex Program check whether a given input is a word or not? 2- Write Lex Program to count the…
A: 1. code : Output :: Editable code : %{#include<stdio.h>#include<stdlib.h>%}%option…
Q: 3. Write a program to add the following numbers and save the result in R20. Ох25, 0х 19, Ох12
A: Given: Write a program to add the following numbers and save the resut in R20. Given numbers:…
Q: Write a program that includes a function that calculates the equation F= x" sin x. Write the values…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Initialize a list…
Q: What is the output of the following code? t=-i:.01*i:i; p=exp(2*t); plot(t,p)
A: d. no plot
Q: Write a program that includes a function that calculates the equation F= x" sin x. Write the values…
A: The solution for the above given question is given below:
Q: Suppose you wanted to read a very large file of text. Which of the following functions would you…
A: Given functions are void readFile1(int f){ char c; while (read(f, &c, 1)==1){…
Q: 4. Write a program that will read a date (month, day and year) in integer form and display the date…
A: /*Program to read the date in integer and display the date in standard format using switch…
Q: 7) Write a code that content of AL is 10. Compare with 10. If numbers are equal, Jump to label NEXT…
A: Assembly language program to compare two numbers .
Q: Q2: write a program which take data as input and show there sum and average of the data?
A: Please give positive ratings for my efforts. Thanks. ANSWER #include<iostream>using…
Q: What is the output of the following program? #include int main() { char s[ ]=" map"; int i;…
A: c) aaaa pppp
Q: Can you please break the above code into 3 sections (loan.h, loan.cpp and main.cpp and give me the…
A: Please refer to the following steps for the complete solution to the problem above.
Q: Write code that uses the input string stream inSS to read input data from string userInput, and…
A: Introduction Write code that uses the input string stream inSS to read input data from string…
Q: What is the output following program segment? m=[8, 4, 5, 2, 8, 3, 4, 5] print( m[1] // m[2] + m[7])…
A: Answer : The output is option A) 5
Q: (5) Write a function called copy_even_lines() that takes two strings (filenames) as input parameters…
A: As there are two sections i am giving the solution to the only the first one. As given in the…
Q: Consider the following function: int get_random(int start, int end){) int * rand_int = new int;…
A: We nee to answer: Consider the following function: int get_random(int start, int end){ int *…
i need the answer quickly
Step by step
Solved in 2 steps with 1 images
- Which of the following functions DOES NOT have a memory leak? Select one: void func(string word) { int* ptr = new int[2]; ptr[0] = word.size(); delete ptr; } void func(string word) { int* ptr = new int; *ptr = word.size(); } void func(string word) { int* ptr = NULL; int len = word.size(); ptr = &len; cout << "Length of " << word << " is " << *len << endl; }Write code that uses the input string stream inSS to read input data from string userInput, and updates variables userMonth, userDate, and userYear. Sample output if the input is "Jan 12 1992": c++please try to code them and send the output
- What is the output of the following program segment? int count = 5;while (--count > 0)cout << 2 * count << " ";cout << endl;(5) Write a function called copy_even_lines() that takes two strings (filenames) as input parameters and copies every other line from the first file into the second. That is, counting from 0, it copies the 0th line, the 2nd line, the 4th line, etc. from the first file to the second file. You may assume that both files exist. (6) Write a python program that asks the user for two filenames and calls your function copy_even_lines() from (5) using those two filenames. If one or more files do not exist, your program must handle the exception by repeating the prompts until valid filenames are entered.I cannot change the function on itself : Here's what I wrote for now char ** populate(char ** words, FILE *fptr, int *currentsize, int *maxsize); char** words; FILE *fptr; int *currentsize; int *maxsize;
- Write a short program that opens a binary data file, "data.dat" and prints the number of bytes that file contains Use fopen), fseek(), ftell), and fclose() functions in cI have a text file and I want to read it in C++. variables to use: fname, lname , Id nr, Gender and all third line which is an address . Note: *** The result in your program should be written to a new file. So you need to open 2 files in your program, one for reading and one for writing. The file is : Tommy James 23456731667 Streetname 45 , 154 23 Georgia John Andersson 3456723464 Streetname 12 , 231 32 Las Vegas Kim Larsson 3456312653 Streetnamn 15, 231 56 Florida If we Said the 8th digit in ID number is showing the Gender of the person. By %2== 0 it's Male The output should be: Lname Fname [F] address Is there possible to create a program in C++ with the previously output. lname , fname [F]Adress Without have a problem with Las Vegas word. I have a hard time to figure how I can do the third line in the file. They read to word Las and then the compiler shows terminate called after throwing an instance of ' std::invalid_ argument ' what (): stoi aborted so I figured…Can you please break the above code into 3 sections (loan.h, loan.cpp and main.cpp and give me the output please.
- Question 10 Complete a program that stores the following variables a, b, c and array d in order in the binary file “a.aaa”. .......c++, Print out all composite numbers from 2 to 50 using a loop. Within the loop, you must call a separate boolean function to determine whether a number is composite or not.Use the functions from the previous three problems to implement a pro-gram that computes the sum of the squares of numbers read from a file. Your program should prompt for a file name and print out the sum of thesquares of the values in the file. Hint: Use readlines ()