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.txt x B3.50 0.09 3.38 0.04 26.52 0.23 2571.35 1.75 96.95 0.09 An object will float if its density is less than or equal to the density of oil, 0.00088kg/cm . Format and display the output on the screen as shown in the sample below.
Q: mplement the following C program. 1. The program reads a text file that has the following structure.…
A: note : We’ll answer the first question since the exact one wasn’t specified. Please submit a new…
Q: several functions which are described below. int ReadFile (int *, int *); Write a function that…
A: A function consists of a set of statements that perform a specified task. For example, the task of…
Q: (a) Write a program in C to create a text file named bmi.txt and store the data from the following…
A: Required: create a program to create a text file with the given table. after that create another…
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: Create a new file called pointerBasics.cpp. Write a C++ program in this new file. In this new file,…
A: - Solving first question according to the guideline. - We are doing the operations in sequence as…
Q: Write a program that reads a list of enrollments from a file and prints a class roster for the…
A: The Class Roster provides faculty with a list of students that are enrolled and waitlisted in a…
Q: WAP in c++ that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only…
A: #include <bits/stdc++.h>#include<fstream>using namespace std;void vowelwords(){fstream…
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: *12.13 (Count characters, words, and lines in a file) Write a program that will count the number of…
A: (1)First we need to check the number of command-line arguments is "1" (2)Obtain the file name…
Q: Write a C/C++ program that calculates the least squares line for two sets of values. The program…
A: The program is written in c++
Q: Computer Science I need a C++ program that will take a list of random integers from a .txt file,…
A: The solution to the given problem is below.
Q: C++ You will create a header file with implementation that performs the task. Together with the…
A: NOTE: Algorithm specified in the question is implemented in "checkAlgorithm.h". Test program to…
Q: Write a C++ program to print unique words in a file.
A: Since multiple questions have been posted at a single request we will answer only first question. If…
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: Write a C++ function (along with the helper functions) that returns the maximum number in a list of…
A: maxFileNum() directly takes the istream object as argument, and we are to assume that numbers.txt is…
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: 12.7: Sentence Filter C++Write a program that asks the user for two file names. The first file will…
A: A C++ program for the given criteria is as follows, File name: “main.cpp” /* C++ Program to convert…
Q: Write a C/C++ program that calculates the least squares line for two sets of values. The program…
A: #include <iostream>#include<fstream>using namespace std;int ReadFile(int *a,int…
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: Write a void function that will merge the contents of two text files containing the chemical…
A: This question is solved by C languages Programming. Program Plan :- merge2binary.c Define a…
Q: In C language, write the following two functions maintaining a database of entries of type song in a…
A:
Q: 6- Assuming myValues is an array of int values and index is an int variable, both of the following…
A: 6) True. cout<<myValues[index]<<endl; This code outputs the value in array…
Q: Q: Write a program in C++ to ask the user to enter five complex numbers in a file called…
A: ALGORITHM:- 1. Take input for the 5 complex numbers using the loop. 2. Store them into the file. 3.…
Q: Computer Ścience The language used here is C++ Develop a C program that processes a file called…
A: The file is opened using the method in C, which is fopen(). The file needs to be saved in the same…
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: Write Program in C. A formatted file master.txt contains the employee code, name and basic pay of…
A: note: name of the input file used: example.txt name of the output file used: file.txt change them in…
Q: (19) A file named "Fruit.txt" contains unknown number of fruit (maximum number of fruit is 50). Each…
A: #include <iostream>#include <fstream>#define size 100using namespace std;int main(int…
Q: Write a function that generates a file with following parameters: def fillFile(fileSize, fileName):…
A: I will be using python to solve this question. Please thumbs up if i am able to help you :-)
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: C++ You will create a header file with implementation that performs the task. Together with the…
A: #include <iostream>#include"your header file name"using namespace std; int main(){ bool…
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: WAP
A: Source Code: #include <iostream>#include <fstream>#include <sstream>using…
Q: C++ You will create a header file with implementation that performs the task. Together with the…
A: PROGRAM: FILE NAME: “Myfunction.h” #ifndef H_Myfunction #define H_Myfunction #include…
Q: In the next steps, you use the Seek() method to reposition a file pointer so you can access a file…
A: Program: using System; using static System.Console; using System.IO; namespace Program { public…
Q: C++ The file text.txt contains a sentence text written in all small letters and does not have any…
A: Code: #include <iostream>#include <fstream>#include <string> using namespace…
Q: Problem Description: In this program, you will implement a Pig Latin converter that reads lines from…
A: def isValidWord(sent): consonant = ('B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q',…
Q: Write a C/C++ program that calculates the least squares line for two sets of values. The program…
A: Actually, file is a used to store the data
Q: Assume that the following information is stored in a text file called "data.txt". Fill in the blanks…
A: Use ifstream to read a file and then load one by one input and check for id only
Q: Solv *12.13 (Count characters, words, and lines in a file) Write a program that will count the…
A: Java code for the given scenario is as follows: import java.util.*;import java.io.*; class Main{…
Q: (a) Write a C function readNums() that takes a filename and an integer array, reads the integer…
A: // Declaring header files#include <stdio.h>#define MAX 1000 // Function to read numbersint…
Q: C programming - (image attached ) Write a programme called pgmTile which takes 3 arguments, an…
A: refer the solution in the below step
Q: e by calling the appropriate method of the Volume object which changes the value of the Volume. The…
A: Please use Python for this question. Please format code properly when answering the question.…
Q: 3 Linker Assigned Symbol Strength · The C-code below is one file, symbol.c. For each of the 10…
A: In this we have to find whether symbol is internal, weak external or string external Internal-This…
Q: Create a file named "pointer.c" and include the header file "pointer.h" Implement all functions…
A: We need to write a C program for the given scenario.
Q: Data File: Example #1 AAAAABBBBBCCCCCDDDDD AAEBCBAFBBCDCECDADDEFEEFFF Example #2…
A: PROGRAM: //Header File import java.io.File; import java.io.FileNotFoundException; import…
Q: Use C++ Language Problem 2 (Save and Get Info): Write a program that asks for the user's name,…
A: Use C++ Language Problem 2 (Save and Get Info): Write a program that asks for the user's name,…
Q: A photographer is organizing a photo collection about the national parks in the US and would like to…
A: The Answer start from step-2.
Trending now
This is a popular solution!
Step by step
Solved in 4 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
- 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(....); }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 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…
- Create a new file in c++ and save it as lab11_XYZ.cpp (replace XYZ with your initials). Create ANOTHER new file (in C++) and save it as swap_XYZ.h (replace XYZ with your initials). Use the swap_XYZ.h header file to define a set of functions for swapping two items of the same type. Given the following prototypes, define (overloaded) swap functions void swap(int&, int&); //swap two integers void swap(double&, double&); //swap two doubles void swap(float&, float&); //swap two floats void swap(char&, char&); //swap two characters void swap(string&, string&); //swap two strings The header file should contain the following: header comments (similar to normal program header comments) function prototypes (provided above) function definitions (for you to do...) In general, a swap works like this: void swap(type first&, type second&){ type temp = first; first = second; second = temp; } Once your header file (H file) is complete, make…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.Please properly comment your code before submission.Write the following two functions in c programming language maintaining a database of entries of type song in a file. (see .h file for the definition of the struct song) int add_song(const char* file_name, const song s);The function gets the name of a file, and a song. If the song is not in the file, the function adds it to the file and returns 1. Otherwise, the function does not modify the file and returns 0. song* find_song(const char* file_name, const char* title); The function gets the name of a file and a title of a song. It searches the file for the song with the given title. If a song is found, it returns a pointer to the song with all the details. If not found, the function returns NULL. You may assume the song titles are unique.
- 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 ?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…In C++, write a program that creates a file in C and appends the following details from the user: Student Number: Name: Course: Age: Note: Use struct to store the input values from the user and same struct be used to append its values to the created file.