Question: The code above is in C++. I had trouble figuring out where all the errors are, but any help would be greatly appreciated. Problem 2:

Problem 2: Finding Errors [20 points] Each of the 2 codes below

The code above is in C++. I had trouble figuring out where all the errors are, but any help would be greatly appreciated.
 

Problem 2: Finding Errors [20 points] Each of the 2 codes below contain at least 5 errors. Find them. Note: Marking correct code as an error will result in points deductions Example answer format: Code 1: Line 17: Missing semicolon Code 1 1. #include 2. #include 3. double ExpPower (int x, double y){ 4. return exp(x*y); 5. } 6. int square (double x){ 7. 8. } (x*x); 9. void main() { 10. double a, b; 11. a == 3; 12. b = 2; 13. std::cout < < "The product of a and b is " < < ExpPower (a, b) < < std::endl; 14. std::cout < < "The square of a is " < < square (a) < < std::endl; 15.} Code 2 1. #include 2. void Equal(int x, int y) 3. if (xy) 4. 5. 6. 7. } std::cout < < " The quadrilateral is a square "; else std::cout < < " The quadrilateral is a rectangle "; 8. int main{ 9. int side_a, side_b; 10. std::cout < < "Please enter 1st dimension of the quadrilateral "; 11. std::cin >> side_a; 12. std::cout>> "Please enter 2nd dimension of the quadrilateral "; 13. std::cin >> side_b;; 14. equal(side_a, side_b); 15.}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Code 1 1 Line 4 Missing semicolon after the return statement 2 Line 6 Missing return statement fo... View full answer

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 Operating System Questions!