C++ :: Student Grades Do Not Print?

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


ADVERTISEMENT

C++ :: Finding Program That Calculates Student Grades?

Jun 7, 2013

I have to make a program that reads two student grades, the average of the two has to be 6, if you can not take an average of 6, will make a third test and calculate a new average.

I'm not getting the new display medium, without repeating the approved and disapproved?

// TRABAV2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]) {

[code]....

View 1 Replies View Related

C++ :: Write Program That Asks User To Enter Student Grades?

Jan 21, 2014

Write a program that asks the user to enter a student’s grades on four exams. The program should display the four grades and the average of the four grades,rounded to the nearest tenth. To add the grades, use a variable called total_grade, which you should initialize to zero.As the program prompts for and obtains each grade, add the grade to total_grade using the += operator.

View 3 Replies View Related

C++ :: Program Compiles But Refuses To Print Out Char Grades?

Nov 10, 2014

#include <fstream>
#include <ostream>
#include <iostream>
#include <iomanip>

using namespace std;

const int NAMESIZE = 15;
const int MAXRECORDS = 50;

[Code] ....

View 2 Replies View Related

C++ :: Grade Book - Using Vector To Get The Grades

Sep 15, 2013

I am trying to make a grade book and using a vector to get the grades. I am getting errors all over and I figured this would happen because this is the first time I ever used vectors.

Code:
#ifndef ___2B__Homework__LetterGrade__
#define ___2B__Homework__LetterGrade__

#include <iostream>
#include <vector>

[Code] .....

View 12 Replies View Related

C++ :: Struct - Getting Grades Of The File Sorted

Jul 21, 2014

My code has no errors. I'm just having problems with getting the grades of the file sorted. grades is not a struct, but is a int inside struct School. Below is what I;m having problems with(this is just the code I started working with,I made a few changes but it didn't work,I have no clue)

void selectionSortG() {
Students min;
int key;
for (int i = 0; i < size; i++){
min = student[i];
key = i;
for (int k = i; k < size; k++)

[Code] ....

View 2 Replies View Related

C++ :: Arrays - Determine Grades At The End Of Semester

Jul 18, 2013

Write a C++ program that can be used to determine grades at the end of the semester. For each student, who is identified by an integer number between 1 and 60, four examination grades must be kept. Additionally, two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: the first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade a weight of 0.3, an the fourth grade a weight of 0.2; that is computed as:

0.3*grade1 + 0.2*grade2 + 0.2*grade3 + 0.3*grade4

Using this info, you are to construct a 60X7 two dimensional array, in which the first column used for the student number, the next four columns for the grades, and the last two columns for the computed final grades. The output of the program should be a display of the data in the completed array.

View 8 Replies View Related

C++ :: Writing A Program To Calculate Grades

Apr 22, 2014

Writing a program to calculate grades... My algorithm is long, so I only posted the part that gives me trouble. When classes== 1,2,4, or 5, the program runs fine. but it terminates when classes == 3.

if (classes==3) {
do {
cout<<"Enter the Letter grade for 1st class. (USE CAPS)"<<endl;
cin>>grade1;

[Code].....

View 3 Replies View Related

C++ :: Calculating High / Low And Average For Grades

Feb 6, 2015

The bottom three functions do not work. Nor are the finished to the extent. I do not know how the data members are being accessed and is only giving me the last output. The overall goal of this program is to output the highest grade with student name and age, lowest grade with student name and age, and the average of all grades. The file is given and is commented out for you to see what the file looks like.

// Header Files
#include <iostream>
#include <fstream>
using namespace std;
// Global Constants
const int STD_STR_LEN = 10;

[Code] .....

View 5 Replies View Related

C/C++ :: Write Random Grades To File?

Jul 1, 2014

I need to write a program to store a user specified number of grades to a file, with one grade per line. random function to generate grades between a 55 and 100. When you open the file, it should be for writing, and not appending. Again, prompt the user for how many grades to generate, and store them in a file.

View 2 Replies View Related

C++ :: Use Functions In A Program To Show Names And Grades

May 19, 2013

how to use functions in a program to show the names and grades of students, their average, total, highest and lowest grades.

View 1 Replies View Related

C++ :: How To Sort Names And Grades From Highest To Lowest

Oct 28, 2014

How do I sort names and grades in C from highest to lowest?

John 91
Joseph 92
Mary 93
Jake 94

Sorted Scores from highest to lowest

Jake 94
Mary 93
Joseph 92
John 91

View 2 Replies View Related

C++ :: Program That Prompts User For 10 Grades And Then Find Average

Feb 24, 2015

I need to write a program that prompts the user for 10 grades and then find the average. I have that part but I need to average to not include -1. How can I tell the program to not calculate -1 into the average.

#include <iostream>
using namespace std;
int main() {
//Declare variables
float grade[10]; // 10 array slots
int count;
float total = 0;
double average;

[code].....

View 1 Replies View Related

C++ :: Program That Compute Final Average Grades Of Class

Jan 28, 2013

An instructor needs you to write a program that will compute the final average grades in her class. There are 5 students in the class. Each student must take 2 exams and 4 quizzes as part of their final grade. The weight of each toward the final grade is as follows:

Exam 1 – 30%
Exam 2 – 30% Quiz 1 – 10%
Quiz 2 – 10%
Quiz 3 – 10%
Quiz 4 – 10%

You must use arrays to store each students 3 digit ID number, exam scores and quiz scores. A multi-dimensional array is mandatory. Request from the user the information needed then output all of the information as well as the final average grade for each student.

View 1 Replies View Related

C++ :: Find Average Of 5 Grades - Lowest Number Dropped

Nov 8, 2014

This is a simple program I am building to find the average of 5 grades where the lowest grade is dropped. I created a function findLowest() which accepts the 5 grades as arguments, finds the lowest grade and returns it as "lowest". I have tried many different way to find the lowest number. Right now, I am working with if...then statements.

#include <iostream>
using namespace std;
void printMessage(); //Prototype for printMessage
void getScore(int&); //Prototype for getScore with reference variable
int findLowest(int,int,int,int,int,int &); //Prototype for findLowest with reference variable

[Code] ....

View 2 Replies View Related

C++ :: Printing Name And GPA Of Student?

Feb 17, 2015

#include <iostream>
#include <string>
using namespace std;
struct studentType {
string name;
double gpa;

[Code] .....

View 11 Replies View Related

C :: Program That Grades A True / False Quiz - Data Available In Text File

Oct 14, 2014

You are to write a C program that grades a true-false quiz. The quiz data will be available in a text file; here is an example:

Quiz #8 (09/22/14) (corrected version)
TTFTTFTFTF
0080 TTFTTFTFTF
0340 TTFTFFTFTF

The first line in the data file is a comment that you may assume can be up to 80 charac- ters long; it cannot be blank. The second line contains the answer key for the 10-question true-false quiz. The following lines in the data file contain a student's id number in column 1 followed by their answers for the quiz in column 2. A 0 (zero) on a line by itself indicates that there are no more students to process.

Write a program that first reads in (from standard input; more on this in a moment) the comment line and answer key as strings followed by each student's data. Store the student's id numbers in an array. You are to "grade" each student's quiz using the key provided fol- lowed by recording their scores (in a second array) in order to be able to print them out later. You do not need to use an array of strings or characters in your program. Write your program allowing for up to 100 students, and you may assume that at least 1 student will have taken the quiz.

You should create test data text files and provide the data to your program using redirection from the command line (see the sample run below). Your program should output the number of students who took the quiz, the average score, the best score, and a table showing each student's id, score, and grade. The formatting, spacing, and labels in your output should 1 match the sample run below exactly.

Your program should determine each student's grade as follows: if the score is equal to the best score b or b−1, give an A. If it is b−2, award a B. Give C's for any score that is equal to b−3 or b−4, a D for b−5 and an F for all others.

Alright So I'm just stuck at comparing the key answer with student answer here is my code comparing one student's answer with the answer key . is that right ?? One more thing for some reason when i try to print answer[0] the result is nothing why is that

Code:
#include<stdio.h>
int main(void) {
char comment[80];
char answer [10];
char studentans [10];
int n=0,i=0,x=0;
int ID[10];

[Code] .....

View 1 Replies View Related

C# :: Calculating Averages - Display Employee Number And Average Of Three Test Grades

May 3, 2015

I have a project that I am working on and I have gotten stuck. I am getting a couple errors and would like to see how I can complete the program. Not very long of a program at that. My instructions are:

Write a program to calculate averages. Create a method named ReadData that will load a two dimensional array, named scoresArray, with the following data from a file:

132475.889.392.3
435686.383.498.3
479090.177.376.9
839373.976.389.3
556397.378.478.9
832987.365.377.2
271767.989.379.3

ReadData will have one argument, the scoresArray.

Create a method named DisplayAverages that will display the emplyee number (number starting 1324, 4356 etc) and the average of the three test grades. DisplayAverages will have one argument, the scoresArray. Your output should closely resemble the following.

Student #Test1Test2Test3Average
132475.889.392.385.8
etc, etc

Round averages to one decimal place. Passing arguments is important for this program. No global variables are allowed, except for the streamReader and the streamWriter. The scoresArray must be declared in Main and passed as an argument to the methods ReadData and DisplayAverages.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LibUtil;
using System.IO;
using System.Text.RegularExpressions;

[Code] ....

When I run the following just to see where I am getting I get the following error:

UsersJoeDocumentsVisual Studio 2013ProjectsCIS110Program12Program12Prog
ram12Dat.txt was opened
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the boun
ds of the array.
at Program12.Program.ReadData(Double[,] scoresArray) in c:UsersJoeDocument
sVisual Studio 2013ProjectsCIS110Program12Program12Program.cs:line 66
at Program12.Program.Main() in c:UsersJoeDocumentsVisual Studio 2013Proj
ectsCIS110Program12Program12Program.cs:line 24
Press any key to continue . . .

What am I missing here? I believe I have passed the arguments properly, but I am unable to declair the array within the bounds of the array?

View 2 Replies View Related

C :: How To Get The Average Score For Each Student

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

C/C++ :: Student ADT - How To Delete A Record

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

C :: Add More Student Information To The Specific Txt File?

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

C# :: Display Student Who Get Highest Marks

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

C++ :: Linked List Of Student Database

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

C++ :: How To Change Just A Single Student Data

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

C++ :: What Is Process Of Student Profiling System

Oct 3, 2014

what is the process of student profiling system using c++?

View 2 Replies View Related

C++ :: Linked List To Store Student ID And GPA

Apr 2, 2014

So I have to store a student Id and gpa and name in a linked list. I keep getting error messages.

Like: lab 20.cpp(43): error C2628: 'Student' followed by 'int' is illegal (did you forget a ';'?)
(43): error C3874: return type of 'main' should be 'int' instead of 'Student'
(71): error C2664: 'Student::Student(const Student &)' : cannot convert parameter 1 from 'int' to 'const Student &'
Reason: cannot convert from 'int' to 'const Student'
No constructor could take the source type, or constructor overload resolution was ambiguous

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
struct Student {
string name;
double gpa;

[Code] ....

View 1 Replies View Related







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