Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with the following: I need the codes. Write a program that allows th

ID: 638240 • Letter: I

Question

I need help with the following: I need the codes.

Write a program that allows the user to enter two integers. Write separate methods that produce the sum, product, average, and squared result of the values. Call the squared result with both values that were entered.

Write a program that calculates and prints the take-home pay for a commissioned sales employee. Allow the user to enter values for the name of the employee and the sales amount for the week. Employees receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution is 10%. Social Security tax rate is 6%. Use appropriate constants.

Write an application that calls a method to display information about your school. Items you might include are the name of your school, number of students enrolled, and school colors. The display should be aesthetically pleasing.

Explanation / Answer

#include <iostream>
using namespace std;

int sum(int a,int b){
   return a+b;
}

int product(int a,int b){
   return a*b;
}

int average(int a,int b){
   return sum(a,b)/2;
}

int sqaure(int a){
   return a*a;
}

int main(){
   // Question 1
   int a,b;
   cout << "Enter two numbers : ";
   cin >> a >> b;
   cout << "Sum is " << sum(a,b) << endl;
   cout << "Product is " << product(a,b) << endl;
   cout << "Average is " << average(a,b) << endl;
   cout << "Square of " << a << " is " << sqaure(a) << endl;
   cout << "Square of " << b << " is " << sqaure(b) << endl << endl;
   // Question 3
   string school_name,colour;
   int total;
   cout << "Enter Your School Name : ";
   cin >> school_name;
   cout << "Total Number of Students : ";
   cin >> total;
   cout << "School Color : ";
   cin >> colour;
   cout << "Name of School is : " << school_name << endl;
   cout << "Total Student is : " << total << endl;
   cout << "School Color is : " << colour << endl;
   return 0;
}