Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ help. I have found 2 errors but need help finding 3 more. // Overloading.cpp : This code contains five errors before it will work

C++ help. I have found 2 errors but need help finding 3 more.

// Overloading.cpp : This code contains five errors before it will work as desired. Find those errors, // document a description of the errors and their fix, and fix them. Try using the debugger to // step through the program to find the bugs. As you step through, take notice of the information // you can see. //

#include "stdafx.h" #include #include using namespace std;

int add(int, int); double add(double, double);

int main() { int a, b, x; float c, d, y;

cout << "Enter two integers "; cin >> a >> b; x = add(a, c);//error cout << "Sum of integers: " << x << endl;

cout << "Enter two doubles "; cin >> c >> d; y = add(a, b); cout << "Sum of doubles: " << y << endl;

return 0; }

int add(int a, int b) { int sum; sum = a + b; }

double add(double a, double b) { double sum; sum = a + b; return sum }//error

//debugger has shown me 2 of them. The error code is:

Severity Code Description Project File Line Suppression State Error (active) E0308 more than one instance of overloaded function "add" matches the argument list: IT312_Overloading c:\ ####\ 23 Error (active) E0065 expected a ';' IT312_Overloading c:\#### 45

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions