Task 1: Declare parallel arrays in the main function to store the following types of information: a) The year. b) The mumber of deaths caused by each disease type (dengue and malaria). Task 2: Write a function named "readInput". a) This is a non-retuming function. b) It receives parallel arrays defined in Task 1. c) The function should assign the required values to each element of the parallel arrays by reading the data from the text file named "input.txt". The file includes the year as well as the mumber of deaths caused by dengue and malaria. Figure lis the content of the "input.txt" file. Please ensure that the program only contimues reading the file if it is successfully opened; otherwise, print the error message and exit the program.
Task 1: Declare parallel arrays in the main function to store the following types of information: a) The year. b) The mumber of deaths caused by each disease type (dengue and malaria). Task 2: Write a function named "readInput". a) This is a non-retuming function. b) It receives parallel arrays defined in Task 1. c) The function should assign the required values to each element of the parallel arrays by reading the data from the text file named "input.txt". The file includes the year as well as the mumber of deaths caused by dengue and malaria. Figure lis the content of the "input.txt" file. Please ensure that the program only contimues reading the file if it is successfully opened; otherwise, print the error message and exit the program.
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
Related questions
Question
USE C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
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.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning