HW5 atas.txt

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/* calculator */ #include <iostream> #include <fstream> #include <cmath> using namespace std; void menu (ofstream & outfile); void add (ofstream & outfile); void sub ( ofstream & outfile); void mult ( ofstream & outfile); void div ( ofstream & outfile); void modu ( ofstream& outfile ); void average (ofstream& outfile); void max_ (ofstream& outfile); void min_ (ofstream& outfile); void square (ofstream&outfile); /* function menu() *input: a reference to output file process: Allow for a selection to be made * output: Show menu to allow for a selection */ void menu (ofstream&outfile) { outfile << "Please select + for Addition "; outfile << "of two numbers" << endl; outfile << "Please select - for Subtraction "; outfile << "of two numbers" << endl; outfile << "Please select * for Multiplication "; outfile << "of two numbers" << endl; outfile << "Please select / for Division "; outfile << "of two numbers" << endl; outfile << "Please select % for modulus "; outfile << "of two numbers" << endl; outfile << "Please select A for Average "; outfile << "of two numbers" << endl; outfile << "Please select X for Maximum "; outfile<< "of two numbers" << endl; outfile << "Please select M for Minimum "; outfile << "of two numbers" << endl; outfile << "Please select S for Square Root "; outfile << "of an integer" << endl; outfile << "Enter Q or q to quit the program" << endl; outfile << endl << endl; } /* function menu() *input: a reference to output file process: Allow for addition to be made * output: the result
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
*/ void add (ofstream&outfile) //add numbers {
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern