What error is in this code? I keep getting this error but can't find how to solve it. 'printValues (int, int&, int&, int&)' This is the code in c++: /* This program processes the bioryhthm of the users input based on the current date and their birthdate */ #include using namespace std; int daysAlive(); int numDaysReport(); void BioProcessed(int numDaysReport, int daysAlive); void calcValues(int numDaysReport, int&, int&, int&); void printValues(int, int&, int&, int&); int main(void) { int days = daysAlive(); int report = numDaysReport(); BioProcessed (report, days); return 0; } int daysAlive () { int d; cout << "How many days have you been alive? "; cin >> d; return d; } int numDaysReport () { int n; cout << "How many days would you like to be reported? "; cin >> n; return n; } void BioProcessed (int numDaysReport, int daysAlive) { cout << "This report is for someone who has been alive "; cout << daysAlive << endl; int physical; int emotional; int mental; for (int i = 0; i < numDaysReport; i++) { calcValues(daysAlive + i, physical, emotional, mental); printValues(daysAlive + i, physical, emotional, mental); } } void calcValues(int daysAlive, int& physical, int& emotional, int& mental) { physical = sin(2 * 3.14592 * daysAlive / 23.0) * 25 + 25; emotional = sin(2 * 3.14592 * daysAlive / 28.0) * 25 + 25; physical = sin(2 * 3.14592 * daysAlive / 33.0) * 25 + 25; } void printValues(int daysAlive, int physical, int emotional, int mental) { cout << "Day: " << daysAlive << "\t" << physical << "\t" << emotional << "\t" << mental << endl; string output = ".........................|........................."; output[physical] = 'P'; output[emotional] = 'E'; output[mental] = 'M'; cout << output <

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.1: Introduction To C++
Problem 1E: (Practice) State whether the following are valid function names and if so, whether they’re mnemonic...
icon
Related questions
Question

What error is in this code? I keep getting this error but can't find how to solve it. 'printValues (int, int&, int&, int&)'

This is the code in c++:

/*

This program processes the bioryhthm of the users input based on the current date and their birthdate
*/
#include <bits/stdc++.h>
using namespace std;

int daysAlive();
int numDaysReport();
void BioProcessed(int numDaysReport, int daysAlive);
void calcValues(int numDaysReport, int&, int&, int&);
void printValues(int, int&, int&, int&);

int main(void)
{
int days = daysAlive();
int report = numDaysReport();

BioProcessed (report, days);
return 0;
}

int daysAlive ()
{
int d;
cout << "How many days have you been alive? ";
cin >> d;

return d;
}
int numDaysReport ()
{
int n;
cout << "How many days would you like to be reported? ";
cin >> n;

return n;
}

void BioProcessed (int numDaysReport, int daysAlive)
{
cout << "This report is for someone who has been alive ";
cout << daysAlive << endl;
int physical;
int emotional;
int mental;
for (int i = 0; i < numDaysReport; i++)
{
calcValues(daysAlive + i, physical, emotional, mental);
printValues(daysAlive + i, physical, emotional, mental);
}

}

void calcValues(int daysAlive, int& physical, int& emotional, int& mental)
{
physical = sin(2 * 3.14592 * daysAlive / 23.0) * 25 + 25;
emotional = sin(2 * 3.14592 * daysAlive / 28.0) * 25 + 25;
physical = sin(2 * 3.14592 * daysAlive / 33.0) * 25 + 25;
}
void printValues(int daysAlive, int physical, int emotional, int mental)
{
cout << "Day: " << daysAlive << "\t" << physical << "\t" << emotional << "\t" << mental << endl;
string output = ".........................|.........................";
output[physical] = 'P';
output[emotional] = 'E';
output[mental] = 'M';
cout << output << endl;
}

> clang++-7 -pthread -std=c++17 -o main main.cpp
/tmp/main-35652e.o: In function `BioProcessed (int, int)':
main.cpp:(.text+0x174): undefined reference to 'printValues(int, int&, int&, int&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
exit status 1
Transcribed Image Text:> clang++-7 -pthread -std=c++17 -o main main.cpp /tmp/main-35652e.o: In function `BioProcessed (int, int)': main.cpp:(.text+0x174): undefined reference to 'printValues(int, int&, int&, int&)' clang: error: linker command failed with exit code 1 (use -v to see invocation) exit status 1
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning