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


ADVERTISEMENT

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++ :: 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 :: 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 :: 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 :: Display Current Time And Date In Program And Use Variable To Store Each Of Values

Feb 16, 2013

i need to display the current time and date in my program and use variable to store each of the time values like

a = 10
b = 29
c = 31

printf(``%d : %d : %d``, a,b,c);

which then give the output as - 10:29:31

How to save the time in variables in C....

i am using C in windows 7 and my complier is Bloodshed Dev C++

View 7 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/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/C++ :: Cannot Display Top10 Students With Highest Votes

Feb 27, 2015

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

[Code]....

View 6 Replies View Related

C++ :: How To Store Class Info Entered By User Into Array

May 7, 2013

So I have an array of my own class, "Restaurant," but I'm having a hard time figuring out how to store the info entered by the user into the array.

In total, I have two classes. I will show you all I have, it's a lot but I know it will be easier to understand.

My problem is in the AddRestaurant(), since that is where I should ask the user for all the information and store it in the array.

Also consider that I have to use the FTime class as well to handle the time. Basically I want to do something like this:

info[count].SetRating();

which will put the rating part of the class Restaurant into the array[count]

Also, my program doesn't compile because of the AddRestaurant and PrintAll functions since what I am showing is what I want to do, not what works.

//main.cpp
#include <iostream>
#include <iomanip>
#include <string>
#include "Restaurant.h"
#include "FTime.h"
int ReadMenuChoice();

[Code] .....

View 4 Replies View Related

C++ :: File Writing - Input Your Login Info And Program Writes That Info To A Text File

Jan 30, 2013

I'm trying to make a program that you input your login info and it writes that info to a text file. Then, later on once I get my problem fixed, the program will read the info to the user. my code is as follows(the input part is a bit lengthy):

// Password Log
#include <iostream.h>
#include <fstream.h>
#include <string>
#include <time.h>
using namespace std;
ofstream login;

[Code] ....

What my problem is when I choose "Input new login info" it automatically inputs I have no clue, and calls next program.

View 3 Replies View Related

Visual C++ :: How New / Delete Store Internal Info About Allocated Buffer

Dec 9, 2014

I am using C++ new/delete operators to allocate/deallocate the buffers. I think for each allocated buffer, there should be an additional info block stores the size and other info about the buffer. How to know more details about this info block? I need to override these two operators and find such an info block is useful to my implementation.

View 3 Replies View Related

C Sharp :: Display MySQL Database Table User Info?

Aug 18, 2012

I was looking at this code:

private void button1_Click(object sender, EventArgs e)
{
string input = textBox3.Text;

[Code].....

And how to rewrite the code so that it display the MySQL table data for a specific user I already have a string called username and that stores the username entered on the login form. I want the code to use the username string to search for the name and display that users info.

My table contents are: username
First name
Last name
Position
Employee Id
Airline

View 7 Replies View Related

C++ :: Store And Print String On Screen

Sep 20, 2013

Given this sentence as an input: "Hello my name and "John" (with its spaces and capital letters), print it on the screen .. NB the phrase must be entered from the keyboard all at once ... you can do this in C / C + +?

View 3 Replies View Related

C++ :: How To Display Image On Output Screen

Nov 21, 2013

how to display an image on the output screen of c++ program.

I am using : Turbo c++(dos box) on win8

View 1 Replies View Related

C++ :: How To Display File With Numbers On The Screen

Apr 1, 2013

I have a file with numbers and want to display it on the screen.

View 15 Replies View Related

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 View Related

Visual C++ :: Edit / Update And Display Group Of 40 Parameters On Screen

Feb 26, 2014

I need to edit ,update and display a group of 40 parameters on screen. (10 parameters per page and use of Arrow Key pad or touch screen clicks to modify value)....

For that I will need .. Parameter No . , String Name , Point Screen Cord , double value , next element no. etc I have my old code with structure and array of structure written in C. I have translated it on C++/MFC .

How can I implement Class property of c++ ?

View 8 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++ :: Multidimensional Arrays - Enter Data Into Table And Display On Screen In Tabular Form

Sep 8, 2014

Write a program to enter data into a table and display on the screen in tabular form. I want to know where are the errors.

#include<iostream>
using namespace std;
int main() {
int table[3][4];
int r,c,i;
r=c=0;
while(r<=2)

[Code] .....

View 3 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 :: Store And Display 8 Bit Gray Scale Image

Mar 20, 2013

How to store and display an 8 bit Gray scale image in C captured from 8 bit Camera?

View 1 Replies View Related

C++ :: Store User Input Then Display Array Contents?

Jan 10, 2015

I'm coding a hangman game. I'm trying to store user entries so i can output them to show the user what they have already entered. Problem is that it's not display anything at all.

I'm trying to store multiple characters of course, and then display all characters stored.

char guess[27]={0};
cin >> guess[26];
int hit=0;
for(int i=0; i<len; i++) {
if( guess[26] == hidden_word[i] ) {
hit++;
select_word[i] = guess[26];
if(strcmp(hidden_word,select_word) == 0) {

[code]....

EDIT: I also get the error - Stack around the variable 'guess' was corrupted. At the end of the game.

View 6 Replies View Related

C++ :: Read Data From A File Then Store / Search And Display Using Classes And Arrays

Apr 12, 2013

A company uses two text files: one to store employees' details and another to log their sign in/out time.

The details file - called details.txt" has the following format: ID, Name, Date of Birth, SSN, Department, Position - separated by spaces.

An extract from the file looks like this:

10 alice 4/23/1972 123-45-6789 support assistant
3 bob 6/7/1980 111-12-1134 logistics manager
1 carol 10/2/1963 987-123-1143 admin ceo
2 dave 10/3/1974 902-22-8914 admin cfo
17 erin 6/13/1991 126-83-1942 technology supervisor
15 frank 2/22/1987 303-12-1122 logistics assistant

"timelog.txt" contains daily logs of when employees arrive and leave. It has the following format: ID, Date, Arrival Time, Departure Time - separated by spaces. An extract from the file looks like this:

10 2/11 0900 1700
3 2/11 0930 1730
1 2/11 1100 2000
2 2/11 1000 1530
17 2/11 0900 1700
10 2/12 1000 1830
3 2/12 0930 1730
1 2/12 1100 1900
2 2/12 1030 2000
17 2/12 0900 1700
15 2/12 1100 1600

I have to write a program that searches for specific records using some search parameter, and displays them. Ok first i have to read the data from the files and store them. this is what i have so far....

#include <iostream> //Accesses libaries for console input and output
#include <fstream> //Needed to access the fstream object to read files
#include <string> //Needed to access the string class
#include <cstdlib>

[Code] ....

I know my class and array code is totally wrong i dont know how to store the data for the info is in integer and string form... do i use strings, arrays?

View 1 Replies View Related

C++ :: How To Access Excel File From A Program - Search It For Data And Return Info

Nov 12, 2014

I have been asked to create a program that accesses an inventory file done in excel, look for a alpha-numeric code, which will be inputed by the user, and return to the user informations related to the position of that code, and informations related to the header of the column in which the code resides.

An example of the function I need the program to perform would be:

User inputs: 1429-R1

And the program returns: Marco's 6A, 8/21/2014, 3/7/2014.

using the following example of file:

Marco's 6A
Assessment 8/21/14 3/7/14
1584-R1 1584-R1 1584-R1
1461-2R1 1461-2R1 1461-2R1
1429-R1 1429-R1 1429-R1

View 1 Replies View Related







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