Click here to Skip to main content
15,902,189 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: how many seconds? PinPopular
CPallini8-Sep-08 0:06
mveCPallini8-Sep-08 0:06 
GeneralRe: how many seconds? Pin
Robert.C.Cartaino8-Sep-08 5:12
Robert.C.Cartaino8-Sep-08 5:12 
GeneralRe: how many seconds? Pin
CPallini8-Sep-08 8:15
mveCPallini8-Sep-08 8:15 
GeneralRe: how many seconds? Pin
BillW338-Sep-08 6:27
professionalBillW338-Sep-08 6:27 
GeneralRe: how many seconds? Pin
CPallini8-Sep-08 8:17
mveCPallini8-Sep-08 8:17 
GeneralRe: how many seconds? Pin
BillW338-Sep-08 13:56
professionalBillW338-Sep-08 13:56 
GeneralRe: how many seconds? Pin
peterchen8-Sep-08 11:29
peterchen8-Sep-08 11:29 
GeneralCoding Pin
mistyangel6-Sep-08 23:30
mistyangel6-Sep-08 23:30 
I. Overview
1. Create a program that will accept the necessary inputs and generate the proper outputs based on the processing instructions.
2. The program should meet all the requirements.

II. Inputs
1. Employee’s ID Number – an 8 digit integer
1st four digits signifies the year the employee started.
5th digit signifies employment type. 0 for regular, 1 for
contract. Other values are invalid.
Last 3 digits are irrelevant for this program.
2. Salary Grade – a real number
3. Days worked for the month – an integer with valid values of 1 to 31 only.
4. wBonus – a character to signify whether the employee will receive a bonus or not

III. Processing
1. Prompt for all necessary inputs. Check every input for validity.
2. Compute for the employee’s salary for the month.
Basic Salary = Salary grade * Days Worked

For employees with bonus
For regular employees who started before 1990
Bonus = Basic Salary * .4
For regular employees who started before 2000
Bonus = Basic Salary * .3
For regular employees who started before 2006
Bonus = Basic Salary * .2
For regular employees who started after 2005 and contract employees
Bonus = Basic Salary * .1

Salary for the Month = Basic Salary + Bonus

3. Accumulate Total Basic Salary and Total Bonus.
4. Display Employee’s Salary for the Month(output #1)
5. Prompt if the user wants to process another employee. If yes, go back to #1.
6. Display Total Basic Salary and Total Bonus(output #2)

IV. Outputs (use 2 decimal places for real numbers)
1. ID Number and Salary for the Month. Example:
ID Number: 19970123 Salary: P1500.50
2. Total Basic Salary and Total Bonus. Example:
Tot Basic Salary: P180,000.90 Tot Bonus: P20,000.55

V. Requirements
1. Use the printf function for all outputs including prompts.
2. Use the scanf function for accepting/reading all inputs.
3. Use defined constants for the constants used in the bonus computation.
4. Declare/define functions for each routine/subroutine in the program.
5. Use error checking. If the user inputs an invalid value, inform the user and prompt for a new value.
6. Users should be able to use the program without special instructions or training.

bleh

GeneralRe: Coding Pin
enhzflep7-Sep-08 1:39
enhzflep7-Sep-08 1:39 
GeneralRe: Coding Pin
Paul Conrad7-Sep-08 5:21
professionalPaul Conrad7-Sep-08 5:21 
GeneralTHIS QUESTION IS THE HORROR Pin
leckey7-Sep-08 6:57
leckey7-Sep-08 6:57 
GeneralRe: Coding Pin
Dan Neely8-Sep-08 2:22
Dan Neely8-Sep-08 2:22 
GeneralRe: Coding Pin
BillW338-Sep-08 5:08
professionalBillW338-Sep-08 5:08 
GeneralLooking at this math is making me num... Pin
AeonBlue4-Sep-08 8:29
AeonBlue4-Sep-08 8:29 
GeneralRe: Looking at this math is making me num... Pin
Pete O'Hanlon4-Sep-08 9:12
mvePete O'Hanlon4-Sep-08 9:12 
GeneralRe: Looking at this math is making me num... Pin
AeonBlue4-Sep-08 9:33
AeonBlue4-Sep-08 9:33 
GeneralRe: Looking at this math is making me num... Pin
dighn4-Sep-08 11:02
dighn4-Sep-08 11:02 
GeneralRe: Looking at this math is making me num... Pin
BillW338-Sep-08 4:56
professionalBillW338-Sep-08 4:56 
GeneralRe: Looking at this math is making me num... Pin
CPallini7-Sep-08 21:43
mveCPallini7-Sep-08 21:43 
JokeRe: Looking at this math is making me num... Pin
Perspx4-Sep-08 9:36
Perspx4-Sep-08 9:36 
GeneralRe: Looking at this math is making me num... Pin
Pete O'Hanlon4-Sep-08 10:43
mvePete O'Hanlon4-Sep-08 10:43 
GeneralRe: Looking at this math is making me num... Pin
ClementsDan4-Sep-08 18:24
ClementsDan4-Sep-08 18:24 
JokeRe: Looking at this math is making me num... Pin
AeonBlue5-Sep-08 4:07
AeonBlue5-Sep-08 4:07 
GeneralWhy is the app so slow Pin
BadKarma3-Sep-08 3:11
BadKarma3-Sep-08 3:11 
GeneralRe: Why is the app so slow Pin
Paul Conrad3-Sep-08 6:24
professionalPaul Conrad3-Sep-08 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.