ive been working on 3 codes for class but I'm having a problem with all of them.
for the first one it says that there is a problem with a link. Link1168
// Debug 4-1
// function counts down from higher number to lower number entered
// e.g., if numbers entered are 4 and 8
// output is: 8 7 6 5 4
#include<iostream>
using namespace std;
void main()
{
void countDown(double highest, double lowest);
double high, low, temp;
cout << "Enter a number ";
cin >> high;
cout << "Enter another number ";
cin >> low;
if (high < low)
temp = high;
high = low;
low = temp;
countDown(high, temp);
system("pause");
}
void countDown(double highest, double lowest)
{
int x;
for (x = highest; x <= lowest; --x)
cout << x << " " << endl;
}
for the second one I have two errors the same. It says that I have two uninitialized local variables. Price in line 13 and taxRate in line 14.
First, please use code tags when posting code. See http://www.cplusplus.com/articles/jEywvCM9/
(This is not the first time to request that. Perhaps you somehow miss what we write?)
4-1
What is the exact error message? We are not supposed to hunt some "link 1168" for details that only you can provide.
Another compiler says:
4:11: error: '::main' must return 'int'
That problem you have in all three. Fix it.
4-2
1 2 3 4 5 6 7 8 9
double price;
// what is the value of 'price' now?
double taxRate;
// what is the value of 'taxRate' now?
askPrice();
calcTax(price);
// what is the value of 'price' now?
// what is the value of 'taxRate' now?
cout << "On $" << price << ", the taxRate is " << taxRate << endl;