Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

C++ Homework to be done

i want someone to do this assignment for me.. its only a question..

i need it in 6 hours..

(

 

 

3)    Write a C++ program that calculates the average of measurements of Oak tree leaves.The measurements are in a text file called oakIn.txt. The file is provided to you on the blackboard. Follow the following requirements

1.     Declare  an array to hold the data in the main() program.

2.     Write a function to read the data from the file into that array (ReadFile()) and call it from main(). The function should return TRUE if the file was successfully opened and read. It should return FALSE otherwise; i.e. if it encounters any problem.

3.     Write a function called FindAve() that returns the average of the leaves’ measurements stored in the array. Call this function from main() and pass it the array that contains the data.

4.Within main(), after data is read in and average leave length is calculated, write code that opens an output file named oakOut.txt and writes into it a statement that includes the calculated leaves average length value; something like this

 

Average leaves length was calculated to be x.xxx.

 

)

 

the input file for this assignment..

is

 

CPP Phone Company
John Doe
2016
12.4
23.1
34.6
32.4
52.3
21.5
23.7
45.3
23.4
51.3
45.2
23.7

i have almost done the program because i have an example of it. i did some changes on it. all i need is editing and making sure about the required output.. if you are expert enough it won't take more than 15 mins!!!!

here is the program for the example i have..

----------------------------

#include <string>

#include <fstream>

#include <iostream>

usingnamespacestd;

 

#define FILE_IN    “oakIn.txt”

#define FILE_OUT   “oakInAverage.txt”

 

 

bool ReadFile(float Oak_measurements[], string &rwidth, string &rheight);

bool FindAve(string height, string width, float sum, float ave);

 

int main()

{

    float Oak_measurements[12], sum = 0.0, ave = 0.0;

    string height, width;

    bool rc;

    

    

    rc = ReadFile(Oak_measurements, width, height);

    

    

    for (int i = 0; i < 12; ++i)

    {

        sum += Oak_measurements[i];

    }

    ave = sum / static_cast<float>(12.0);

    

    

    rc = FindAve(height, width, sum, ave);

    

    getchar();

    return(0);

}

 

 

bool ReadFile(float measurements[], string &rwidth, string &rheight)

{

    ifstream oakInput;

    

    oakInput.open(FILE_IN);

    

    if (!oakInput)

    {

        cout << “n Failed to open file “ << FILE_IN;

        returnfalse;

    }

    

    

    getline(oakInput, rheight);

    

    

    getline(oakInput, rwidth);

    

    

    

    for (int i = 0; i < 12; ++i)

    {

        oakInput >> measurements[i];

    }

    

    oakInput.close();

    

    returntrue;

}

 

 

bool FindAve(string height, string width, float sum, float ave)

{

    ofstream oakOutput;

    

    oakOutput.open(FILE_OUT);

    

    

    

    if (!oakOutput)

    {

        cout << “n Failed to open file “ << FILE_OUT;

        returnfalse;

    }

    

    

    oakOutput << “nAverage leaves length was calculated to be: “ << ave;

    

    

    oakOutput.close();

    

    returntrue;

}



thank you,

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW


Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.