This code is nice and clean. It makes perfect sense, but when I compile it, (using old Visual C++ 6.0 BTW) it only prints this:
Welcome to the election gizmo (this is in main)
press any key...
Type: Posts; User: liquidcourage1
This code is nice and clean. It makes perfect sense, but when I compile it, (using old Visual C++ 6.0 BTW) it only prints this:
Welcome to the election gizmo (this is in main)
press any key...
Ok... assuming I change all the 'void's to 'int'...
then at the end of the code... how do I return the value(total of EACH district) to main and then figure out overall winner?
I'm a little slow...
So would this piece of code go in "main" or imbedded within my function?
I've just revised this... I did have redundant code. I didn't realize how functions worked. I was trying for District 1, 2... whatever...
anyway, I've eliminated one of them and created 1...
Update:
#include <iostream>
using namespace std;
void district1(); //Need prototypes
void district2();
Making more sense now. I appreciate the help. And don't think I was mad. I guess it's hard to read tone through letters and numbers.
I am a beginner after all. Do you really think I'd be on the boards if I were GOOD at this?
But seriously, I am new to functions and I see where the second part of your argument makes sense. ...
Long story short, it gets through the 10th voter and stops... it should reset to District 2 and start again with voter 1. I'll take voter #11, but having it start at 1 again for District 2 would be...
I'm trying to write a code that runs through 2 different districts with 10 voters each. They must vote in order and it must start with district 1.
The goal is to get through all of this and report...
I need to redo this program before finals... I need to correct some things to get extra credit. It opens a file named "credit.txt" . In the code I placed it in the d: drive. So if you want to run...
Ok. That makes sense. I appreciate it.
//This program is a telemarketing program that assists
//the telemarketer by determining interest rate for each customer based on
//preferred status and will collect data if they accept card
...
Awesome. That works pretty well. The little tutorial page you included saved my butt. However, my program terminates after I enter the information. I need it to go to the next line in the program...
CHANGED
//This program is a telemarketing program that assists
//the telemarketer by determining interest rate for each customer based on
//preferred status and will collect data if they...
I've now included:
while(!inFile.eof())
{
}
but I don't know if the rest of the code is embedded within this?
I don't think that's a problem with the way this assignment is worded.
seems to be easier, because you type less. But in the end, I think it's whatever you're comfortable with.
New code so far:
//This program is a telemarketing program that assists
//the telemarketer by determining interest rate for each customer based on
//preferred status and will collect data if they...
You're right, but this is suppose to be a very simple list of names and status. We haven't used std::string yet. So I don't want to use something I don't fully understand just yet.
So far:...
Need help reading data from a file that looks like this:
X Joe Scholtz 437-4798
A Tim Wade 768-7658
X Sara Jobs 326-7857
! Jaynce Bee 354-8678
This file may be longer than this or shorter...
Here's what jlharrison and I have come up with (Thanks J!).
#include <iostream>
using namespace std;
int main()
{
int days, average;
double totalScores = 0, tempScore=0;
I've gotten out of the loop, but I still can't figure out how to label the Temperature so that it begins at "Temperature 1" instead of some random number.
It's also taking the form of whatever...
Ok... I'm getting the temp to read temp2 instead of Temp 1 (that's how it should start anyway). And I'm stuck in a loop.
That's the idea. So could it look something like this?
{
int days=7;
int temp;
int total; //accumulator for temps
double average;
{
Ok. I have to write a code that averages temperatures over a 7 day period. I have to write it with the for, while, and do while loops. I've just started loops and I'm a little confused.
I think...