Write a program that opens a text file and reads it

Assignment Help C/C++ Programming
Reference no: EM131839644

Problem

1. Write a program that opens a text file, reads it character-by-character to the end of the file, and reports the number of characters in the file.

2. Do Programming Exercise 6 but modify it to get information from a file. The first item in the file should be the number of contributors, and the rest of the file should consist of pairs of lines, with the first line of each pair being a contributor's name and the second line being a contribution.

Exercise 6

Put together a program that keeps track of monetary contributions to the Society for the Preservation of Rightful Influence. It should ask the user to enter the number of contributors and then solicit the user to enter the name and contribution of each contributor. The information should be stored in a dynamically allocated array of structures. Each structure should have two members: a character array (or else a string object) to store the name and a double member to hold the amount of the contribution. After reading all the data, the program should display the names and amounts donated for all donors who contributed $10,000 or more. This list should be headed by the label Grand Patrons. After that, the program should list the remaining donors. That list should be headed Patrons. If there are no donors in one of the categories, the program should print the word "none." Aside from displaying two categories, the program need do no sorting.

Reference no: EM131839644

Questions Cloud

What are the three steps in using a function : What are the three steps in using a function? Construct function prototypes that match following descriptions igor() takes no arguments and has no return value.
Describe the relationship of the leaders : Describe the relationship of the leaders, departments, and personnel within the organizational chart.
Implementing standardized terminologies within ehrs : Discuss the major local, national, and international obstacles to implementing standardized terminologies within EHRs.
Recommend an experimental drug that requires bone marrow : The Johnson's have 2 children. Both young boys. Adam is 6 and John is 3. Adam was diagnosed with Acute Leukemia 7 months ago.
Write a program that opens a text file and reads it : Write a program that opens a text file, reads it character-by-character to the end of the file, and reports the number of characters in the file.
How does an industry characterized as having economies : How does an industry characterized as having economies of scale effects serve as a barrier to entry?
Explain exactly what ivf is : Explain exactly what IVF is. Also, explain the advantages and disadvantages of IVF. Last, explain what role the health of the male reproductive system plays
Write a program that can list members by real name : Write a program that can list members by real name, by job title, by secret name, or by a member's preference.
How do the results of the analysis equate to strategy : What does one do with the information? In other words how do the results of the analysis equate to strategy?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Ansi-c program which allows the user to play a game

Your task is to write an ANSI-C program which allows the user to play a game. This will require I/O from both the user and from ?les.

  Create a class named realtorcommission.

Create a class named RealtorCommission. Fields include the sale price of a house, the sales commission rate, and the commission.

  Program for how to indicate the family member entry

Program for how to indicate the family member entry is complete

  Write the class definition for a class called complex

. Write the class definition for a class called complex.

  C++ is not case sensitive

C++ is not case sensitive, Declarations can be placed anywhere in the program, Statement and declarations must end with a semicolon

  Write a c++ statement that outputs the data stored

Write a C++ statement that declares student to be a personType object, and initialize its first name to "Buddy" and last name to "Arora".

  Write a reservation system for an airline flight

Write a reservation system for an airline flight. Assume the airplane has 10 rows with 4 seats in each row. Use a two dimensional array of strings to maintain a seating chart. In addition create a array to be used as a waiting list in case the pla..

  Calculate the total volume for all three boxes

Calculate the total volume for all three boxes in question.Add a third box to the calculation.

  Write procedure sort that swaps its three inputs

Write a procedure sort3(int& a, int& b, int& c) that swaps its three inputs to arrange them in sorted order. Without actually compiling and running a program, determine the results of the given function calls.

  Write a program to open a file for reading

Write a program to open a file for reading that has twenty (20) rows and in each row there are three (3) columns.

  Pre and post increament and decrement operators

We are going to overload the following operators in the fract class- pre and post increament (++) and decrement (--) operators

  What will be the contents of the list after the function

The following c function takes a singly linked list of integers as a parameter and rearranges the elements of the list the function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order what will be the contents of the list..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd