Question: Write a function readAndPrint, and power with parameters noted below in the Functions.h file. #ifndef FUNCTIONS_H #define FUNCTIONS_H #include #include #include using namespace std; /*reads

Write a function readAndPrint, and power with parameters noted below in the Functions.h file.

#ifndef FUNCTIONS_H

#define FUNCTIONS_H

#include

#include

#include

using namespace std;

/*reads from a file

and prints every item to the screen*/

// file contains sets of

//int

//string

//Don't forget to use infile.ignore() between << and getline

//ifstream must be passed by reference

void readAndPrint(ifstream &infile);

//uses a for loop to return the base to the exponent

//e.g. 2^4 = 16

long power(long base, long exponent);

#endif

You should place the function prototypes in a file called Functions.h The function prototype has a semi-colon at the end. e.g

Then you should implement in a file called Functions.cpp

Finally, declare the infile, and call the readAndPrint function. Then look at the power of 2^3 and 10 ^ 4

Create a file with nano that has the following information.

1

Alpha

2

Beta

3

Gamma

Your functions.cpp AND your lastnamefirstLab05b.cpp should

#include Functions.h.

Remember that you should not #include.cpp files!

Implementation detail 4: compile and run with:

g++ -o lab05b yourlastnameLab05b.cpp Functions.cpp

run with:

./lab05

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!