Mass Write a C++ program that computes density of an object using formula, Volume Create a text file Objects.txt where each record contains volume and mass respectively of different objects as shown below: Objects.bt 33.50 0.09 3.38 0.04 26.52 0.23 2571.35 1.75 96.95 0.09
Q: istream member function__________ repositions the fileposition pointer in a file.
A: Given Data:- The istream member function __________ repositions the file position pointer in a file
Q: write a complete statement write the declaration of P (a pointer to integer) * write the…
A: Note: since your question contain multiple sub question but we can answer only 3-sub parts at a time…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using the adequate header files. Declare the necessary integer type and character type arrays.…
Q: File handling is an important part of any application. Assume that, you are asked to build an…
A: Note : Consider the given data for first record : 3,4,4,3,3.7,4,3.3,1 the harmonic mean is…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: The __________ member function returns a file’s current write position.
A: Given: The __________ member function returns a file’s current write position.
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: An array is a linear data structure where the elements occupy contiguous locations in memory. All…
Q: POWERSHELL TASK Try to swap two strings/names in a file and the file name should be a command-line…
A: In this question we have to write a PowerShell Script in which we have to provide a File Name and…
Q: Mass Write a C++ program that computes density of an object using formula, Volume Create a text file…
A: given data Write a C++ program that computes density of an object using formula, Mass Volume…
Q: In C++ Ask the user for three friends names, store the names in an array. Output the array to a…
A: Program://include the required header files#include <iostream>#include<fstream>#include…
Q: 1. Write a menu driven C program to read the information of n number of students from user and store…
A: #include <stdio.h>#include <stdlib.h> #define DATA_SIZE 1000struct student{ int…
Q: Write the following two functions in c programming language maintaining a database of entries of…
A: As the requirement to question the Source code is given below:
Q: Write a program to take input for n book records from user and write those book records in a file…
A: EXPLANATION: The first step is to include the necessary header files. Then create a structure that…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Program Plan Using the adequate header files. Declare the necessary integer type and character…
Q: Question 1 It is a container in computer storage devices used for storing data. Structure Array O…
A: Container in Computer storage used for data storage is File. Rest are data structures who are…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: The calloc() function changes the memory size of multiple block of requested memory. True O False…
A: Verify the statements given below, 1. The calloc function changes the memory size of multiple blocks…
Q: 3 Linker Assigned Symbol Strength · The C-code below is one file, symbol.c. For each of the 10…
A: Below is the answer to above question. I hope this will be helpful for you...
Q: Question: (See Assignment 3 question 2) Write a function called count() which reads through a file…
A: First, we need to create "commasperiods.txt" in the present working directory.
Q: Mass Write a C++ program that computes density of an object using formula, Volume Create a text file…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Write a function that takes a file name as argument. Use this function to open the file data.csv,…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: In C language, write the following two functions maintaining a database of entries of type song in a…
A: I have implemented the given requirements as per the specification. The code is as follows:…
Q: In C language, write the following two functions maintaining a database of entries of type song in a…
A:
Q: In C++ Create a function that checks to see if a file exists
A: /*C++ Program to create a function that checks to see if a file exists*/ #include…
Q: Write a C++ program that opens three files (i.e. s1.txt, s2.txt, and s3.txt) and reads the data of…
A: #include<iostream> #include<fstream> #include<conio.h> using namespace std; int…
Q: 1. Write a C++ program that reads a student grade from the screen/keyboard. The program should then…
A: Below I have provided a C++ program for the given question. Also, I have attached a screenshot of…
Q: Write the following two functions maintaining a database of entries of type song in a file in c…
A: C++ requires that any feature be declared earlier than it's far used. I.E. A function's prototype…
Q: each line in the input file will represent a record of data. There will be 10 lines, thus 10…
A: Programming instructions: Declare the required variables. Declare the file pointer. Take filename…
Q: Q1: Write a Python program that prompt user to enter at least five entries: 1. Each entry requires…
A: #program1 f = open("name_Scores.txt","a+")#opening file in reading and writing mode, if there is no…
Q: In C programming, write a program that creates a file in C and appends the following details from…
A: The C program provides a file handling mechanism. This is carried by using FILE which creates a file…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Given: Assume that a file contains students’ ids, full names, and their scores (Assignments grade,…
Q: This C programming code is not run properly. Please fix this problem and solve this error.…
A: Correct code: # include <stdio.h># include <string.h> int main( ){ // Declare…
Q: rite a program in Perl language you have to copy a file element in other file. The 1st file is abc.…
A: Write a program in Perl language you have to copy a file element in other file. The 1st file is…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: Exercise 5: Write a C++ program which reads from a file inventory records of some items…
A: 1)Read the each number from input file 2)And assign it to array 3)Based on the index print to the…
Q: In c write a program that: a) takes an input file name from the command line; b) opens that file if…
A: #include<stdio.h>#include<string.h>struct info{char names[100];int age;float wage;};int…
Q: 1. Write a C++ program that reads a student grade from the screen/keyboard. The program should then…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: Declare a file pointer called input. Open a file called location.txt for reading using this…
A: Create a structure Location which is having parameters one array of chars then two floating values…
Q: Start with the code in the File IO lecture for writing a file (creating a list of degrees and their…
A: the solution is given below :
Q: Suppose a file contains student's records with each record containing name and age of a student.…
A: In below c program a student attributes are taken like age,name,rollno and print their names in…
Q: 1. Write a program in C/C++ that reads a table of data from an input file and displays the data. The…
A: Solution: Given input file,
Q: C programming - (image attached ) Write a programme called pgmTile which takes 3 arguments, an…
A: refer the solution in the below step
Q: Files in C Language Assume that “GO.TXT” exists with a file size of 2KB. What is new file size of…
A: This is a C space related question Assuming 2KB =2048 Bytes and assuming it is completely filed…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Program Approach:- Using the header files. Using the struct keyword. Main function Storing…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Algorithm/Approach: Using necessary header files. Declare integer type and character type arrays.…
Q: Write a C/C++ program that calculates the least squares line for two sets of values. The program…
A: Actually, c++ is a powerful general purpose language.
Q: Write a C/C++ program that calculates the least squares line for two sets of values.
A: Solution (C++ program) is in Step 2.
Q: In C programming language, choose True or False for the following statements:. True False fscanf…
A: Below are answers of the statements you gave with a brief explanation. The given statements are for…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Step by step
Solved in 2 steps with 1 images
- Write a void function that will merge the contents of two text files containing the chemical elements into a single binary file. The function's parameters will be three file pointers; each text file will contain an integer atomic number followed by the element name, chemical symbol and atomic weight. Here are two sample lines: 11 Sodium Na 22.9920 Calcium Ca 40.08 The function can assume that one file does not two copies of the same elements and that the binary output file should have the same property. IN C PLEASE. In c write a program that:a) takes an input file name from the command line;b) opens that file if possible;c) declares a C struct with three variables; these will have data types thatcorrespond to the data types read from the file (i.e. string, int, float);d) declares an array of C structs (i.e. the same struct type declared in point c);e) reads a record from the file and stores the values read into the appropriatestruct variable at the appropriate array index (for that record);f) continues reading each record into a struct (as in point 1e), and stores eachstruct containing the 3 values into the array of structs declared in point d;g) closes the file when all records have been read.Note that your program should print an error message in the event that the filecannot be opened successfully.C programming - (image attached ) Write a programme called pgmTile which takes 3 arguments, an input file (either ASCII or binary), an integer factor n, and an output file name template. It should divide the input file into nxn smaller images corresponding to parts of the image. For example, suppose that the invocation is: pgmTile sampleFile.pgm 3 sampleFile_<row>_<column>.pgm then the programme should read in sampleFile.pgm and output 9 smaller images, named: sampleFile_0_0.pgm sampleFile_0_1.pgm sampleFile_0_2.pgm sampleFile_1_0.pgm sampleFile_1_1.pgm sampleFile_1_2.pgm sampleFile_2_0.pgm sampleFile_2_1.pgm sampleFile_2_2.pgm i.e. substituting the relative position of the subimage in the larger image into the <row> and <column> tags in the template name
- Write a program in C++ to do the following: 2. Create an array to hold up to 20 integers. 3. Create a data file or download attached text file (twenty_numbers.txt) thatcontains UP TO 20 integers.4. Request the input and output file names from the user. Open the filesbeing sure to check the file state.5. Request from the user HOW MANY numbers to read from the data file,up to twenty. Request the number until the user enters 20 or less, but not lessthan 0. The user enters the number of integers to read. The integers are storedin the file and are to be read from the file.6. Write a function that reads from the opened data file: the numberof integers the user wants to read, and store the numbers inthe array. For example, if the user wants to read 13 numbers,read 13 of the 20 that may be in the file.7. Write a function that writes to the opened output file AND THECONSOLE, the numbers stored in the array.8. NO GLOBAL variables are to be used. The input and output file variablesmust be passed…The objective of this question is to generate and read files that contain a list of random numbers. Write a function that generates a file with following parameters: def fillFile(fileSize, fileName): The function should be called to generate files in the following sizes: fileSizes = [1000, 5000, 10000, 20000, 30000, 40000, 50000] The generated files can have names file1000, file 5000, file 10000, file20000, fi130000, file40000, file 50000. You can use random.randint(0.fileSize+1000) to generate a random number. Write another function that reads numbers inside of a file and returns a list. def readFile(fileName): The returned list contains the numbers stored in the file. At each call of fillFile and readFile, record the times before and after the function call as in following example (import time): start = time.time() fillFile(file Size, "file" + str(fileSize)) finish time.time() runTime = finish - start Record the run times of functions into a file named "fileStats.txt". The…Code done in C Write a piece of code in a function called password that creates a file with a random password (it can be a number). In another function called check_password, the function must ask the user to input the password to login and it should match the password in the file. If it doesn't, it should keep asking the user to keep inputting the right password. Finally, just by passing in the two functions into the main, that would be fine. Ex. int main() { ....password(....); ....check_password(....); }
- In C language, 3. A text file name.txt - contains this data, Sam Davis Kobe S Bryant Michael K jordan Li Peng Raj Mohan Sharma Can you write a program to read this file and print each name separately in each line ?Question 1 of 1: Word Swap: Write a C++ program that will swap the words Caesar and Brutusin the file “source_file.txt”. You will need to load the file “source_file.txt” and finally write theupdated contents with the replaced words to the file “target_file.txt”.Successful operation should swap all occurrences of Caesar with Brutus and Brutus with Caesar.You can use functions from the cstring library. You are not allowed to use the string datatype. Once again, do not use string datatype.Please properly comment your code before submission.Write a C++ program called CylinderVolume to calculate the volume of a cylinder. The volume of a cylinder is: V=πr2h where r is the radius and h is the height and π is PI = 3.14159 for our purposes Use C++ multi-file format and these functions: void WriteHeader() void Goodbye(); string CalcVolume(double radius, double height); //use the pow function for squaring void AskForDimensions(double &rRadius, double &rHeight); Declare the constant PI in the .cpp file with the function definitions. That is the only place it is needed. You could even declared it in the CalcVolume function to make it more local. The CalcVolume function will return a nicely formatted string that describes the input and the volume, including that we are calculating the volume of a cylinder. The string will be created with stringstream. Set the precision to 3 decimal places. In main(), Declare variables and start a do-while loop for the repeated play. Display the Header, ask the user for the dimensions and…
- You must solve the problem in C++ (Create a text file)Write a program to create a file named Exercise13_1.txt if it does not exist. If it does exist, append new data to it. Write 100 integers 0 to 99 into the file using text I/O. Integers are separated by a space.Implement in C Programming 9.7.1: LAB: Course Grade Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: Read the file name of the tsv file from the user. Assume the file name has a maximum of 25 characters. Open the tsv file and read the student information. Assume each last name or first name has a maximum of 25 characters. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the…Write a standalone function partyVolume() in Python that takes accepts one argument, a string containing the name of a file. The objective of the function is to determine the a Volume object that is the result of many people at a party turning the Volume up and down. More specifically: the first line of the file is a number that indicates the initial value of a Volume The remaining lines consist of a single character followed by a space followed by a number. The character will be one of ‘U” or ‘D’ which stand for “up” and “down” respectively. The function will create a new Volume object and then process each line of the file by calling the appropriate method of the Volume object which changes the value of the Volume. The function then returns the final Volume object. Guidelines/hints: This is a standalone function, it should NOT be inside (indented within) the class. It should be listed in the module after the Volume class and without indentation. Note that the first line of the…