Write a program that reads in from a file two month names

Assignment Help Computer Engineering
Reference no: EM132182802

I was wondering if I could get some help on the last program I need to complete for an engineering C++ class. It is a very simple program however there is one part of the problem stumping me. Here is the problem statement

Write a C++ program that reads in from a file two month names, followed by the rainfall amounts for each month in that span of months.

These rain amounts are totaled, and then an average for each month in the span of months is calculated. Because the program does not know how many months of rainfall data there is, it must read and process data values until the end of file is encountered. The data for this program can be found in the Rainfall.txt file, which is located in on Blackboard

Below is the file data. As you can see it is extremely simple however I cannot for the life of me figure out how to make the program distinguish between strings and numeric data to sort into respective arrays.

I have tried 2d arrays, Two 1D arrays, the peek function, getline functions and a multitude of other approaches.

Reference no: EM132182802

Questions Cloud

Implementing social and economic reforms : If populist leaders are implementing social and economic reforms across Latin America that benefit the masses, does it matter that they consolidate power?
Reflect which takes any string and returns the string : Write a function called reflect which takes any string and returns the string forward and backward.
Describe prototyping and provide your reasoning : Describe prototyping and provide your reasoning for whether or not you will be using it at this point in the project.
Discuss your experiences with bluetooth hacking : Discuss how they would envision the devices that they own working together and how that might be done in a secure manner.
Write a program that reads in from a file two month names : Write a C++ program that reads in from a file two month names, followed by the rainfall amounts for each month in that span of months.
Compression and analog to digital process : Without quantization is there any possibility of losing some amount of information in compression and analog to digital process?
Create and use a subroutine that takes single character : Create and use a subroutine that takes single character parameter and displays a count of the number of environment variables that start with the subroutine.
Compute the number of words-lines in the input file : Compute the number of words/lines in the input file and print the result to the output file. 4. Document the program using Python comments.
Why are wireless transmissions being lost in transit : For good measure, you also walk around the office space with your wireless analyzer to confirm that there are no significant dead zones or interference.

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Describe three types of online contracts

Describe three types of online contracts that people and organizations commonly enter into on a frequent basis.

  Write down a program to solve linear system

Write down a program to solve linear system

  Describe the security issues of bcbst

Describe the security issues of BCBST in regard to confidentiality, integrity, availability, and privacy based on the information provided in the BCBST case.

  Creation of process mapping descriptions

INF80028 – Business Process Management - Swinburne University of Technology - Creation of process mapping descriptions using Business Process Modelling Notation

  Discuss how wireframe displays might be generated

Discuss how wireframe displays might be generated with the various visible-surface detection methods discussed in this chapter.

  What are advantages and disadvantages of separate address

The 68000 implements negative addresses because the contents of address registers are treated as 2's-complement values. What is a negative address.

  What is the maximum number of different points

What is the maximum number of different points that can have a given point p as its nearest neighbor, again in two dimensions?

  Write a program to find the number of intersecting pairs

Write a program to find the number of intersecting pairs among a set of N random horizontal and vertical lines, each line generated with two random integer.

  Face-to-face contact would be expected

Some though argue that non-verbal clues quite often inhibit, rather than enhance, communications. We get distracted by accents, appearance, mannerisms, dress-style etc, and do not pay sufficient attention to the message being delivered. If that is..

  Explain the factors that went into your decision

Explain the factors that went into your decision, the design alternatives you considered, your evaluation of design decisions, and the reasoning for your final

  Gives complete bibliographic information for each reference

Provide complete bibliographic information for each reference (see any paper in IEEE Trans. Computers for examples). As a rule of thumb, citing 5-20 references is reasonable.

  Write a program that draws iterations of the snowflake shape

Write a program that draws the iterations of the snowflake shape. Supply a button that, when clicked, produces the next iteration.

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