We help IT Professionals succeed at work.
Get Started

How can I fix compiling errors?

whully1
whully1 asked
on
240 Views
Last Modified: 2012-05-06
I'm new to c++ programming, I've been working on this project for 4 days now and it finally compliles, but I got some errors that I do not understand. Here's what I have done so far and what the errors are.
// chapter6.cpp : Defines the entry point for the console application.
// Written by Anthony White
// February 18, 2009
// Chapter 6
// This program calculates the average of a group of tests scores,
// where the lowest score in the group is dropped.

#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
#include <iomanip>

using namespace std;
     // Function prototypes
         void getScore();
           int findLowest();
           void calcAverage();

int _tmain(int argc, _TCHAR* argv[])
{
     int score1, score2, score3, score4, score5;
             getScore(); // The user inputs 5 test scores.
             findLowest(); // This function finds the lowest score.
             calcAverage(); // This function calculates the average of the scores.
  system("PAUSE");

      return 0;
}

  //*****************************************************
   // This function asks the user to input 5 test scores.*
   //*****************************************************

   void getScore(int score1, int score2, int score3, int score4, int score5)
       {
            cout << "Enter 5 test scores greater than 0 ";
            cout << "and less than or equal to 100. " << endl;
            cin >> score1 >> score2 >> score3 >> score4 >> score5;
       }

       //****************************************************
       // This function finds the lowest score and drops it.*
       //****************************************************

       int findLowest(int score1, int score2, int score3, int score4, int score5)
         {
              int lowest;
              lowest = score1;
              if (score1 < lowest) {
                    lowest = score1;
                    cout << "The lowest score is " << lowest << endl;
              }
              if (score2 < lowest) {
                    lowest = score2;
                    cout << "The lowest score is " << lowest << endl;
              }
              if (score3 < lowest) {
                    lowest = score3;
                    cout << "The lowest score is " << lowest << endl;
              }
              if (score4 < lowest) {
                    lowest = score4;
                    cout << "The lowest score is " << lowest << endl;
              }
              if (score5 < lowest) {
                    lowest = score5;
                    cout << "The lowest score is " << lowest << endl;
                    return lowest;
              }
         }

        //**************************************************************
        // This function calulates the average of the 4 highest scores.*
        //**************************************************************

            void calcAverage(int score1, int score2, int score3, int score4, int score5, int lowest)
        {
            int average;
            average = (score1 + score2 + score3 + score4 + score5 - lowest) / 4;
            cout << "The average score is " << average << endl;
        }
------ Build started: Project: chapter6, Configuration: Debug Win32 ------
Linking...
chapter6.obj : error LNK2019: unresolved external symbol "void __cdecl calcAverage(void)" (?calcAverage@@YAXXZ) referenced in function _wmain
chapter6.obj : error LNK2019: unresolved external symbol "int __cdecl findLowest(void)" (?findLowest@@YAHXZ) referenced in function _wmain
chapter6.obj : error LNK2019: unresolved external symbol "void __cdecl getScore(void)" (?getScore@@YAXXZ) referenced in function _wmain
C:\Documents and Settings\dad\My Documents\Visual Studio 2008\Projects\chapter6\Debug\chapter6.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://c:\Documents and Settings\dad\My Documents\Visual Studio 2008\Projects\chapter6\chapter6\Debug\BuildLog.htm"
chapter6 - 4 error(s), 0 warning(s)

Can anyone give me some clues as to what these errors mean or what I have done wrong in my code?
Thanks, Anthony
Comment
Watch Question
Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE