473,385 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

files,overload

hi , I would like to know how I can do the following issue:

If I have a class person , and I inherit from it a class called
student for example.
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.
thank u. & merry x-mas
Jul 22 '05 #1
6 1080

"pauli" <be********@hotmail.com> wrote in message
news:dd**************************@posting.google.c om...
hi , I would like to know how I can do the following issue:

If I have a class person , and I inherit from it a class called
student for example.
Sounds like you have no idea about OO
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.

Sounds like you have no idea about OO and want someone who does to do your
homework for you

thank u. & merry x-mas

Jul 22 '05 #2
pauli writes:
If I have a class person , and I inherit from it a class called
student for example.
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.


I would look into "cloud diagrams". There is a book, _Mastering
Object-Oriented Design in C++_ by Cay Horstmann which I think would be
useful. I suppose it is out of print, the book never seemed to catch on,
but your school library should have a copy unles the library is a complete
joke.
Jul 22 '05 #3
osmium wrote:
pauli writes:

If I have a class person , and I inherit from it a class called
student for example.
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.

I would look into "cloud diagrams". There is a book, _Mastering
Object-Oriented Design in C++_ by Cay Horstmann which I think would be
useful. I suppose it is out of print, the book never seemed to catch on,
but your school library should have a copy unles the library is a complete
joke.


Do you think Usenet-aware teachers assign homework like this on purpose,
so posts from lazy students will be obvious?

Jul 22 '05 #4
Jeffrey Schwab writes:
osmium wrote:
pauli writes:

If I have a class person , and I inherit from it a class called
student for example.
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.

I would look into "cloud diagrams". There is a book, _Mastering
Object-Oriented Design in C++_ by Cay Horstmann which I think would be
useful. I suppose it is out of print, the book never seemed to catch on, but your school library should have a copy unles the library is a complete joke.


Do you think Usenet-aware teachers assign homework like this on purpose,
so posts from lazy students will be obvious?


No I don't. I thought it was a reasonable question, one that I could have
easily had myself a few years ago. I don't know why, but most everybody had
better instructors than I did in school. Or was I just dumb?

To the OP: The first decision you must make is if this is to be an STL
based program. The reason is the sort, lurking in the background; the STL
way will be a lot easier. You make your decision based on the book you have
been assigned, the reading assignments so far, and the instructors attitude
towards the STL. Does he think it is the greatest thing since canned beer?
If so, go with the STL, IOW you will have a *vector* (most likely) of
students, rather than an *array* of students.
Jul 22 '05 #5
On Wed, 24 Dec 2003 09:56:15 -0500, Jeffrey Schwab
<je******@comcast.net> wrote:

[snip]
Do you think Usenet-aware teachers assign homework like this on purpose,
so posts from lazy students will be obvious?


No, lazy students are obvious because they want the whole thing
solved for them.

A student who is not lazy might post something like:

I am having trouble programming a binary search. My code below
works with the exception that it never finds the highest element.
When I adjust the initialisations, I can get it to work for the
highest element, but then it fails on other extremes. My text does
not cover this point, at least, not that I could follow. What am I
doing wrong, please?

[code]

Note how precise the request for help is. BTW, I have had this
problem myself. I still do not quite get it.

Sincerely,

Gene Wirchenko

Jul 22 '05 #6

<op>
If I have a class person , and I inherit from it a class called
student for example.
Now what shell I do if I want to enter the student's 4 grades then
read them later( using files),
than add these grades using overloading .
And finally sort the grades from the lowest to the highest , and get
the average.
</op>

osmium wrote:
Jeffrey Schwab writes:
Do you think Usenet-aware teachers assign homework like this on purpose,
so posts from lazy students will be obvious?


No I don't. I thought it was a reasonable question, one that I could have
easily had myself a few years ago. I don't know why, but most everybody had
better instructors than I did in school. Or was I just dumb?


Well, I don't think you're dumb, and I have a hard time believing your
programming instructors were worse than mine. I guess my issue with
this sort of post is that no attempt at code has been made, no "first
pass" to be fleshed out or improved. If someone really doesn't even
have any idea where to begin, I certainly don't mind trying to help, but
the OP on this thread seemed to have a pretty good idea of what steps
needed to be taken, and in what order.

Anyway, I suppose it was unnecessarily harsh to use the word "lazy;" my
apologies to Pauli.

Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lobrys | last post by:
Hi I am building a dotnet 1.1 app, in VB.net ... I would like to have several config files corresponding to multiple envirronment (Database, local Machine, Application, User...) and overloads...
1
by: Piotre Ugrumov | last post by:
I'm following your help. I have written the overload of the operator <<. This overload work! :-) But I have some problem with the overload of the operator >>. I have written the overload of this...
3
by: Piotre Ugrumov | last post by:
I have done the overload on the operator >> and << in the class Attore. These 2 overload work correctly. I have done the overload of the same overload in the class Film. The class film ha inside...
17
by: Chris | last post by:
To me, this seems rather redundant. The compiler requires that if you overload the == operator, you must also overload the != operator. All I do for the != operator is something like this: ...
1
by: jez123456 | last post by:
Hi, I need to check that 4 access database files exist and they are not in use before I can process them. For example say my files are: C:\test\data1.mdb C:\test\data2.mdb C:\test\data3.mdb...
9
by: Tony | last post by:
I have an operator== overload that compares two items and returns a new class as the result of the comparison (instead of the normal bool) I then get an ambiguous operater compile error when I...
5
by: Alan Searle | last post by:
I am exporting ms-access data to XML files. This works fine. However, I need to insert one line at the top of each exported file (i.e. a reference to the XSL file) and am having a problem with...
2
by: mauricesmith42 | last post by:
Sorry i know this is rather large to be posting, but in order to understand the question you have to see all the code //#include <windows.h> //needed for opening folders #include...
15
by: Andy B | last post by:
I need to count files in a certain directory that has the string -Contract Template.xml at the end of it. How would I do this?
5
by: jknupp | last post by:
In the following program, if the call to bar does not specify the type as <int>, gcc gives the error "no matching function for call to ‘bar(A&, <unresolved overloaded function type>)’". Since bar...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.