C/C++ :: Writing And Sorting Student Report
Sep 27, 2014
I'm trying to write a table (2D array) with a string of random chars in one row for the student names, six other rows for the project numbers and random numbers for the grades.Then calculate the averages of grades per student and per project, add them as the last row and the last column. And write a menu of 4 options:
1- sort per student names (alphabetical order)
2- sort per student grades (in increasing order)
3- sort per project grades ( in increasing order)
4- exit
The program must continue execution after displaying any report, need to use an infinite loop, it exits only if the chosen 'exit'.
Here's what I have:
#include <ctime>
#include <string>
#include <iomanip>
#include <iostream>
using namespace std;
ints=12,p=6;
stringnames[20];
[Code] ....
And then, I need to show interactively the same report with all types of sorting:
sort table by any row, (user enters the row number)
sort table by any column. (user enters the col number)
sort table sorted by student names as well.
View 12 Replies
ADVERTISEMENT
Dec 6, 2014
i have project (person ID cared) and fortunately i could finish it in programming,,,,, but the thing that i don't know what to do about it is how to print this data? can i use reportviewer ?
View 4 Replies
View Related
Aug 28, 2013
For a school homework i had to make a c++ program to generate a report card so i made this program
#include<iostream.h>
#include<conio.h>
void main()
{
[Code].....
The problem is that it does not take any values ps I have been learning C++ for 3 months so we don't have any arrays,at max we have iterations
View 5 Replies
View Related
Oct 12, 2014
#include <iostream>
#include <cmath>
using namespace std;
void summary();
const float below100 = 0.10;
const float after100 = 0.05;
[Code] .....
It cannot loop back to the top coding, cause what i want is the code can loop back to the 1st cout question, and it will asking over and over again, and how to declare a function for the summary report?
View 2 Replies
View Related
Apr 7, 2014
I use rdlc report in C# . I have a Table Item in the form to show all record but it show all record except first record .
View 4 Replies
View Related
Jun 9, 2014
I have a table in sql called empattendancetable the fields are
eid empname designation logindatetime status
emp001 abc manager 30-05-201412;00PM present
likewise i want to display the month wise attendance details of all the employees
the logindatetime field value from datetimepicker i am not getting how to write the query to get the month wise detailsusing c# i am creating a windows application to maintain the details of employees
View 11 Replies
View Related
Jun 30, 2014
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
// Function prototype
void getScore(int &);
void calcAverage(int, int, int, int, int);
[Code] ....
this is what I have so far but I a stuck. The name of the file is grades.txt.I am trying to get the program to read 5 grades from a file and report back lowest grade that will be dropped and average of 4 left. It runs but is not reading the file.
View 3 Replies
View Related
Mar 10, 2013
I'm having trouble with how to find the count and sum of all numbers.
The file, called question1.txt, contains numbers:
1
2
3
4
5
0
0
0
-2
-2
Here's my code:
Code:
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
FILE* spIn;
FILE* spOut; //for output file
int numIn;
[Code]...
View 1 Replies
View Related
Apr 2, 2014
i have 2 tables with primary and foreign key
Customer Details
EID - Primary Key
PurchaseDetails
PNo-Primary Key
PDate,
EID- Foreigh Key
NetAmount
Report Query written in c#
SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.LT, P.NT, P.EID, P.PTime, C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID
In Report Automattically linked based key.
but report data not showing
View 1 Replies
View Related
Jan 31, 2015
I created a dataset that contains an empty dataTable that has several columns , and then I created a new report that is linked to this datatable using the report wizard. In my form there is a button when clicked should fill the datatable mentioned above ( I checked if it is being filled by displaying its content in a dataGridView and by firing a messagebox that is triggered when 'datatable.rows.count > 0' ).
The reason that the datatable is initially empty is that it depends on some conditions that may alter the query used to fill it.
But finally when I load the form that has the report viewer it only has the names of the columns of the datatable and no contents. What's wrong ?
View 5 Replies
View Related
Feb 21, 2014
Below is my Code Code snippet wher I am facing problem.
every time "pNMHDR->idFrom" is returning 0.
I even put "EnableToolTips(TRUE);" in the oninitdialog method of dialog class.
BEGIN_MESSAGE_MAP(CMyListCtrl, ListCtrl)
.
.
.
ON_NOTIFY_EX(TTN_NEEDTEXTW, 0, OnToolTipText)
ON_NOTIFY_EX(TTN_NEEDTEXTA, 0, OnToolTipText)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
[Code] .....
I am not able to get the text of a listctrl cell.
View 3 Replies
View Related
May 3, 2013
I'm writing a program that writes to a report in a text file. It uses a struct but with no array. How can I write this so that the report comes out as it should because as of now after i removed the brackets from record which is the variable of the struct my report isn't printing right.
View 8 Replies
View Related
Nov 5, 2014
Here is the assignment... Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K.
3460 25
Andrews, Susan S.
3987 72
Monroe, Marylin
2298 87
Gaston, Arthur C.
2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman
Susan S. Andrews 3987 40 Sophomore
Marylin Monroe 2298 87 Junior
Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
enum class_level {FRESHMAN, SOPHOMORE, JUNIOR, SENIOR } ;
and define two namespace globalTypes (tys and fys) for the function :
class_level deriveClassLevel(int num_of_credits) ;
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy. And the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy:
Freshman 0-29 creditsSophomore 30-59 credits
Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy:
Freshman 0-29 creditsSophomore 30 or more credits
and this is the code I have so far...
#include <cstdlib>
#include <iostream>
#include <cctype>
#include <fstream>
using namespace std;
enum class_level {FRESHMAN, SOPHOMORE,JUNIOR,SENIOR};
class_level classLevel;
[Code] .....
My main question is did I use the namespaces and enum correctly? And my second question is whats the best way to input the data from the text file? This is really where I get stuck.
View 3 Replies
View Related
Nov 7, 2014
Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K.
3460 25
Andrews, Susan S.
3987 72
Monroe, Marylin
2298 87
Gaston, Arthur C.
2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman
Susan S. Andrews 3987 40 Sophomore
Marylin Monroe 2298 87 Junior
Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
enum class_level {FRESHMAN, SOPHOMORE, JUNIOR, SENIOR } ;
and define two namespace globalTypes (tys and fys) for the function :
class_level deriveClassLevel(int num_of_credits) ;
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy.
The second namespace globalType fys should derive the class level based on a four year school policy.
So I basically did it in parts and got everything working and then had to make the namespace so I had this:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
enum class_level { FRESHMAN, SOPHOMORE, JUNIOR, SENIOR };
[Code] ......
I know I have to clean it up and change it but it ran like it was suppose to. Then I tried adding the global namespaces and I this:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
enum class_level { FRESHMAN, SOPHOMORE, JUNIOR, SENIOR };
class_level classLevel;
[Code] ....
with this i keep getting an error saying tys::deriveClassLevel: must return a value and tys::fys::deriveClassLevel: must return a value. I have been messing around with this part and struggling I thought I used the namespace to run the if statements with the criteria for the years of school. Basically I have been stuck for awhile and trying to change things around but I cant seem to get it to work.
View 2 Replies
View Related
Sep 20, 2014
I want to print a report half sheet in A4 size..
I tried to change paper size in coding and in properties also but no use..so what is the correct code to change as custom size of report.
View 1 Replies
View Related
Feb 18, 2013
how to display date reange in crysta report , i have table contains :
id score date name
1 30 2-10-2012 x
2 40 3-10-2013 y
3 40 3-7-2009 z
1 45 5-10-2013 x
1 50 4-10-2009 x
ouput report:
id:1 name :x
2009-10| 2012-2013
50 30
40
View 2 Replies
View Related
Feb 17, 2015
#include <iostream>
#include <string>
using namespace std;
struct studentType {
string name;
double gpa;
[Code] .....
View 11 Replies
View Related
Nov 11, 2014
Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K.
3460 25
Andrews, Susan S.
3987 72
Monroe, Marylin
2298 87
Gaston, Arthur C.
2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman
Susan S. Andrews 3987 40 Sophomore
Marylin Monroe 2298 87 Junior
Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
enum class_level {FRESHMAN, SOPHOMORE, JUNIOR, SENIOR } ;
and define two namespace globalTypes (tys and fys) for the function :
class_level deriveClassLevel(int num_of_credits) ;
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy.
and the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy:
Freshman 0-29 creditsSophomore 30-59 credits
Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy:
Freshman 0-29 creditsSophomore 30 or more credits
NOTE : use ignore() function with ifstream objects whenever you want to ignore the newline character.
For example :
ifstream transferSchoolFile ;
transferSchoolFile.open("student_status.txt", ios::in);
while( !transferSchoolFile.eof()) {
getline(transferSchoolFile,name) ;
transferSchoolFile >> id >> credits;
transferSchoolFile.ignore(); //Used here to ignore the newline character.
….
}
I did this in parts so I got it working with a four year criteria without the user defined name spaces.
include <iostream>
#include <fstream>
#include <string>
using namespace std;
enum class_level { FRESHMAN, SOPHOMORE, JUNIOR, SENIOR };
[Code] ....
So that worked fine then I tried with name spaces -
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
enum class_level { FRESHMAN, SOPHOMORE, JUNIOR, SENIOR };
class_level classLevel;
[Code] ....
I know I have some stuff to mess around with but I am currently stuck with two errors, first -
Error1error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupC:UsersstephenDocumentsVisual Studio 2013ProjectsinputConsoleApplication1MSVCRTD.lib(crtexe.obj)ConsoleApplication1
then -
Error2error LNK1120: 1 unresolved externalsC:UsersstephenDocumentsVisual Studio 2013ProjectsinputDebugConsoleApplication1.exeConsoleApplication1
View 1 Replies
View Related
Nov 11, 2014
Program Description: Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student's name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K.
3460 25
Andrews, Susan S.
3987 72
Monroe, Marylin
2298 87
Gaston, Arthur C.
2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman
Susan S. Andrews 3987 40 Sophomore
Marylin Monroe 2298 87 Junior
Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
enum class_level {FRESHMAN, SOPHOMORE, JUNIOR, SENIOR } ;
and define two namespace globalTypes (tys and fys) for the function :
class_level deriveClassLevel(int num_of_credits) ;
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy.
and the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy:
Freshman 0-29 creditsSophomore 30-59 credits
Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy:
Freshman 0-29 creditsSophomore 30 or more credits
NOTE : use ignore() function with ifstream objects whenever you want to ignore the newline character. For example :
ifstream transferSchoolFile ;
transferSchoolFile.open("student_status.txt", ios::in);
while( !transferSchoolFile.eof()) {
getline(transferSchoolFile,name) ;
transferSchoolFile >> id >> credits;
[Code] ....
I know I have some stuff to mess around with but I am currently stuck with two errors, first -
Error1error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupC:UsersstephenDocumentsVisual Studio 2013ProjectsinputConsoleApplication1MSVCRTD.lib(crtexe.obj)ConsoleApplication1
then -
Error2error LNK1120: 1 unresolved externalsC:UsersstephenDocumentsVisual Studio 2013ProjectsinputDebugConsoleApplication1.exeConsoleApplication1
View 2 Replies
View Related
Nov 10, 2013
I have to get the average score for each student. And modify my avgmarks function and write the marks to a output txt file.
Code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int bubble(int*,int);
void filewrite();
void avgmarks();
void fileprint();
void filesort();
void rollin();
[Code] .....
View 1 Replies
View Related
Mar 26, 2013
//******************************************************************************
// GradeCalculator.cpp
// Input: Student Grades in Each Category
// Output: Final Grade, Numerical Grade, Witty Comment
// Final Grade Calculator
// This program calculates a final grade using a formula, assigns a
// corresponding letter grade, and outputs a "witty" comment to the user.
//******************************************************************************
#include <iostream>
#include <fstream> // For file I/O
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
// Declare function prototypes
void OpenFiles(ifstream&, ofstream&);
[Code] .....
View 1 Replies
View Related
Feb 24, 2014
My assignment for class was to create a Student ADT. I have three files. First one is Student.h which defines a Student record and has the prototypes of the functions that can be used with Student. I have Student.cc which is where the functions are actually declared. And my final file is testStudent.cc where the "main" function is that is creating a Student and callign all of the functions to make sure they work properly.
I have all of the functions working properly, except for my destroyStudentRecord function. It is supposed to deallocate the record, but I am unsure of how to actually do this. The current implementation appears to only deallocate the firstName field, as when you display the record after deallocationg it, everything still shows up except the first name. I have tried deallocating each field of the record before deallocating the record itself and that gave me the biggest list of errors I have ever seen.
I realize the implementation of some things in here might be a bit odd, but this is exactly how we are required to do things for this assignment and nothing about the implementation can really be changed unless something is actually just plain wrong(which is of course a possibility as I am quite new to this!). As I said though, everything else is working exactly as it should be, so my only issue at all is with actually deleting the record once I have created one.
Student.h:
#include <iostream>
#include <cstdlib>
using namespace std;
#ifndef _STUDENT_H_
#define _STUDENT_H_
struct Student {
[Code] ....
View 9 Replies
View Related
Mar 12, 2013
I'm trying to add more student information to the specific txt file. I did struct my student information and separated it with an array with max size of 200.
The inside of my current file looks like
Toshi
Aka
Nonal
Donald
The first one represent student[0] and next one is student[1] and so on till student[199]. Right now, only 4 space is occupied, which means the array has information till student[3] but not from student[4] (I guess it has null condition).
What I want to do is, I want to add a new student information to student[4] and till student[199] once at each time.
So, my prompt will look like
Would like to add a new student? Y/N
(if yes goes to below statement and exit if NO)
Hi. Please enter the information of new student. ___________
Student added. Please press any key to continue.
If the key is pressed, it goes back to my initial prompt and continues till I press N.
I sure I'm not using for loop to do this thing, because I'm adding student name one by one.
However, the array is already occupied by other student name till student[3] so, I want to add a new student information to student[4] (I don't want to overwrite the current information). And if student[4] is occupied, then [5] and so on.
View 7 Replies
View Related
Aug 14, 2012
i wnt to display student who get highest marks among them...i have code for finding maximum marks from them but don't kne how to print only top 5 student...
Code:
static void Main(string[] args)
{
Console.WriteLine("Please Enter Number of Students :");
int n = Convert.ToInt32(Console.ReadLine());
StudentDetails[] student = new StudentDetails[n];
for (int row = 0; row < n; row++)
{
Console.WriteLine("Please Enter Student name :");
[Code]...
(dis code in Visual Studio)
View 6 Replies
View Related
Mar 6, 2013
I've remade a program to store student database using linked list. When I try to display the list of student with their information (It displays nothing)
Code:
#include <iostream>
#include <string>
using namespace std;
struct StudentRecord {
[Code] ....
View 4 Replies
View Related
Jan 6, 2015
For Example i have made a text file included some students data. Now i want to change just a single student data. That file should remain same just that student's data replace.
View 3 Replies
View Related