+1 (315) 557-6473 

Highest Quality Input Data File Program Homework Help Using C++

We are the number one provider of top-grade input data file program homework help service. We know for you to submit quality solutions, your homework must be prepared by seasoned experts. As a result, we have hired skillful C++ homework tutors to assist you. If you have any doubts about your homework , then do not hesitate to take our reliable input data file program homework help. The best thing about our service is you can get in touch with us at any time of the day or night.

Custom Input Data File in C++

First, create a custom input data file. The file contains the name of a town and seven population values. The name of the town will be your first name. The seven population values will be derived from the digits in your ACCeID. It will be a text file and can be made with any text editor, such as notepad. You can use your C++ programming editor. Do not use any punctuation or special characters. To create your input data file.
Get your ACCeID. This starts with one lowercase letter, followed by 7 digits. The first letter is usually the first letter of your first name. Example: Abernathy Zappa’s ACCeID is: a1234567.
Enter your first name represented by the letter. Then multiply each digit by 1000 and separate with some whitespace. Whitespace can be one or more spaces, tabs or newlines. Create the following data (example):Abernathy 1000 2000 3000 4000 5000 6000 7000
If a digit is a 0, use 9 instead. The problem with 0 is that no data is displayed in the chart. For example: Mindobiz Soo’s ACCeID is: m7032901. The data file will contain:Mindobiz 7000 9000 3000 2000 9000 9000 1000
Save this to a file; use the file naming convention, but use a .txt extension, not .cpp. For example:
DLS_L5_Lastname.txt. For the examples above, the filenames would be: DL1_L5_Zappa.txt or DL1_L5_Soo.txt, assuming a section number of 1. Use your section number.

A Program that Reads Data from the File

Next, write a program to read the data from this file and display a population bar chart. The program should:
Read the file DLS_L5_Lastname.txt made above. If the file is not found, handle the situation appropriately with a good error message, including the name of the file not found, then stop. Do not attempt to display a chart if no data is available. If the file opens OK, read the name of the town. At the top, display a title so the user knows what this chart represents. Use toupper on each letter of the name so the name is fully uppercase. For example, display:
ABERNATHY POPULATION GROWTH
(each * represents 1000 people)
2) Use all the data in the file to display a bar chart showing population growth.
3) Make the program more flexible: read population values from the file until end-of-file (instead of 7 times). It should work if there are more or less than 7 population values. Handle population values until end of file.
Example output: (bar chart)
MINDOBIZ POPULATION GROWTH
 (each * represents 1000 people)
1900 *******
1920 *********
1940 ***
1960 **
1980 *********
2000 *********
2020 *
You program can assume:
1) Population numbers start at the year 1900 (or 1910); (some textbook editions start at 1900, some start at 1910; it doesn't really matter)
 2) Population counts are provided in 20 year increments; 3) seven population counts provided. For working code that reads data from a file, see: "Program Samples", Simple FileIO. This provides a complete, working FileIO example.

C++ Code Solution

#include
#include
#include
#include
using namespace std;
// Entry point of the program
int main()
{
 // Open the file
 ifstreaminFile("DL1_L5_Maria.txt");
 // Stop program if it can't be opened.
 if (!inFile.is_open())
 {
  cout<< "Error: Failed to open input file DL1_L5_Maria.txt" <
  return 0;
 }
 // Read the title
 stringtownName;
 inFile>>townName;
 // Convert all letters of town name to upper case
 for (unsigned i = 0; i
  townName[i] = toupper(townName[i]);
 // Display a bar chart for each year from 1900 onwards with increments of 20 years
 cout<
 cout<< " (each * represents 1000 people)" <
 int population;
 for (int year = 1900; inFile>> population; year += 20)
 {
  cout<< year << " ";
  for (inti = 0; i< population; i += 1000)
   cout<< "*";
  cout<
 }
 inFile.close();
 return 0;
}

Related Blogs

C# or C++ better for game design?While there are hundreds of programming languages that can be used for gaming applications, game developers use only a few. C sharp (C #) and C + + are among the most popular languages in game design, which begs the question, “Is C# or C++ better for game design?” We...

2021-06-25
Read More

Scheduling algorithms in C++Algorithm scheduling is the process of determining which algorithm or line of code will be executed in the Central Processing Unit (CPU) and which one will be put on hold awaiting processing. In C + + programming, scheduling ensures that there is always an algorithm avail...

2021-06-25
Read More

Tips To Get The Best Out Of Your C++ Programming Homework HelpIf you are seeking C++ homework help online, that means you are not only expecting quality work but also, timely submissions. It’s evident that most homework helping organizations fail to meet the student’s expectations, once in a while. ...

2021-06-25
Read More

The Best Reliable C++ Homework Help Service in AustraliaC++ is a general-purpose programming language mainly known for its object-oriented programming features but being low-level than its other popular counterpart Java. Apart from being object-oriented, C++ also supports imperative and generic prog...

2021-06-25
Read More

How to Better Your C++ Coding Skills This SummerBrace yourself, summer is here! With it comes more time which is often limited during the rest of the year. During summer, as a programming student you have two options: 1) You can choose to chill with your mates and family, 2) Or, you could invest par...

2021-06-25
Read More