Formatted an integer w/decimal places to match rounded output of averages. Isn't 1.00 still an integer? Teacher says no.

CZroe

Lifer
Jun 24, 2001
24,195
857
126
Long story short, she says when I display the whole number "3" as "3.00" in my program just to visually match other displayed values which are not whole numbers, that "3.00" is not an integer. If you know programming, an in-depth explanation of the situation and programming technique follows. This is necessary in case someone wants to support my technique in my case against the teacher. If you have a short answer for my short story, please skip what's below and reply. Otherwise, do what you will. Thnx!

Hmm. My Advanced VB teacher is a little anal about certain things. She demanded that output of certain statistics be integers because "You can't seat .3 people." I understood. In my application I used integer variables to create totals and averages from a sequential access file.
The output was:

Total Males: 3.00
Average Age: 34.33

Total Females: 3.00
Average Age: 30.67

Because the number of males and females in the file were all integers, I used integer variables for the calculations and outputted them as integers to label controls.

For the averages, I performed the calculation on intAgeTotal and intGenderTotal and outputted the decimal result directly to the label for accuracy. You may not say you are "Whatever point whatever years old" but that does not mean you can't have an average of ages formatted in decimal notation, but she insists that the average age should be 34. Just because you can't have 3.8 people at your house for poker every Wednesday night doesn't mean you can't average 3.8 people every Wednesday night, but I'll let her have this one.

However, I also lost additional points because of the integer calculations performed earlier, meaning it was not counted as the same error. To format the output to match margins with the non-integer output, I used to format function to add two decimal places to the total ages. The value is still an integer value. She apparantly thinks that 3.00 is not an integer, and seperately counted off for this "error."

Here's a shot of the formatted output

Did I really do something wrong when I formatted the label displays?
rolleye.gif


This may not seem like a big deal, but TRUST me: This teacher has been nitpicking and attacking me left and right. It's clear that she's trying to fail me, so every little bit of support helps. I just need a little more proof that she's pushing it to get this whole situation turned around. So far, the best student in the class has the worst grade and it's not the first time she's done this...

Thnx!

PS, here's her grading notes for my two exercises for that tutorial (lc1Done, lc2Done):

"lc1Done - The name of the application (as saved on disk) should not display in the title bar (-10)
Note: Neither should your name

lc2Done - 4 labels w/ Book Title cap. (-20)
App. name should not be in title bar
Note: Nor your name (-10)
Avg ages are not rounded -(10)
totals should be integers (-10)"

When I insisted that they were rounded to two decimal places, she said they were not rounded (Obviously, she meant round them to integers which was clear later)
 

Kevin

Diamond Member
Jan 1, 2002
3,995
1
0
I'm pretty sure she's right. Like in C++ if you want decimals, you'll have to use float instead of int...
 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
I'm talking OUTPUT here though, not calculations. The calculations were performed and outputted to the labels as integers. Only then were they formatted with decimal places for a uniform look. The value remains "3" and therefore by the definition of integer, "a whole number," they remain integers as she requested in the formatted output.
 

Kevin

Diamond Member
Jan 1, 2002
3,995
1
0
But it sounds like she wants everything rounded off, so by you adding the .00 and keeping the averages with decimals, you were wrong...
 

RossGr

Diamond Member
Jan 11, 2000
3,383
1
0
Why can't you have a decimal for the average age? Perhaps she would have been happier with 30 years and 9 months as the average?

On the other hand, since your ages were only given to 2 digits, that is really all that has meaning in the result. So expressing the fraction is really information you do not have. To express the number of moths in the average each person would have had to give thier age in months.
 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
Originally posted by: Kevin
But it sounds like she wants everything rounded off, so by you adding the .00 and keeping the averages with decimals, you were wrong...

I agree, it certainly sounds like that AFTER she graded it. BUT I could have formatted an integer anyway I wanted if she hadn't said anything about it beforehand couldn't I? Well, she didn't :( She just said you can't have half a person...

As for averaging ages, it certainly can be computed with decimals or else the average is less acurrate. The months/partial years that were not factored in to the average are irrelevant because we are not trying to factor those out. Only whole number ages were used, therefore we're looking at an accurate version of the average of these ages.
 

atom

Diamond Member
Oct 18, 1999
4,722
0
0
Do you have a link to the assignment? If these things weren't specified beforehand it seems a little harsh, but if she specifically stated she wanted them a certain way and you failed to do it like that then it's really your own fault, no matter how stupid the deductions seem.
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
How many points was that assignment? 100? Your teacher/prof is a complete jerk. The amount of points she took off for trivial things is absurd. You do need to pay more attention to the details though.
 

silverpig

Lifer
Jul 29, 2001
27,703
12
81
If she didn't specify first, then the average age thing is crap. Technically, RossGr got it when he was talking about significant digits, but this is compsci, not a formal physics write up. I'd let you slide on that for sure (hell, I wouldn't even have caught it, and would actually prefer to have some sort of decimal in that one).

As for the number of people... Well I wouldn't even have formatted it in a decimal. It's pointless really. I'd have told you not to do it again, maybe taken a little off, but wouldn't have made a huge deal out of it.
 

Kelemvor

Lifer
May 23, 2002
16,928
8
81
Did you format the variable in the programming to include the .00 and then output that? Or did you output the variable (containing just the '3') and then manually send ".00" to the output as well? If you did it the second way, then technically the 3 is the integer with some manually added .00's after it. But if you took the "3" and turned it into "3.00" and then it's not technically an integer anymore.

HOWEVER, just foudn this exceprt from searching for INTEGER at divtionary.com

An inductive definition of an integer is a number that is
either zero or an integer plus or minus one. An integer is a
number with no fractional part. If written as a fixed-point
number, the part after the decimal (or other base) point will
be zero.

So this says that if you write 3.00, it's still an integer because the aprt after the decimal is 0. It's just an integer being displayed as a fixed-point(decimal)
 

alkemyst

No Lifer
Feb 13, 2001
83,769
19
81
If you are dealing with integers you do not ever put "point anything" after.

Regardless of your formatting desires, that output tells someone the number 1.00 is precise to two decimal places....integers don't have any decimal places.

It's a matter of instructions though....I'd prefer to show them as you did, but if it's calling for integer you need to display it as one.
 

markuskidd

Senior member
Sep 2, 2002
360
0
0
Originally posted by: alkemyst
If you are dealing with integers you do not ever put "point anything" after.

Regardless of your formatting desires, that output tells someone the number 1.00 is precise to two decimal places....integers don't have any decimal places.

It's a matter of instructions though....I'd prefer to show them as you did, but if it's calling for integer you need to display it as one.

 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
Originally posted by: FrankyJunior
Did you format the variable in the programming to include the .00 and then output that? Or did you output the variable (containing just the '3') and then manually send ".00" to the output as well? If you did it the second way, then technically the 3 is the integer with some manually added .00's after it. But if you took the "3" and turned it into "3.00" and then it's not technically an integer anymore.

HOWEVER, just foudn this exceprt from searching for INTEGER at divtionary.com

An inductive definition of an integer is a number that is
either zero or an integer plus or minus one. An integer is a
number with no fractional part. If written as a fixed-point
number, the part after the decimal (or other base) point will
be zero.

So this says that if you write 3.00, it's still an integer because the aprt after the decimal is 0. It's just an integer being displayed as a fixed-point(decimal)

lblMaleTot.Caption = Format(intMales, "Fixed") & " "
lblMaleAvg.Caption = Format(intMaleAge / intMales, "Fixed") & " "

Because there were no other calculations to perform with the outputted values, there was no need to assign output to another variable.

Originally posted by: mugsywwiii
How many points was that assignment? 100? Your teacher/prof is a complete jerk. The amount of points she took off for trivial things is absurd. You do need to pay more attention to the details though.

Yes, the assignment was for 100 points. The problem is, I did pay attention to details. In the exercise instructions, we were told what to name the form and project. The application had no name hinted at all. In my first Visual Basic class, the instructor required that every student add " - Student's Name" to the form's caption. I wanted to make sure I did everything possible to get this perfect, so I followed her rules AND his rules. Because the student's name follows the application name which follows the currently opened file, I still needed an application name. The exercise names were lc1Done and lc2Done. Were were told to name both the form and the project after the exercise so I threw lcXDone in the caption as the application name also. Then she made up the "The name of the application (as saved on disk) should not display in the title bar" thing and subtracted 10 points from both applications. I've certainly never heard that rule before! The only details I could have corrected by being careful were the label cases, for which she deducted points for each label! (-20)
 

NogginBoink

Diamond Member
Feb 17, 2002
5,322
0
0
Um... no matter which one of you is right, the teacher is the final authority in the classroom.

You don't get on the teacher's good side by arguing.

You get on the teacher's good side by biting your tongue, gritting your teeth, and saying, "I see your point. Thanks for bringing that to my attention. I'll go ahead and correct that in my program now."

This is not an issue about VB or about programming. This is an issue about politics.

Get used to it. It's real life. Get good at politics now and it'll serve you well for the rest of your life.

No matter who's right, in the classroom, the teacher is always right.

Learn to work the system.
 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
Perhaps you should read the old story including my brother's experience. It's about the teacher's authority alright...

The class is over and she can't get away with the other things she has done. Trust me, that other thread was only the first, and least minor. What I'm referring to in this thread is just me scrambling for a few NEEDED extra points AFTER the other infractions and is not representational at all of what she really did.

LITERAL Example:

The test question:
"Short essay: Describe how the save command in Windows applications work. Specifically, address how it handles a file that has been previously saved and how it handles a file that has not been previously saved."

I got the question wrong. This was her grade note of what the correct answer should have been:

"IF not already saved, the Save As dialog box is displayed."

Here is my answer:

"The save command in standard windows applications is programed to save work in the current application without further instruction unless required. Further instructions may be required if the work being saved has not previously been saved to a file and the application requires a filename to save it as. In this case, the application will allow / require you to choose a path and filename as if you used the Save As command."

When given our tests back for review, I pointed out that the question did not specify whether it was asking for the appearance or logic, so I had given both including more detail than necessary. "After all, it says essay" (There is a seperate section for short-answer questions.) She looked at it, made a few comments like "but you didn't point out that it does something different" or "it's still wrong because I asked for..." to which I would point out that my answer says EXACTLY that and EXACTLY what her answer says, only with more detail. She agreed to look at it again later, so she could take my test, file it away and never get back to me on it. This is EXACTLY what she did in the situation described in the old post I linked to. These quotes are letter for letter accounts of what was on the test including spelling, grammar, punctuation and capitalization errors.
 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
But "1" is and visual formatting is irelevant is it not? After all, I can have 3.00 people over for poker...
 

KEV1N

Platinum Member
Jan 15, 2000
2,932
1
0
If there's a decimal point there, it's not an integer. It's a floating point number. Yes, even though we take 1.00 to be conceptually the same as 1, 1.00 really is different from 1.
 

Lonyo

Lifer
Aug 10, 2002
21,938
6
81
1.00 suggests that there's a need for decimal places, decimal places usually imply rounding, if you've rounded something, then it's not being shown as an integer. 1 is an integer, 1.00 is a rounded number that's esentially equal to 1, but isn't actually 1, since you've been rounding it, so it could have been 1.001, but needed to be displayed as 1.00 because it was 2 2 decimal places or 3 significant figures.

As people have said, decimal places suggest a number is not an integer.
 

CZroe

Lifer
Jun 24, 2001
24,195
857
126
OK, I agree. I still don't think that it suggests that I totaled a partial person and therefore it's wrong as her logic would say. That's supposedly why she requested integers be used, but whatever is displayed in a label is simply a string containing a value that once was an integer. Formatting the output to match columns was actually in the list of guidelines I was told to follow... :(