Instance of overloaded function

Assignment Help Basic Computer Science
Reference no: EM131873355

There's five mistakes in this code. I found one right off the bat but it seems like the rest wont come to light until I take care of the issue on line 22. It says more than one instance of overloaded function. Its referring to the "add: on line 22

// 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 <cstdlib>

#include <iostream>

using namespace std;

 

int add(int, int);

double add(double, double);

 

int main()

{

int a, b, x;

float c, d, y;

 

cout << "Enter two integersn";

cin >> a >> b;

x = add(a, c);

cout << "Sum of integers: " << x << endl;

 

cout << "Enter two doublesn";

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; //Added semi colon

}

Reference no: EM131873355

Questions Cloud

Example of a weighted graph : Give an example of a weighted graph for which the minimum spanning tree is unique. Indicate what the minimum spanning tree is for that graph.
What was the effect on the economy from the kennedy tax cuts : What was the effect on the economy from the Kennedy and Johnson tax cuts? Which of the following is a defense for policymakers?
Characteristic or property of an entity : An attribute is a characteristic or property of an entity. If person is an entity, would the same attributes be used to describe a person in a medical database
How many units can the firm sell : For most products, higher prices result in a decreased demand, whereas lower prices result in an increased demand.
Instance of overloaded function : There's five mistakes in this code. I found one right off the bat but it seems like the rest wont come to light until I take care of the issue on line 22.
Data and enforce the assumptions from within page : Make some reasonable assumptions about the content and format of these data and enforce the assumptions from within your page.
Discuss about the given corporate functions : It has been reported that 12,000 employees of Southwest Airlines are distributed among the following corporate functions. Function Probability Event Management.
What would you suggest the university do to expand revenue : Suppose that, in an attempt to raise more revenue, Nobody State University increases its tuition. Will this necessarily result in more revenue?
Cost for carlton irredeemable preference share : The cost for Carlton’s irredeemable preference share is 6.83% per annum.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Can you convert a raster drawing into a vector format

Find out the differences between the raster and vector formats. Can you convert a drawing in a vector format to a raster format? Can you convert a raster drawing into a vector format? Explain.

  Perpetuates some gender agendas

Mass Communication sets or perpetuates some gender agendas. Provide links to examples.

  Risk identification

You have been assigned as the manager on a project to develop a new application system for your business partner. You were given two weeks to develop a project plan and high level cost estimates.

  Appropriate hardware and operating system

Name your business Decide what your email address will be Choose the most appropriate hardware and operating system

  Determine the delays of the carry out

Determine the delays of the carry out bit c48 and the gate complexity, i.e, the numbers of AND, OR and XOR gates needed for implementing the following 48-bit adders.

  How it work in a pseudocode

What three elements are used to make a loop work? How's it work in a pseudocode?

  Direct material estimate

You are reviewing a cost proposal, which includes an $800,200 direct material estimate.

  Comment on the performance and scalability of this scheme

Comment on the performance and scalability of this scheme

  What are major technical factors that hinder software reuse

What are the major technical and nontechnical factors that hinder software reuse? Do youpersonally reuse much software and, if not, why not?

  What are penalties for committing these crimes

What might the profile be for a cybercriminal who commits this type of cybercrime?

  What are the cons of re-sizing your images using html

What are the cons of re-sizing your images using HTML/CSS? How does it affects the overall performance of your web page? Explain your answer.

  Which symbol would be used in a flowchart

Which symbol would be used in a flowchart for the following statement?Read customerName

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd