C++ :: Program To Add Data Of Five Students

May 13, 2014

I need a program. I need to add the data of five students their mobile number,address,sec, and deprtmnt....program should be like:

s.no name address phone
1.
2.
3.
4.
5.

And starting should be like press 1 to insert data

press 2 to save data
press 3 to find data
press 4 to quit

View 5 Replies


ADVERTISEMENT

C :: Creating Linked List Of Students With Individual Data Read From A File

Aug 27, 2014

In the program I'm writing, I'm creating a linked list of students with individual data read from a file. At the moment, I have written two functions to accomplish this; one that creates a student node and fills it from a line file, and a second that calls on the first to create a linked list. It seems to work fine except for one thing; It seems that EOF is being reached first, but the function continues on anyways? Here is my code so far...

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct student
// Declaring student structure globally.

[Code] .....

And here is what the input file would look like...

Thui Bhu, 100, 90, 80, 100, 89, 99, 88
Ariana B. Smith, 90, 90, 100, 100, 99, 100, 95
Emily Gonzales, 100, 90, 100, 70, 78, 78, 80
Jennifer L, 80, 90, 90, 100, 89, 99, 85
Maria Jones, 65, 72, 77, 68, 62, 70, 65
Bill Gates, 60, 54, 38, 62, 65, 60, 50
Escobar Morris, 83, 77, 88, 76, 79, 72, 76
Anne Latner, 80, 80, 85, 95, 90, 95, 98
John Doe, 45, 87, 88, 89, 67, 96, 79

And here is what the output is...

EOF

EOF in create_record

Thui Bhu: 100 90 80 100 89 99 88
Ariana B. Smith: 90 90 100 100 99 100 95
Emily Gonzales: 100 90 100 70 78 78 80
Jennifer L: 80 90 90 100 89 99 85
Maria Jones: 65 72 77 68 62 70 65
Bill Gates: 60 54 38 62 65 60 50
Escobar Morris: 83 77 88 76 79 72 76
Anne Latner: 80 80 85 95 90 95 98
John Doe: 45 87 88 89 67 96 79
Press any key to continue . . .

View 2 Replies View Related

C/C++ :: Program That Shows All Students Enrolled In Certain Courses

Feb 20, 2014

I'm working on a program that shows all the students enrolled in certain courses.

This is what the correct solution is supposed to output:

enrollmentReport.exe sections0.dat enrollment0.dat

Undergraduate enrollments: 1
Graduate Enrollments: 3

CS 355
23272:Line, S.: 1 students
Squyres, Kristen

CS 571
22000:Caro, Virgil: 2 students
Arnold, Hayley
Aiken, Roberto

22002:Caro, Virgil: 2 students
Belur, Shirley
Aiken, Roberto

This is the output I get:

Undergraduate enrollments: 0
Graduate Enrollments: 0

CS 355
CS 571

I've included all the source code in an attachment. The trick is that I can only modify the section.h and section.cpp

 course.zip (523.39K)

View 5 Replies View Related

C++ ::  Simple Program To Prepare Result Of N Students Using Structure

Jan 17, 2014

This is the program below..can you spot the errors in it.. I am getting lots of errors...!!

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
struct student {
char name[10];
int rollnumber,result
float m1,m2,m3,total

[Code] .....

View 12 Replies View Related

C++ :: Switch Case - Program That Calculates Students Grade

Apr 18, 2013

Trying to write a program that calculates a students grade based on how many assignments have been graded. I am using a switch case since there is a total of 5 assignments, however when I enter case 1, and enter in how many I got out of 100, it just closes the program it doesn't go to the next part.

#include <iostream>
using namespace std;
char calculategrade(int total);
int main() {
// local variable declaration:
char input;

[Code]....

View 6 Replies View Related

C++ :: Write A Program To Store Marks Obtained By 50 Students?

Feb 28, 2014

Q.1 Write a program to store marks obtained by 50 students. Initialise the array having passed to a function initilise() having passed the array as parameter. Write another function which should take this array as parameter and return the highest score from the array. you have to write the proper function call, prototype and definition for each function.

And this is the program which i wrote and got errors: -

#include<iostream.h>
#include<conio.h>
#define s 50
void init(int m[s]);
void display(int m[s]);
void find_max(int max, int m[s]);
void main(){
clrscr();
int max;

[code]....

View 1 Replies View Related

C/C++ :: Program To Store Info About Students And Then Display To Screen

Oct 7, 2014

NOTES AT BOTTOM---EXPLANTION, PROBLEMS ETC. SCROLL DOWN

#include <iostream>
#include <iomanip>
#include <string>

[Code]....

I have to write a program that stores information about students and displays results (Formated). Example-

Inputs ( # of students, First and Last name of student, the gender, age, and hieght. (height inputed as inches and outputed as feet and inches))

Student 2
---------
Jett, Joan Female
100 years old 5' 7"

Ive been falling behind a little due to working late and barely having time for my school work. Coming across several issues, one being an error with GENDER (Error C4700: uninitialized local variable 'gender' used:). As well as how to format the end result, i understand that u have to use #include <iomanip>, but am confused on how to format correctly.

View 2 Replies View Related

C :: Accept Information Of 5 Students And Display Information Of First 3 Students - Unable To Get Output

Aug 15, 2013

Code to accept the information of 5 students and display the information of first 3 students......

Code:
#include<stdio.h>
main() {
struct stud {
char name[20];
int rollno;
float per;
char grade;

[Code] ....

View 6 Replies View Related

C/C++ :: Write Program That Calculate Students CGPA And Store In To File Name

Jan 16, 2015

#include<fstream>
#include<iostream>
#include<string>

[Code]...

View 2 Replies View Related

C :: Program To Calculate Students Grades From Input File And Write To Output File

Aug 29, 2014

One of my class assignments is to create a program that receive a .txt file containing a students name and their grades as follows:

John K. 99, 87, 57, 89, 90, 95
Amanda B. Jones 100, 88, 76, 99, 86, 92
etc..

The number of students is unknown until run time. You have to take those grades and average them weighing the first (4) at 10% a piece and the last (2) at 30% each.

Then return an output file with the students name and their letter grade A,B,C,D,F based on their computed score. In addition, on screen it needs to display the average scores for each Q1, Q2, etc. as well as the minimum and maximum for each test on the screen. I am having a hard time in assigning the scores to a variable so that they can then be computed as an average and then used to determine a letter grade. I have begun to write the code and am a bit stuck..here's what I have so far:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

[Code]....

View 2 Replies View Related

C/C++ :: Program To Compute Students Grades From File And Write Them To File?

Aug 31, 2014

We have to write a program that reads an input file containing data in the form:

Martha J, 80, 90, 90, 100, 89, 99, 85
Anna Smith, 65, 72, 77, 68, 62, 70, 65
Bill Gates, 60, 54, 89, 62, 65, 60, 50
...etc...

and then use that information to determine their letter grade and write that information to a .txt file. I have been able to successfully pass that information to a function to determine their letter grade and have been able to successfully compute their letter grade. However, I can get this information to successfully post within the *computeGrade () function. Yet, I don't know how to pass this information back to the main() on a student by student basis so that I can open a new .txt file and write just their name and letter grade to it.

Another issue I'm having is when it comes to computing the averages of the class. Each score is either a quiz (there are 4), a midterm (there are 2) or a final (there is 1). I'm a little stuck on how to pass say all of the quiz 1 grades as one entity to the function averagesminmax(). Is there a way to compile each of the grades for a specific quiz or midterm as one array and pass that to the function to then do the computation. Also we need the min and max so again from compiling the grades of a particular quiz or exam together as one.

Here's the code that I have so far.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
const char *computeGrade();
int averagesminmax();
int main() {
char fName[20];
char lName[20];

[code]....

Do I need to re-read the input file and assign them to different variables?

Here's a sample of the output so far:

Enter input .txt file name
Graded
Thui Bhu, 91, A
Ariana B. Smith, 96, A
Emily Gonzales, 83, B
Jennifer L, 89, B
Maria Jones, 67, D
Bill Gates, 55, F
Escobar Morris, 78, C
Anne Latner, 88, B
Program ended with exit code: 0

Also in my output file, the only thing that it prints will be the first name of whatever the last student in the input file list is.

View 2 Replies View Related

C :: Function To Display Students Who Are Above And Below Average

Oct 30, 2013

Code:
#include<stdio.h>
int calcAbvAvg(int marks[10], int avg) {
int students = 0;
int i;
for(i=0;i<10;i++)

[Code] .....

I suck at function and linked list. The only problem i am having in this question is the function calcAbvAbg() not working! I want that function to display the students who are above and below average!

View 4 Replies View Related

C :: Searching Array Of Struct Students

Feb 28, 2013

I have to search an array of struct students on the basis of their first names, last names and roll numbers .. so far i am done with the input of the student first , last names and roll numbers . I have problem in searching the array ..

Code:
#include <iostream> Code: #include <string>
using namespace std;
struct Student {
string FirstName ;
string LastName ;

[Code] ....

View 5 Replies View Related

C++ :: Sorting Out Passed And Failed Students

Apr 12, 2014

So here I have a program that is supposed to basically sort out who passed and failed. I am currently stuck on the switch statement, I'm trying to count how many students received an A, B, C, etc.

Here's what I have so far:

#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
void printIdInfo(ofstream &fout);
void printColumnHeaders(ofstream &fout);

[Code] ....

View 1 Replies View Related

C++ :: Adding Students And Calculating Their Marks

Feb 20, 2013

I need to write a program on that language. I start with the explanation: The program has 3 tasks:

First: User can add the First Names, Second Names, Third Names and the Marks of a students.
Second: The program can calculate the Avarege Marks of the students.
Third: To show the students that have marks more than 5.50.

View 1 Replies View Related

C/C++ :: Display Average GPA Of Some Students In A File

Nov 29, 2014

I have learnt about string class, file I/O and pointers. Now I am asked to write a program that includes the above topics, basically testing the ability to use dynamic arrays.

I've got 2 documents, namely "Students.txt" and "EnrollRecords.txt". "Students.txt" includes 40 students' info, which are university ID, programme names and their names. These 40 students are all BEng but from different departments.

E.g. 20141129 BEng(Civil) Tom Jerry

"EnrollRecords.txt" includes 166 data, which are course codes, university ID, respective scores in the test and GPA. In this document, the same student can have several scores of different courses' tests. So their uids repeat in it. And this document only contains the data of the Department of Computer Science. So students exist in the "Students.txt" may not exist in this document.

So my task is that the user enter a name (e.g. John), then the programme will know to find John and his uid, and get all the GPA of the courses that he has taken to calculate the average GPA.

E.g. 20147777 BEng(CompSc) John David //this is a John we are looking for in the "Students.txt"

//line 15 COMP1220 20147777 90 4 //so we find 3 courses in "ErollRecords.txt" that John has taken
//line 50 COMP1500 20147777 85 3.3
//line 88 ENGG2012 2014777 70 2.3

The programme should display :

20147777 3.2

To able to do anything for this task, I am asked to define 4 struct types:

struct Student {
int uid;
string programme;
string name;

[Code] ....

So now I am going to write a function queryD(Database d, string searchName) and any necessary functions in it. I am able to do the search part,

void queryD(Database d, string searchName) {
for (int i = 0; i < d.numberOfStudents; i++) {
if (d.students[i].name.substr(0, searchName.length()) == searchName) {
match_uid(d);

[Code] ....

But I struggle in how to match the uid in "Students.txt" and "EnrollRecords.txt" . Because there are repeated data for the same student in "ErollRecords.txt". So how am I gonna be able to match the uid and do the calculation? I get stuck in the for loop part...

View 1 Replies View Related

C++ :: Output Information For Three Students - Calculating Averages

Feb 14, 2015

Write a C++ program to output information for three students. The information stored in your program contains student’s first name, middle name, last name, and test score. The following shows the information for the three students, where test score is in the int type.

John Jacob Smith 78
Mary Jane Weems 82
Dave Joe Dale 61

Your program should declare three named string constants for the three students. Each constant contains the student’s first name, middle name, and last name. You may use three int variables to hold values for the three test scores. The first name, middle name, and last name of a student are then extracted using the substr() function shown in class. Your program should also compute the average (in floating-point number format) for the three test scores. The average score computed should be printed to the screen with 2 digits displayed after the decimal point.

The following shows the output from the program. Note that all the output is left-justified with 15 character positions reserved for each.

first name middlename lastname testscore average
John Jacob Smith 78 73.67
Mary Jane Weems 82 73.67
Dave Joe Dale 61 73.67

View 1 Replies View Related

C++ :: Writing Calculations For Unknown Amount Of Students?

Jun 27, 2014

I need to create a program that continuously records data until the user enters '0'

The data that I read in is the student's last name, the year of the student (1-4), the major, the gpa, and the advisors name. I then need to print out how many students are in each year (1-4), the number of students each advisor has, the average gpa for each major, and so on. This is what I have, but I am stuck and think that I might be headed the wrong direction because the only thing working is the loop (not my gpa test calc).

//This program displays information pertaining to students
#include <iostream>
#include <string>
using namespace std;
int main () {
int studYear;
double average, studGpa;
string studName, studMajor, studAdvisor, complete;

[code]....

View 2 Replies View Related

C++ :: How To Count Students Who Got Highest And Lowest Score

Jul 24, 2014

I can display the highest and lowest score but I can't display the number of students who got the highest and lowest score.

int h=array[1];
int l=array[0];
int m=0,n=0;
for(int z=1; z<=20; z++) {
if(array[z]>h) {
h=array[z];

[code]....

this should be the output

12 students got the highest score of 45
8 students got the lowest score of 1

View 2 Replies View Related

C/C++ :: Cannot Display Top10 Students With Highest Votes

Feb 27, 2015

//USG ELECTION
//Voting Program
#include <iostream>

[Code]....

View 6 Replies View Related

C :: 3 Students Sharing Their Meals - Settle Bills Equally

Sep 28, 2013

There are 3 students (0=John, 1=Peter, 2=William) sharing their meals. Who does the cooking, does the shopping and pays for the bills. End of the month they sum it all up and settle the bills equally. Who must pay the most is outputted at the top, while the person that collects most is at the bottom. Students that have to pay the same amount are listed in the same order as they are ordered in the input. (receiving same amount, the same). Total of the settlement are rounded to whole cents. Sometimes they loose a cent, sometimes they gain one.

So I started making a plan what the program is supposed to do. Pen and paper:

1. Sum of the total amount from all the meals.
JohnPaid+PeterPaid+WilliamPaid=Total
Total / 3 = FairShare

calculate difference of all three the students

if JohnPaid == FairShare
print John receives 0.00

if JohnPaid > FairShare
print John receives difference

if JohnPaid < FairShare
print John pays difference

etc. (same for Peter and William)

Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

/* type definition of student */
typedef struct student {
int who; /* 0=John, 1=Peter, 2=William */
float paid; /* amount that student paid */

[Code] .....

Example in/outputs:

<0 39.85>
<1 30.83>
<2 35.43>
Peter pays 4.54
William receives 0.06
John receives 4.48

<1 106.32>
<0 88.14>
<2 88.14>
John pays 6.06
William pays 6.06
Peter receivers 12.12

Looking at this code, I see a lot of global (general) variables. Do I need to adjust this skeleton code I received or should I just add code?

View 6 Replies View Related

C :: Store Name Of Txt Format Reports Made By Students And Opens Them

Apr 25, 2013

I am doing a c project .it is a system that stores the name of txt format reports made by students and opens them.

View 1 Replies View Related

C :: Sorting List Of Students Based On Their Test Scores

Jan 18, 2014

I need to sort these students based on their test scores.

My biggest problem is with my sort function. I am not sure of the syntax to call the items the proper way. I also don't know how to call the function properly as I know that i can't pass a int to a struct. Also not sure about the z malloc. Just threw that one in there.

Code:
struct student{
int id;
int score;
};
void sort(struct student* students, int n){
/*Sort the n students based on their score*/

[Code] ....

View 5 Replies View Related

C/C++ :: Find Average Of 20 Students By Using A File And One Dimensional Array

Jan 22, 2015

is this according to it??

#include <iostream>
#include <fstream>
using namespace std;
int main(void){
fstream file("textfile.txt");
int linecount = 0;
int tempArray[100];

[Code] ....

View 1 Replies View Related

C :: Enter Test Marks Of Several Students And Calculates Average Marks Of Each Student

Mar 10, 2013

Write a program that a prof can use to enter the test marks of several students and which calculates the average mark of each student. Ask the user how many students he has, then ask him to enter each student's marks. When 999 is entered, calculate the average mark for that student (not counting the 999) and print the average. Then go on to the next students until the marks for all students have been entered, calculated and the average printed.

Code:
#include<stdio.h>
main() {
float student,mark,total=0;
float a,b,c;
int num = 999;
printf("

[Code] .....

View 2 Replies View Related

C :: How To Get Data Path Of Program

Jan 21, 2015

I got a little question about getting the data path of my c program. I heard something like it's already given in the "int main(int argc, char **argv)". But with witch function can I get it?

For example: The program is called Pathfinder and the path is 'D:Path1Path2Pathfinder.exe'.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved