Re: C program question

  • From: Gabe Vega <theblindtech@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sun, 28 Oct 2007 09:10:45 -0700

ok two things,

1. what happened to the original mailing lists, and website? I've beengone for a while and now that I want to get in to programming for mobile phones, ppc and smartphones I a stuck, no scripts nothing are on the site anylonger.

2. what do you think of embedded4.0 or ppc sdk 2003? or 5.0?

am i trying to tackle this from the wrong angel, is there jaws support for what I am trying to do. what I.D.E. would be best?

On Oct 28, 2007, at 9:10 AM, Sina Bahram wrote:

Understood, then nevermind the rest of my comments

Take care,
Sina


-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John Miller
Sent: Sunday, October 28, 2007 11:52 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: C program question

My major is computers and info technology. This is the only actual
programming class, unless you count HTML which I taught myself years before I aced that class 6 weeks in to a 15 week class, that I absolutely need to graduate. As for what I'll do after this class, no, I plan to never touch C, or any other similar programming language again, I don't have the patience for it or the interest in programming. Beyond this, the rest of the classes are pretty good, and I like them and generally come out with A's or B's so far. Calculus is another one I'll probably have problems with but I'll save that one for later on. For programming though, after this class, if I pass it, I have no intention of having anything to do with it again and if I do decide to work with it down the road, I'll do like I did with HTML and learn it my own way, on my own schedule and probably figure it out a lot easier especially if I don't have other classes to deal with at the same time but my intention is to pass this class, no matter what it takes and never touch it again. If I don't, I'll have to change major because I can't afford to
take it again and I can't get it covered a second time.
----- Original Message -----
From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Sunday, October 28, 2007 11:39 AM
Subject: RE: C program question



Just to get this straight.

You are not planning on doing computer science or basically
programming of any kind after this, right?


If you are, I think that I'd have a different response for you, but I
just want to make sure whether this is a one time thing for you, or if
you're planning on continuing in this field?

Take care,
Sina

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John
Miller
Sent: Sunday, October 28, 2007 11:26 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: C program question

It was late and he takes off for that too, I could have waited another
day or 2 and got the 0 for not handing it in, or I can try for the 30
or 40 I may get on that one and take that because I wasn't overly late
with it. I wake anything and everything I can get in this class
because even 1 month ago I knew I wasn't going to pass it. Now I have
a shot. Depending on the midterm and how much he likes it, I know what
I got right and didn't, but if he likes what I got right I stand a
pretty good chance at passing if I can just come close to passing on
the final. I'll take anything I can get on the homework to add a
little cushion because while it's not worth much of the final grade,
it could make the difference and that 30 or 40 I may get on this one
sure beats the 0 I'd get waiting another day to finish it for nothing.
I've had classes like that before where that 2 or 3 extra points I
shot for when I could made the difference. I hate doing it that way,
but you gotta do what you gotta do sometimes.
----- Original Message -----
From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Sunday, October 28, 2007 11:08 AM
Subject: RE: C program question




If your turning in code that you have not compiled your not going to
get a passing grade.  Sorry but that's just how it is.

Ken

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John
Miller
Sent: Sunday, October 28, 2007 5:26 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: C program question

Thanks. I had to submit it as it was, but hopefully the grade won't
be too bad and I can fix it in time to work on next week's
assignment, pointers I think it is. I guess that's just a case of
adding something easy to this program when it's right so hopefully it
won't be too bad and then there's only 1 more and the final to go.
Unless I did worse on the midterm than I think, then I probably won't
bother since I haven't had a decent night's sleep since the semester
started and I think
this class is why.

Other personal issues too, but I think this is number 1 reason.
Thanks, I'll definitely work on it with this info and see where I end up.
----- Original Message -----
From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Sunday, October 28, 2007 12:20 AM
Subject: RE: C program question


emp.clock
Where you have
struct emp



You should define the structure like

struct Employee{
int Clock;
float wage;
float hoursWorked;
}


Where you have

struct employee emp(5);

You should have

Struct Employee emp[5];

Then the rest should work better or at least give you errors you
understand.

Ken






-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John
Miller
Sent: Saturday, October 27, 2007 5:01 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: C program question

If I actually include the code, I think you can help me better.
Sorry, I didn't sleep last night.

#include <stdio.h>

/* function prototypes */

void initData(int *clockNumberPtr,float *wagePtr,float
*hoursWorkedPtr);

void getHoursWorked(int entry,int * clockNumberPtr,float
*hoursWorkedPtr);

float calculateOverTime(int entry, float *wagePtr,float
*hoursWorkedPtr);

float calculateGrossPay(int entry, float *wagePtr,float
*hoursWorkedPtr);

void displayEntry(int entry, int *clockNumberPtr,float
*wagePtr,float *hoursWorkedPtr);

struct emp

int main (char *argv, int argc)

{ /*get clock info*/

int clockNumber; /*employee number*/

float wage; /* declare wage */

float hoursWorked; /*enter hours worked*/

struct employee emp(5);

int i=0;//index for for loop

initData(clockNumber,wage,hoursWorked);

for (i=0;i<5;i++)

getHoursWorked(i,clockNumber,hoursWorked);

printf("Clock #\tWAge\thours\tOver time\tGross Pay\n");

for (i=0;i<5;i++)

displayEntry(i,clockNumber,wage,hoursWorked);

struct emp myempArray[5];

return(0);

} /*end get clock info*/



void initData(int *clockNumberPtr,float *wagePtr,float
*hoursWorkedPtr)

{ /* declaring clock numbers and wage*/

int i; // index for for loop

emp[0].clockNumber=98401 ; /*first employee*/

emp[1].clockNumber=526488; /* second employee*/

emp[2]clockNumber=765349; /*third employee */

emp[3]clockNumber=34645; /*forth employee*/

emp[4]clockNumber=127615; /*fifth employee */

emp[0]wage=10.60; /* first employee wage

emp[1]wage=9.75; /*second employee wage

emp[2]wage=10.50; /* third employee wage */

emp[3]wage=12.25; /*employee 4 wage */

emp[4]wage=8.35; /* fifth employee wage 8/

// init hours worked to 0

for (i=0;i<5;i++)

hoursWorkedPtr[i]=0;

} /*end declaring clock and wage numbers*/

void getHoursWorked(struct employee emp[])

{ /*prompt for hours*/

printf ("Enter hours worked by %d: ",clockNumberPtr[entry]);

scanf_s("%f", &(hoursWorkedPtr[entry]));

} /*end prompt for hours*/

float calculateOverTime(int entry, float *wagePtr,float
*hoursWorkedPtr)

{ /* figure out overtime */

float overTimeHours=hoursWorkedPtr[entry]-40;

float overTimePay=0;

if (overTimeHours>0)

overTimePay=overTimeHours*(wagePtr[entry]*1.5);

return (overTimePay);

} /* end figuring out overtime */



float calculateGrossPay(int entry, float *wagePtr,float
*hoursWorkedPtr)

{ /* determine gross pay*/

float grossPay=0;

if (hoursWorkedPtr[entry]>40)


grossPay=(40*wagePtr[entry])+calculateOverTime(entry,wagePtr,hoursWor
k
edPtr)
;

else

grossPay=wagePtr[entry]*hoursWorkedPtr[entry];

return (grossPay);

} /*end determine gross pay */

void displayEntry(int entry, int *clockNumberPtr,float
*wagePtr,float
*hoursWorkedPtr)

{ /*desplay results */

printf ("%d\t%0.2f\t%0.2f\t%0.2f\t%0.2f\n",

emp.clockNumber,

emp.wage,

emp.hoursWorked,

calculateOverTime(entry,wagePtr,hoursWorkedPtr),

calculateGrossPay(entry,wagePtr,hoursWorkedPtr));

} /* end desplay output*/

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: