I am currently working on a sorting list and I want to find the min, half and max from the sorted list. I have already sorted the list as follows:
#include <iostream>
#include <iomanip>
...
Type: Posts; User: wiz23
I am currently working on a sorting list and I want to find the min, half and max from the sorted list. I have already sorted the list as follows:
#include <iostream>
#include <iomanip>
...
I still having trouble getting the right alignment on the outfile text file, the expected output should look like this:
s4569 Barnett, Linda D 44.80 F
s5333 Reefs, Christopher D...
Thankx guys, I now know the left justified but what about showing the D in the 28 space part?
I currently got this 2 lines on the outfile text file:
s1012 Bennet, Anne D 56.20 P
s3343 Johnson, Samuel D 68.60 Cr
I want to display "D" on the 28 column(space) in both lines....
Oh OK, thanx. I can see them in a better layout.
I use Notepad to see the text file.
When OutFile to a text file, why does it display in a straight line even though I have set << endl; at the end?
I want to calculate the actual average score from these two input test files, one is called StudentsDay.txt and the other one is called StudentsEvening.txt
StudentsDay.txt look like this:
Code:...
TotalAverage + AverageDay = TotalAverage;
TotalAverage + AverageEvening = TotalAverage;
I only got 6 students 3 from day and 3 from evening. So is it like this:
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
TotalAverage = 50;
TotalAverage + 60 = TotalAverage;
float TotalAverage = 60;
So I put float
TotalAverage = 0;
Then change what?
I'm sorry if I done it wrong but the variable that has the average student score in it are AverageDay and AverageEvening.
#include <fstream>
#include <iomanip>
#include <string>
using...
Is it this?
inFileDay>>score1>>score2>>score3>>score4>>score5;
AverageDay=static_cast<double>(score1+score2+score3+score4+score5)/5.0;
outFile<<AverageDay<<" ";
...
I want to calculate the actual average score from these two input test files, one is called StudentsDay.txt and the other one is called StudentsEvening.txt
StudentsDay.txt look like this:
s1012...
Just one thing, I also need the grade at the end.
Thanx, but how can it recognise whether the maximum and minimum score student is from day or evening. Because the expected output should look like this:
For maximum:
s1236 Bridges, Tony D 82.20 ...
I just only need one maximum which is the 93.80, along with the studentId and name so do I just put the outFile studentID <<surname << givenname << D/E << 93.80 << grade <<endl;
Does 93.80...
I need this to get it work, I have tried many different combination but no luck. What is the best way to show the max and min score?
How can I fix this?
So how can I make it work to display max and min score?
The maximum and minimum should look this once is done, for maximum:
s1236 Bridges, Tony D 82.20 D
For minimum:
s1012 Bennet, Anne D 56.20 P
Here is all my code,
Can somebody check this code as I need to output the maximum and minimum average score:
while (!inFileDay.eof() )
{
int score1, score2, score3, score4, score5;
int...
I am trying to find the maximum and minimum average score from the student in both day and evening from the text files.
Now I want to find the maximum average from day then find the maximum from...