C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Fill-in-the-Blank
The __________ operator is used to dynamically allocate memory.
Fill-in-the-Blank
When a program is finished with a chunk of dynamically allocated memory, it should free it with the __________ operator.
Assume the following C code is stored in a file named main.c. Please split it into two files where each file
contains one function. Specify the content of each file and extra files (and contents) that might be needed.
void swap(int *a, int *b){
int temp = *a;
*a = *b;
*b = temp;
}
void main(){
int a = 5;
int b = 6;
swap(&a, &b);
}
Chapter 14 Solutions
C++ How to Program (10th Edition)
Ch. 14 - (Fill in the Blanks) Fill in the blanks in each of...Ch. 14 - (File Matching) Exercise 14.3 asked you to write a...Ch. 14 - (File Matching Test Data) After writing the...Ch. 14 - Prob. 14.8ECh. 14 - (File-Matching Enhancement) Its common to have...Ch. 14 - Write a series of statements that accomplish each...Ch. 14 - Prob. 14.11ECh. 14 - (Telephone-Number Word Generator) Standard...Ch. 14 - (sizeof Operator) Write a program that uses the...Ch. 14 - Prob. 14.14MAD
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Answerarrow_forward(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.arrow_forwardFunction_______________ is generally used to write data to a random-access file.arrow_forward
- Program language: C++ A publishing company markets both hardcopy and eBook versions of its work. Create a class publication that stores the title and price of a publication. From this class derive two classes: book, which adds a page count, and digital, which adds a storage capacity in MG bytes. Each of these classes should have a getdata() function to get its data from the user at the keyboard and put a putdata() function to display its data. Add a base class sales that hold an array of three floats so that it can record the dollar sales of a particular publication for the last three months. Include a getData() function to get three sales amounts from the user and a putdata() function to display the sales figures. Modify the book and digital classes so they are derived from both publication and sales. An object of the class book or digital should input and output sales data along with its other data. Write the main function to create a book object and a digital object and test their…arrow_forward9act1 Please help me answer this in python programming.arrow_forward** Java Programming ** Please Use Basic Java not GUI •Pharmacy Management System• Your job is to think of a scenario of a Pharmacy! Where various types of medicines are sold! In this pharmacy, there will be 3 parts! Part-1: Admin In the admin part, the admin can add, delete medicines serially wherever he wants! (Medicine Name, Price)! All the added medicines will be stored in ‘Medicine.txt File’ there will be an admin id password! If the input password is wrong it will throw an exception! Part-2: Customer In the Customer Part, There will be 3 portions 1st one is for Sign Up, 2nd one is for Login and the last one is continuing as a guest! In Sign up part, the Customer needs to sign up for Shop Membership. After successful signup customers' data(name, age etc.) will be stored in a different file named ‘Customer Info.txt’! Then log in, in this portion customer needs to log in to his account to buy medicine! The customer will input the serial number and the quantity of the medicine which…arrow_forward
- Fill-in-the-Blank __________ variables are designed to hold addresses.arrow_forwardwrite a complete statement write the declaration of P (a pointer to integer) * write the declaration of fin (input file stream that opens the file "mydata.txt") * write the declaration statement for funx (a float function with two integer arguments x and y both passed by reference) * read a character from the file fin and assign it to the variable T. * declare a pointer with the name Pnt1 to that points to the integer variable X. * close the file fin * Make the value pointed to by the pointer Ptr zero. *arrow_forward1. Declare a file pointer called input. Open a file called location.txt for reading using this pointer. 2. If the file is not available, display “File does not exist. ". 3. The content of the text file location.txt is as shown below. It includes the location, latitude and longitude values. FILE location.txt CONTENTS UTM 1.5523763 103.63322 KLCC 3.153889 101.71333 UM 3.1185 101.665 UMS 6.0367 116.1186 UNIMAS 1.465174 110.4270601 Ask the user to enter a location. Check if the user's location can be found in the text file. If found, display the location, latitude and longitude as shown below. SAMPLE OUTPUT Enter a location: UM : UM : 3.1185 : 101.6650 Location Latitude Longitude Otherwise display “Sorry, location could not be found". SAMPLE OUTPUT Enter a location : MMU Sorry, location could not be foundarrow_forward
- 1 Goals Use C++ to read data from a text file and create an array of numbers. Use the C++ 'fstream' library functions to open, read and close a text file. You can use the C++ 'iomanip' library to format your output and manage whitespace on your input. Graduate students must create and write the data to a new text file. 2 Your assignment is to create a program that does the following: a. You will need to create a new file (you can do this in the file system – make it plain text) and call it mydata.txt. b. Put a column of numbers in the text file to read later. Pay attention to type – make them all have decimal points. In repl.it, use the numbers in my file. c. Based on the examples in the slides (L3) and the textbook, write a C++ program, include 'iostream' and 'fstream'. You might need 'iomanip'. d. Your program should read the numbers from the file into an array and print the array to the console in reverse order using a for loop. e. Graduate Students must also print the output to a…arrow_forwardInstructions: You are strictly not allowed to use anything other than pointers and dynamic memory. One function should perform one functionality only. Task 1 Write a program in C++ that reads data from a file. Create dynamic memory according to the data. Now your task is to perform the following task. Row wise Sum Column wise Sum Diagonal wise Sum Example data.txt 4 5 1.6 10.2 33.7 99 20.5 3 44 50 96.1 2 8 9 4 74 50 99 19.1 Output: Sum row wise: 165, 191, 17, 242.1 Sum col wise: 127.6, 120.1, 228.8, 118.1, 20.5 Sum diagonal wise: Not Possible Note: You are restricted to use pointers and your function should be generic. Avoid memory wastage, memory leakage, dangling pointer. Use regrow or shrink concepts if required.arrow_forwardC++ Programming How many bits in a byte? multiples of 8 bit How many bytes in a double? __________ When assigning a float variable to an int variable, what is lost? __________ In the statement x = y; which variable is updated, x or y? _____ What include file is needed to make use of vector variables? ________ Give an example of a unary operator and a binary operator. _________ Write a line of code that declares an int type of variable and initializes it to the value 23. ____________________________ A variable declared outside of any function is called a __________ variable. You end a multi-line comment with ______________. What do you call the variable RATE in the following statement: const double RATE = 0.75; _________________________ What is the function performed by the cout object? ____________________ You can put several statements on the same line, true or false? _______ Write a single statement that outputs two variables x and y to the screen. _____________________ After the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License