Write a c program to read from a file called input

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

Assignment: Reading from a File and using a multi-dimensional array

Write a C program to read from a file called "input.txt" information about 5 workers. Each line of input would contain two values respectively, an employee ID and the employee's monthly salary.

Assume that the data from the input file is stored in a format as shown in this example. Note: for testing purposes, the following data may not necessarily be used. It is just to give you an idea of the format of the data:

Sample contents of input.txt:

10 2000

20 6800

30 9700

40 1500

50 8000

Store the employee information into a 2D array. Assume that the data types are as follows: id (integer data type) and income (integer data type).

Read the information and store the 5 employee records into the 2D array.

Use a function that prints the sum of all income of workers.

Create another function that prints the number of workers who has an income of greater than $5000 and also the ID and income of each worker who has an income of greater than $5000.

Sample output printed to the screen:

Sum of all incomes: $24500

3 Workers have an income of greater than $5000:

20 $6800; 30 $9700; 50 $8000

Reference no: EM131274376

Questions Cloud

Calculate the critical fiber length : Calculate the critical fiber length and compare with the case when 1-μm alumina whiskers are used instead of the coarser fibers. What is the minimum aspect ratio in each case?
Identify one ambiguous word or phrase : Identify one ambiguous word or phrase in the court's decision in Case, and show how that ambiguity affects your willingness to accept the court's conclusion.
Entertainment and arts management and music industry : What's the difference between Entertainment and Arts Management and Music Industry?
What are the most important things for case managers : Describe specific things case managers should and should not do in order to create a warm and welcoming and "culturally safe" environment for people from this culture or group who wish to utilize case management services.
Write a c program to read from a file called input : Write a C program to read from a file called "input.txt" information about 5 workers. Each line of input would contain two values respectively, an employee ID and the employee's monthly salary.
Which ethical norm is the court showing it prefers : If you were charged with defending a pharmaceutical company, what would you advise the company to do to encourage a court in a future case to reject the learned intermediary doctrine?
Method for accessing an ehr application : How does client-server model differ from a SaaS model as a method for accessing an ehr application?
Compare the specific modulus for all three materials : A titanium alloy with a modulus of elasticity of 16 × 106 psi is used to make a 1000-lb part for a manned space vehicle.
Probable price increases on the movement of bakken : Does the probable price increases on the movement of Bakken crude justify economically reregulating the railroads? If so, to what extent?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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