[Show all top banners]

Unit
Replies to this thread:

More by Unit
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 Help on c program

[Please view other pages to see the rest of the postings. Total posts: 32]
PAGE:   1 2 NEXT PAGE
[VIEWED 9986 TIMES]
SAVE! for ease of future access.
The postings in this thread span 2 pages, View Last 20 replies.
Posted on 06-20-06 7:58 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Is there any one who can help on C programming? This my first program class and i am having really hard time understanding it. would you guys PLEASE help me out?

here is the question.
A company pays its employees as managers (who receive a fised weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hrs they work and time and half for overtime hrs), commision workers(who receive a $250 olus 5.7% of their gross weekly sales), or pieceworkers(who receive a fixed amount of one type of item). write a program to compute the weekely pay for each employee. you do not know the number of employees in advance. Each type of employee has its own pay code: Managers have paycode 1, hourly workers have code 2, commission workers have code 3 and pieceworkers have code 4. Use a "SWITCH" to compute each employee's pay based on tha employee;s paycode. within the "SWITCH", prompt the user(i.e the payroll clerk) to enter the appropriate facts your program needs to calculate each employee's pay based on that employee's paycode. (your program must use loop)
 
Posted on 06-20-06 8:03 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

the question itself is self explanatory. do some study on "switch" statement and you will get to know about going for it.

if you want us to write the entire code then that's a different story. you know what "plagiariasm" is right?


Loote
 
Posted on 06-20-06 8:20 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Yes...
Don't want to discourage you but if you can't write this program then you might as well forget about programming. Do some thinking and read your textbooks or reasearch the net instead of posting it in the forum. You can get a program working while you're in school but you'll be in big trouble at work if you can't write this program.

This is the simplest program one could ever write.

Goodluck and sorry.
-LoGiN
 
Posted on 06-20-06 10:01 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thankx Loote and login, Can u guys give me some hints ? i couldn't even start...i m confuse on my variables .....this my first computer class. i did read books n i could do short ones, this is the one that i m having hard time on.
 
Posted on 06-20-06 10:15 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

here is a simple approach. this is a typical OO programming exercise (O: . is this really in C or C++/java

in C++/java
assume that all the employee types
1. Manager
2. Hourly
3. comission
4. pieceworker
to be a sub set of main type employee.

so create a class called employee and write a function called calculate_pay.
then you can create Manager class to be a sub class of employee and overload the calculate_pay with appropriate formulae and required parameter. follow same for others as well.

in the main function.. u can use a while loop and call each calculate_pay based on input.


now in C you can convert the class i mentioned before into function and just use it with different calculate_pay..

i hope this helps............

=====================================================
as always
what do i know (O:
 
Posted on 06-20-06 10:18 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

unit bro,
u can have any number of variables as per ur need inside each case of the switch statement. since you are novice, don't worry abt overusing variables for the time being. you can have "weekly_salary" as a common (local or global) variable which gives weekly salary for each case. plus u will also need another variable for the case (like case '1', case '2' and so on) that goes as an argument in the switch statement (like switch (option) if "option" is the variable name).

u need to do the math to calculate the weekly salary for each which go inside each case. the math is pretty straightforward.

hope it helps.

Loote
 
Posted on 06-20-06 10:20 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thapap,

damn u r fast man!!

but unit dude is novice to programming. dont teach him OOP. hehe that would be pretty overwhelming for him at the moment.

Loote
 
Posted on 06-20-06 10:38 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thankx guys, I really appreciate. i m still working on it but still having some trouble
 
Posted on 06-20-06 10:43 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thapap, I'll soon be needing your help!:)
 
Posted on 06-20-06 10:46 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

oho filip folop, k ho hamilai chahin baal matlab chhaina ...hehe

u also nocturnal ho? herana hijo raati i went to bed at 5 oclock in the morning tehi pani nidra laagena then woke up for one more hour and went to bed at 6. u believe it? ;)

Loote
 
Posted on 06-20-06 10:53 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

looks like all computer gigs out here.loote .. hahaha u too?
ya loote i need help too :)

This is what i am trying to do, i need to create a form in access but the form needs to be in IE (browser based form).basically gui IE and backend access.Can u help?

i will ask you some more :)once u get this for me.heheeheh
 
Posted on 06-20-06 10:54 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

gig= geeks.hahahahah.i normally don't correct my typos.ahahahah
 
Posted on 06-20-06 10:55 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

When the time comes, I sure will holler at you for the help. Thanks! I wonder why are being so informative about yourself!:S

Like others have said, it is mandatory to write your own codes. That's how your learn.It's the experience talking. Writing programs cannot be learned until you learn and write on your own.
Good Luck!
 
Posted on 06-20-06 10:58 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

flippu,
for u any time (O: ...
u must b joking 4 real right...
smart person lyk u need help .. re bho bho.. joke nagarnush hajur
malai ta actually kehi ni aaudaina (O:
=====================================================
as always
what do i knoe (O: ...
 
Posted on 06-20-06 11:01 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

imi, i m not an IT guy, my major is sth else, i need to do quite a lot programming hence i know a bit abt programming.

as for your question goes, i have not extensively worked in Access alone. however i know a bit of visual basic. you can create a browser based form in VB and then get it connected with the access. have u worked in VB?

Loote
 
Posted on 06-20-06 11:04 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I know about that loote,
but i don't know VB , i know only fortran and Lisp .Can we do it with fortran or Lisp?
ok!
i am not cs guy so :)
 
Posted on 06-20-06 11:07 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

oh ya can we do in Matlab??:)
 
Posted on 06-20-06 11:08 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I wouldn't have asked for help if I was good in writing codes. Btw I have a querry for you thapap. You doing intern at the moment? Just a curiosity!

Loote, maxed out again eh? Ani what did I hear! You know a bit about VB. :) Nice, nice!
 
Posted on 06-20-06 11:11 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

i m sure fortran and and matlab does not have browser support feature. and i m quite sure lisp does not offer it too, although i m not 100% sure.
where did u learn lisp? the only one time that i used it is in my AI class. i hated it in the beginning but its strong i only realized later.

go for VB, it won't take long to learn. with online help and MSDN you would be able to get it done easily, i m sure.

Loote
 
Posted on 06-20-06 11:13 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

so Im1
seems 2 be an EE from 1990s writing programs in lisp and fortran.. from MIT (O:

sure Im1 u can do that in MATLAB.. Matlab has C extension to it.. so write a program to access ==>>> access database .. (O:

if u write an JAVA applet then it can be done very easily. u need to access the database. jdbc provides basic connectivity..

PS. I AM ALSO NOT A CS MAJOR (O: .
 



PAGE:   1 2 NEXT PAGE
Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 30 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
मन भित्र को पत्रै पत्र!
They are openly permitting undocumented immigrants to participate in federal elections in Arizona now.
Driver license help ASAP sathiharu
Why Americans reverse park?
lost $3500 on penny stocks !!!
ढ्याउ गर्दा दसैँको खसी गनाउच
TPS Reregistration and EAD Approval Timeline.......
nrn citizenship
जाडो, बा र म……
Changing job after i-140 approval
Trasiting through Istanbul, Turkey
Is this a progressive step?
Nepalese Students Face Deportation over Pro-Palestine Protest
Nepali **fake** Veterans. Be aware!!
whats wrong living with your parents ?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters