How to write a program that asks the user to enter an item’s wholesale cost and its markup percentage in C++? It should display the item’s retail price and use file separation
Q: LAB Q - Write a program in c to read names from the file "name.txt", which include (10) names ,then…
A: to use string function string.h header file is include strlen() is use to calculate length of…
Q: It seems like the 'stoi' function doesn't work for my version of C++. How could I change this?…
A: From the problem described in question, looks like you are using an older version of c++ compiler.…
Q: Discuss the working of good() and bad() functions in file I/O error handling
A: C++ provides many built-in functions for handling the errors while working with the file I/O…
Q: In this laboratory work, you are expected to write a c# console application to make some operations…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: نقطة واحدة The command COUT stored in the library <#include<math.h False True نقطة واحدة The…
A: C++ is a Object Oriented programming language which is also known for its rapidness. It is also an…
Q: Write a python program that will open a file and place each line of text from the file into a Python…
A: Python Code numOfLine = 0 numOfWords = 0 numOfChars = 0 numberOfDigit = 0 numberOfUpperLetter = 0…
Q: Using the data file capabilities of C++, create a Personnel file, personnel.dat on your drive and…
A: Program Instructions:Use do-while loop to repeatedly present the menu.Use switch statement to opt…
Q: What does function pow serve? Which header file must be included in order to use the function pow?
A: Syntax of pow() : pow(double x , double y) Purpose of pow(): The purpose of pow is to calculate the…
Q: Using C/C++ language, Write a function to output patient information that are stored in a file. One…
A: Given: Write a function to output patient information that are stored in a file. One of the…
Q: answer in c program -Write a function to output patient information that are stored in a file. One…
A: Code: # include <stdio.h> # include <string.h> void showInfo(int n,char*…
Q: in c++ : Write a function to count number of words in a text file named "story.txt".
A: Code: #include <iostream>#include <fstream> using namespace std; int main() { string…
Q: 9. Which of the following functions are related to working with text file in C programming? fprintf)…
A: Which of the following function are related to working with text files in c programming? Answer: D…
Q: How do I create multiple variables from the same line in an external .txt file in C++?
A: Syntax: filename<<var1<<var2<<var3; example: #include <iostream>#include…
Q: Read a text file and displays its contents on the screen., but replace every 'h' character it finds…
A: sample output
Q: Write a complete C++ program that helps a cerkat Muscat Post Office, to do the following tasks: 1…
A: I have written C++ code for the following question:
Q: Write a Haskell program copyIo.hs which has two command line arguments called file1 andfile2. Copy…
A: Below i have answered:
Q: Write a menu driven C++ program to perform the following four tasks in a single file, if user press…
A: #include <iostream>#include <iomanip>#include <string>#include…
Q: In C++, write a program that creates a file in C and appends the following details from the user:…
A: Sample Response: //C program to append record of student in the file by using…
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: o Write a C program that uses the sizeof operator to determine the sizes in bytes of the various…
A: the code is an given below :
Q: Hi. I made a code but I have to change it. These are the requirements for the program code • Safe…
A: According to the information given:- We have to change the code to fit its requirements.
Q: 2. Antares Shopping Mall organized a lottary for their customers. The customers filled out coupons…
A: Actually, program is a executable software that runs on a computer.
Q: A C++ program that reads the records from a golf.txt file and displays them. Quick and dirty…
A: The code in java is given in step 2:
Q: Using C programming language to write the following project. This week we'll make a primitive…
A: The complete code is given below.
Q: standard input and output operations in C++
A: Given :- In the above question , the statements along with the given options is mention in the above…
Q: a large corporation with two plants has discovered that some of its employees are on the payrolls of…
A: #include…
Q: Suppose that infile is an ifstream variable and employee.dat is a file that contains employees’…
A: C++ statement that opens this file using the variable infile:
Q: Write a program to create a file named Exercise13_1.txt if it does not exist. If it does exist,…
A: Answer:
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: Write a C++ program which takes 5 students’ information (records) as inputs from the user and save…
A: C++ code: #include <iostream>#include <fstream>using namespace std; int main(){…
Q: Code done in C Write a piece of code in a function called password that creates a file with a…
A: Below is the required C program: - Approach: - Include the header files. Define the function…
Q: Program 3 Write a C++ program that reads business card information from a file (you make up the…
A: Let's understand step by step : 1. Declare a string named text in which file sentences should be…
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: Which of the following libraries is used to make the programmer able to use the (cin) function in a…
A: Answer 1: A #include<iostream.h> is used for cin function in c++. Answer 2: A…
Q: Write a C++ function (along with helper functions if required) that takes a file stream as a…
A: Write a C++ function (along with helper functions if required) that takes a file stream as a…
Q: C++ , change the code to do the same purpose and same output :
A: #include<iostream>#include<fstream>#include<string> using namespace std; void…
Q: 11. How do you declare a preprocessor constant named RECORD COUNT with the value 1500? a. #define…
A: Task : Given the list of options for declaring the preprocessor. The task is to find the valid…
Q: In this laboratory work, you are expected to write a c# console application to make some operations…
A: To read the stored data from server to browser-var myObj = {name: "Kaan", age: 31, city:…
Q: In C, I need help in creating a function that will randomly select a line between 1 till 50 and then…
A:
Q: You have the following function. 1 def funct(a): file = open('file.txt') 3 while True: 4 line =…
A: To do: value of a
Q: Write 5 opening modes in standard C that is use for File I/O.
A: File opening modes in standard C: 1. 'r' mode: When file is opened in r mode, it is opened for…
Q: USING FILE POINTERS IN C PLEASE . Write a program that prints a table of all the Roman numeral…
A: In this question we have to write a C program to print roman numeral for first fifty numbers Roman…
Q: In C++, which command is opt to reserve space for variable value and which preprocessor directive is…
A: Answer in step2
Q: make a programm in c++ that ask user for the number of students whose records must be inserted in…
A: #include<bits/stdc++.h>#include<fstream>#include<conio.h> #include<stdio.h>…
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: n java create a function searchstd() that reads a search record from a text file file.txt when the…
A: Here is the java code: // Java Program to illustrate reading from Text File // using Scanner Class…
Q: Write C statements which tests to see if file has opened the data file successfully. If not, print…
A: Please find the answer below :
Q: in C#: Given a text file, write a program (console application) that counts the number of words…
A: Given: in C#: Given a text file, write a program (console application) that counts the number of…
Q: 8. Which function is used to write a single character to console in C++? a) cout.put(ch) b)…
A: option B: incorrect as, cout.putline(ch) no suh function in c++ option C: incorrect as,…
How to write a
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- In C++, which command is opt to reserve space for variable value and which preprocessor directive is required to use that command.How do C++ functions usually return floating-point values?Most C++ programs that do I/O should include the___________ header that contains thedeclarations required for all stream-I/O operations.
- In C++.......Write a program which prints the absolute value of 5 complex numbers (values read from file) and then sorts them from maximum to minimum. Read the values from a file. Use the following structure struct Complex { float x , y ; }; struct Complex read ( ) ; void Display( struct Complex a ) ; struct Complex AbsoluteValue ( struct Complex a ) ;In C, I need help in creating a function that will randomly select a line between 1 till 50 and then extrapolate that specific line from a text file .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…
- Create a program in c++ that allows you to view and edit the sales amounts for each month of the current year. Please use the required specifications for the Monthly Sales program. Console Monthly Sales program COMMAND MENU add - Add sales for a specified month view - View sales for specified month edit - Edit sales for specified month totals - View sales summary for the year exit - Exit program Command: add Three-letter Month: jan Sales Amount: 10317 Sales amount for Jan is 10,317.00. Command: add Three-letter Month: feb Sales Amount: 15293 Sales amount for Jan is 15,293.00. Command: view Three-letter Month: jan Sales Amount: 14317 Sales amount for Jan is 14,317.00. Command: edit Three-letter Month: jan Sales amount for Jan is 14,317.00. Command: totals Yearly total: 29,610.00 Monthly average: 14,805.00 Command: view Three-letter Month: july Invalid three-letter month. Command: exit Bye! Specifications The program should use a list to…Write a program in C++ game guess a number. ignore variables like i,j,k name variables correctly. If code in main is more than 7 lines then use user defined functions. Features: 1-Use file handling to allow user which you choose to enter this game. 2-Private users only enter this game via pin code. 3- 3 levels easy medium hard (easy means 8 tries,medium means 5 tries,hard means 2 tries) 4- Computer tells you guess is too low,too high or correctFor the following program: Please create a program in C++ that allows you to view and edit the sales amounts for each month of the current year. Console Monthly Sales program COMMAND MENU view - View sales for specified month edit - Edit sales for specified month totals - View sales summary for year exit - Exit program Command: view Three-letter Month: jan Sales amount for Jan is 14,317.00. Command: edit Three-letter Month: jan Sales Amount: 15293 Sales amount for Jan is 15,293.00. Command: totals Yearly total: 77,786.71 Monthly average: 6,482.23 Command: view Three-letter Month: july Invalid three-letter month. Command: exit Bye! Specifications The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) as the key for each item. When the program starts, it should read the sales data inserted from the user. If the user edits 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, using switch statements and/or cascaded if statements, write a program that takes a numerical grade from and input file, and converts it into a letter grade. Use the following grading scale: 90-100=A, 80-89=B, 70-79=C, 60-69=D, 0-59=F. Print an error message if the grade is larger than 100.(Data processing) Write a C++ program that reads the file created in Exercise 4 one record at a time, asks for the number of hours each employee worked each month, and calculates and displays each employee’s total pay for the month.