and code below. thank you    Please provide the function or module header in  in c++ code for each of the following.  Include comments that describe the parameters and return values (if a value is returned).  Do not define the function, just give the header or prototype and comments.  Be sure to indicate if the parameters need to be passed by reference.   1. Swaps two reals. 2. Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate (both as reals). 3. Returns the concatenation of two strings. 4. Performs a search of a string for a character and returns true if the character is found and false otherwise.   Swaps two reals void swap(float&,float&);//used to swap two integers.parameters are  passed by reference Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate float calculate(float,float);//returns the sales tax of 8.25 given the price and the amount of the tax rate Returns the concatenation of two strings. string combine(string ,string );//returns the  concatenated string of given strings Performs a search of a string for a character and returns true if the character is found else false bool find(string ,char );//checks for the given character in the string  and returns true if string have the given character otherwise false.   Step 1 Function Prototype-: void swap(float&,float&);//used to swap two real number with float parameters are  passed by reference , return type is void float calculate(float,float);//returns the sales tax of 8.25 given the price and the amount of the tax rate which is of float type string combine(string ,string );//returns the  concatenated string of given strings , return type is string bool find(string ,char );//checks for the given character in the string  and returns true if string have the given character otherwise false, return type is bool Step 2 Function Definition not needed as per your question but I have attached for yours's understandability-: void swap(float &a, float &b)//used to swap two real number with float parameters are  passed by reference , return type is void {     float temp=a;     a=b;     b=temp; } float calculate(float price, float taxrate)//returns the sales tax of 8.25 given the price and the amount of the tax rate which is of float type {      float salestax;            salestax= (taxrate/100) *price;  } string combine(string a,string b)//returns the  concatenated string of given strings , return type is string {     return a+b; } bool find(string s ,char a)//checks for the given character in the string  and returns true if string have the given character otherwise false. {     bool search=false;     int i=0;     while(s[i]!='\0')     {         if(s[i]=='a')         {             search=true;             break;         }         i++;     } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

For the question below how can I concatenate using and object like append()? for the pseudocode section 3 and code below. thank you 

 

Please provide the function or module header in  in c++ code for each of the following.  Include comments that describe the parameters and return values (if a value is returned).  Do not define the function, just give the header or prototype and comments.  Be sure to indicate if the parameters need to be passed by reference.

 

1. Swaps two reals.

2. Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate (both as reals).

3. Returns the concatenation of two strings.

4. Performs a search of a string for a character and returns true if the character is found and false otherwise.

 

Swaps two reals

void swap(float&,float&);//used to swap two integers.parameters are  passed by reference


Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate

float calculate(float,float);//returns the sales tax of 8.25 given the price and the amount of the tax rate


Returns the concatenation of two strings.

string combine(string ,string );//returns the  concatenated string of given strings


Performs a search of a string for a character and returns true if the character is found else false

bool find(string ,char );//checks for the given character in the string  and returns true if string have the given character otherwise false.

 
Step 1

Function Prototype-:

void swap(float&,float&);//used to swap two real number with float parameters are  passed by reference , return type is void

float calculate(float,float);//returns the sales tax of 8.25 given the price and the amount of the tax rate which is of float type

string combine(string ,string );//returns the  concatenated string of given strings , return type is string

bool find(string ,char );//checks for the given character in the string  and returns true if string have the given character otherwise false, return type is bool


Step 2

Function Definition not needed as per your question but I have attached for yours's understandability-:

void swap(float &a, float &b)//used to swap two real number with float parameters are  passed by reference , return type is void
{
    float temp=a;
    a=b;
    b=temp;
}
float calculate(float price, float taxrate)//returns the sales tax of 8.25 given the price and the amount of the tax rate which is of float type
{
     float salestax;
     
     salestax= (taxrate/100) *price; 
}

string combine(string a,string b)//returns the  concatenated string of given strings , return type is string
{
    return a+b;
}
bool find(string s ,char a)//checks for the given character in the string  and returns true if string have the given character otherwise false.
{
    bool search=false;
    int i=0;
    while(s[i]!='\0')
    {
        if(s[i]=='a')
        {
            search=true;
            break;
        }
        i++;
    }
}

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education