Exercise 5: Write a C++ program which reads from a file inventory records of some items (“inventory.txt"), item and the price and the count of that item. The program calculates the total cost per item and the overall cost and the output should be saved in a file called("report.txt") as shown below. dra inventroy.txt Notepad aboard Font Paragraph File Edit Format View Help 101 112 2.8 400 033 5.00 700 604 1.00 1900 1.5 1200 Item Price Total cost 101 1.500 1800.000 112 2.800 1120.000 33 5.000 3500.000 604 1.000 1900.000 The overall cost = 8320.000
Q: Differentiate between manually matching transactions and Advanced Mode transactions in QuickBooks De...
A: Introduction: Bank feeds can be set up and managed in a variety of ways. After obtaining your electr...
Q: Find a Topological Ordering Consider the following graph: a b. C e f Provide a topological ordering ...
A: Below is the answer to above question. I hope this will be helpful for you....
Q: Find n the node from the end of a Linked Lis
A: Below the n the node from the end of a Linked List?
Q: Explain what Unix data structures are affected when an open() call is used on a device file. How is ...
A: The question is on what Unix data structures are affected when an open() call is used on a device fi...
Q: Answer the following... 1. What are functional requirements? 2. What are non-functional requirements...
A: I'm providing the answers of all questions. I hope this will meet your requirements....
Q: Now suppose you have a composite signal (composed of many frequencies). If the frequencies range fro...
A:
Q: Write a java program to find the 2nd largest number in the array and explain program with comments.
A: import java.util.*;public class Main { public static void main(String[] args) { int[] arr ...
Q: What is the function of the R.java file, which is automatically produced by the Android SDK, and why...
A: EXPLANATION AND ANSWER: R.java is an Android Asset Packaging Tool-generated file containing all the ...
Q: Discuss the concept of User thread to Kernel thread mapping
A: ANSWER:
Q: Using GitHub to manage and switch between various branches
A: GitHub: Git is software that allows you to monitor changes in any group of files. It's typically us...
Q: A university professor who works with sensitive medical information exchanges a private file with a ...
A: Introduction: In this scenario, the professor is to blame for sharing a private material with a stud...
Q: Write a Python program to get a list of 11 heterogeneous type elements, sort it in increasing order,...
A: l=list(map(int,input().split()))l.sort() print(l)print("repition of first 3 elements are ",l[:3]*3) ...
Q: What exactly is a database management system (DBMS)? Make a list of the positives and downsides.
A: Introduction: A database management system is abbreviated as DBMS. It's a collection of applications...
Q: Which of the following is NOT a string in the language of (a+b)(ba)*(b+ε)* a)abbbb b) bbaba c) a...
A: Given Language: (a+b)(ba)*(b+∈)* (a+b) : It generates only one length of string either a or b. (ba)...
Q: What Are the Advantages and Disadvantages of Cloud Storage for a Small Business?
A: Advantages Accessibility: Files in the cloud can be accessed from anywhere with an Internet connect...
Q: Discuss the ways in which electronic communication across diverse development teams might aid in the...
A: Introduction: Electronic connection is critical for an organization's development process to be tra...
Q: hich of the following is the resulting NFA when Thompson's algorithm is plied to 0*(1+£) ?
A: 0*(1+€) means the NFA accepts zero or more 0's followed by 1 or €. Here even empty language is accep...
Q: evaluate a int data type using switch, the evaluated variable needs to be enclosed in single quotati...
A: The idea is that when building text strings that contain quote marks and apostrophes, you must be ca...
Q: Let U=(2,-1,0,-3) ,V=(1,-1,-1,3) and W=(1,3,-2,2) then U.V is:
A: Lets see the solution.
Q: Multitasking is Oa multiprogramming Ob. sequential Oc. concurrent Od timeshare O e. parallel
A: Multi tasking:
Q: ze.cpp x | (Global Scope) ahrenheitTemp.txt 29 crates file to write in 30 31 ofstrean outfle; 32 // ...
A: Please refer below for your reference: The code c26451 is below: Arithmetic overflow: Using operator...
Q: Data mining: Explain the fundamental concept driving data base analytics.
A: Introduction: Data mining: Explain the fundamental concept driving data base analytics.
Q: What is multimedia
A: To define multimedia.
Q: asser Architecture in terms of the followings 1) Registers 2) Program Structure (Data and Code decla...
A: The answer is
Q: Create a function that takes an argument by value as a const; then try to change that argument in th...
A: The code is written in C++ Create a function and take a cons argument. Then try to change the argum...
Q: Determine the five types of human activities that are influenced by big data and analytics.
A: Introduction: The table below summarises the types of human behaviour that have been influenced by b...
Q: Ib. Floating point addition/subtraction Take the last 5 digits of your student number (example, A,A‚...
A: We need to perform floating point addition.
Q: If you were in charge of a project, why would you utilise collaboration software?
A: Benefits of collaboration software.
Q: Q.6 Write a C++ program that takes 6 values from user and makes a multiplication table of those numb...
A: Explanation Here I have taken an array with size 6. Next, I have taken input from the user and sto...
Q: The first index value in string equal to .5 ...
A: Introduction String is a datatype supported by most of the high level programming languages like C+...
Q: en big endian and small endian computer architectures. Additionally, research the origins of this ph...
A: given - Explain the difference between big endian and small endian computer architectures. Additiona...
Q: If a computer is capable only of manipulating and storing integers, what difficulties present themse...
A: The answer as given below steps:
Q: Assume the target value is 8. Use the FIRST, MID and END enablers explicitly during the search proce...
A: def search(li, first, end, n): while first <= end: mid = first + (end - first) // 2 ...
Q: What exactly is the significance of employing keys?
A: Introduction: The Value of Keys: To identify a tuple in a table, you need a key. They make it possib...
Q: Computer science What are the major advantages and disadvantages of cloud-based data storage?
A: Introduction: This question discusses the key advantages and disadvantages of cloud-based data stora...
Q: Assume you've been invited to a developer interview at a software firm. You made a mistake in giving...
A: Introduction: You must express your regret by saying sorry because you are attending an interview fo...
Q: Design 4 networks each with 6 hosts for network 10.10.10.0 then write for each network:- 1-Network I...
A: The address 10.10.10.0 belongs to class A IP address where number of network bits is 8 and number of...
Q: The benefits of all-subsets regression over stepwise regression are discussed in detail below.
A: INTRODUCTION: Here we discussed the benefits of all-subsets regression over stepwise regression.
Q: Working in R Studio. Installed 'tidyverse' and 'nycflights13'. The question is: What five days of...
A: The answer is given in the below step
Q: Alice and Bob use the ElGamal scheme with a common prime q= 131 and a primitive root a = 6. Let Bob’...
A: The answer is
Q: What is the difference between global, external, static, local, and register variables in terms of s...
A: Introduction: The memory portion where variables and functions are stored is determined by storage a...
Q: to send a packet of 120 bits to the other, what is the distance m so that the propagation time equal...
A: The answer is
Q: o the following transformations on the rectangle shown in figure below in sequence. i) Shear the rec...
A: the solution is an given below :
Q: What word defines a product that includes all function inputs?
A: Introduction: The set of domains describes the function that includes all the inputs for the program...
Q: What is the distinction between the clc and clear commands?
A: Given: What is the distinction between the clc and clear commands?
Q: Password Spraying almost always causes account lockouts and therefore is not a popular attack tactic...
A: In Password Spraying, attackers uses brute force attack in which hackers test multiple user accounts...
Q: Imagine you are at an interview for an entry-level position in IT security. The interviewer asks you...
A: Security Testing: Security testing is a sort of software testing that identifies vulnerabilities, ha...
Q: Consider the following network address: 209.15.6.0/28 a. How many subnets are there in this network?...
A:
Q: What does it mean when people refer to an assembly language as such?
A: Introduction: Incorrect use of the word "assembler" when referring to the programming language itsel...
Q: If we add a positive constant to each of the array of values, then the z-score of an observation wil...
A: If we add a positive constant to each of the array of values, then the z-score of an observation wil...
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- (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.(Data processing) Write a C++ program that reads the file created in Exercise 4, permits the user to change the hourly wage or years for any employee, and creates a new updated file.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.
- Consider a file named transaction.txt which contains unknown number of lines. Each line contains data of one transaction as follows: username (string), amount (float), and membership number (int). Write a C++ program that reads the data from the file, then displays on screen the number of users, the total amount, the average of amounts, the lowest amount and the highest amount. Reading from the file should stop when one or more of the conditions given below becomes true:(a) The end of file has been reached. (b) The “user999” is reached.Consider a file named transaction.txt which contains unknown number of lines. Each line contains data of one transaction as follows: username (string), amount (float), and membership number (int). Write a C++ program that reads the data from the file, then displays on screen the number of users, the total amount, the average of amounts, the lowest amount and the highest amount. Reading from the file should stop when one or more of the conditions given below becomes true:(a) The end of file has been reached. (b) The “user999” is reached.transaction.txtHassan 12.5 12345 Mariam 5.2 87542 Zahra 33.1 93568 :::: ::Sample Screen OutputNumber of users: 54 Transactions total amount: 2658.7 The average of amounts: 120 The highest amount: 280 The lowest amount: 5.2Transcribed Image Text Problem 3) Create a text file that contains the following information: John Doe 2005 124.80 36 Note that the fist line represents the name of the client, the second line represents the year in which the client started an account with this insurance company. The third line represent the monthly payment for the insurance. The fourth line represents the number of months left in the insurance policy. Write a C++ program that will read this file and will display the client's name, the number of years for which this client has been with the company, and the remaining amount they have to pay
- Create a program that reads three lines from a text file. Each line should be read one at a time. For each word on a line, the user should be asked to specify how many syllables are in that word. The program should then inform the user if the file contains a valid Hiku using the function below: def isHiku (firstLine, secondLine, thirdLine):if (firstLine == 5 and secondLine == 7 and thirdLine == 5): return True return False print("The file contains a Hiku:", isHiku(5,7,5))Note: You must replace the values in the function with the numbers counted by your program.each line in the input file will represent a record of data. There will be 10 lines, thus 10 records. Each record (line) will consist of 3 space separated fields: a name (1 word as a string), and age (as an integer), and a wage (as a float). Write a C program that: takes an input file name from the command line; opens that file if possible; declares a C struct with three variables; these will have data types that correspond to the data types read from the file (i.e. string, int, float); declares an array of C structs (i.e. the same struct type declared in point c); reads a record from the file and stores the values read into the appropriate struct variable at the appropriate array index (for that record); continues reading each record into a struct (as in point 1e), and stores each struct containing the 3 values into the array of structs declared in point d; closes the file when all records have been read. should print an error message in the event that the file cannot be…Write a C++ program which takes 5 students’ information (records) as inputs from the user and save them on a file. Your program should have two options: writing and searching. When a user selects writing option, you are required to take three inputs from the user: student name (string type), student age (int type). After reading these data-items write to the file named “student.txt”. Please note: write data using append mode otherwise previous information will be lost.Your program should have a search function. The search function should provide three options for searching: by name, by age, or by registration number. After selection of the search option by the user, please take input (name, age, or registration number) and search that student from the file and display its record on the screen.
- 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 Program in CWrite a c program that counts the number of words and characters in a file. The program should do the following: Asks the user to input the name of the file to be opened. Display the contents of the file. Counts and displays the number of words and characters in a file. Exclude the spaces in the character count. Create a new file named “<inputted_file_name>_wordcharct.txt”, e.g. if the file name inputted in part a is “test.txt” then the file created should be named “test_wordcharct.txt”. Store the displayed information in this file Expected output: Sample 1: Input the file name to be opened: test.txtThe content of the file “test.txt” are: test line 1 test line 2 test line 3 test line 4 -----End of File---- The number of words in the file “test.txt” are: 12 The number of characters in the file “test.txt” are: 36The file “test_wordcharct.txt” containing the results was created successfully! Sample 2: (use this one in creating the program) Input the file…Write a C program for library management system fulfilling following details:addBook(): This function gives admin the right to add book and author name into thebookdetails[ ][ ].searchBook(): Takes the book name as an argument and returns true if the book exists and falsein case it doesn notdeleteBook(): Takes the book name as an argument and removes it from the bookdetails[ ][ ].bookdetails(): prints the complete record of the books the library contains.At the end, store the book details in a text file.