Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Report Card

Report Card

Ratings: (0)|Views: 37|Likes:
Published by ahmad
Define an array of student records using the Student_Record structureoriginal here
http://www.techimo.com/forum/showthread.php?t=90693
Define an array of student records using the Student_Record structureoriginal here
http://www.techimo.com/forum/showthread.php?t=90693

More info:

Published by: ahmad on Mar 04, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

06/04/2010

pdf

text

original

 
/file1.cpp//List the include files#include<stdio.h>#include<iostream.h>#include<stdlib.h>//the struct that is being made is being used outside this source.. Look at thelinked file strudent_record.h#include"student_record.h"//Define an array of student records using the Student_Record structstruct Student_Record students[3];//How to compute the grade and a way to find out which student you are onvoid compute_grade(int j) //index was int to keep track of which student was beingtested{float average = (students[j].labAverage + students[j].testAverage) / 2;// give test results on what grade the student should recieveif (average >= 89.5)students[j].grade='A';else if (average >= 79.5)students[j].grade='B';else if (average >= 69.5)students[j].grade='C';else if (average >= 59.5)students[j].grade='D';elsestudents[j].grade='F';j++;}//Define a function to input a student record, which consists of all the elementsof the Student_Record struct//This function should take the subscript of the student array as input.void input_record(int i){cout << "\t\t\t\t--------------\n\t\t\t\t| |\n\t\t\t\t| Input Info |\n\t\t\t\t| |\n\t\t\t\t--------------\n\n\n";cout << "\t\t\t\t Student " << i + 1 << "\n\n";cout << "Please Enter Student's " << i + 1 << " Last Name:\n";cin >> students[i].lastName;cout << "\nPlease Enter Student's " << i + 1<< " First Name:\n";cin >> students[i].firstName;cout << "\nPlease Enter Student's " << i + 1<< " Id#:\n";cin >> students[i].studentId;cout << "\nPlease Enter Student's " << i + 1<< " Lab Average\n";cin >> students[i].labAverage;cout << "\nPlease Enter Studen's " << i + 1<< " Test Average\n";cin >> students[i].testAverage;system("cls");}
 
void output_record(int i){system("cls");cout << "\t\t\t\t---------------\n\t\t\t\t| |\n\t\t\t\t| Report Card |\n\t\t\t\t||\n\t\t\t\t---------------\n\n\n";cout << "\t\t\t\t Student " << i << "\n\n";cout << "\nLast Name: \t" << students[i].lastName;cout << "\nFirst Name: \t" << students[i].firstName;cout << "\nStudent ID#: \t" << students[i].studentId;cout << "\nLab Average: \t" << students[i].labAverage;cout << "\nTest Average: \t" << students[i].testAverage;cout << "\nStudents Grade: \t" << students[i].grade;system("pause") // here is where i have my problem it will pause but only afteryou hit it twice and it doesn't do it when it should..//These are a few things i have tried to do to go around this problem. inputtingwhat i just call a stepper by using an int of x and then placing in a cin > x; sothat you type a key and press enter to move on.. that hasn't worked.. i have alsotried to force a print before the pause.. that hadn't worked.. there has been manymore things but i just can't think of what else to do to fix my problem..}void main(void){int i;for (i=0; i < 3; i++){input_record(i);compute_grade(i);}for (i=0; i < 3; i++){output_record(i);}}//student_record.h//List the include files#include<stdio.h>#include<iostream.h>#include<stdlib.h>//Define structuresstruct Student_Record{char lastName[20];char firstName[20];

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->