1. ## Challenge ..in cprogram

[A] Age
[N] number
[T] Temperature
[R] Remarks
[p] Payroll
[e] Exit

[A] Age
enter an age:
would u try again(back to menu)

[n]numbers
[1] postive/negative
[2] even /odd
enter choice;
[1] positve / negative
enter number:
-number is postive
-number is negative
[2] odd / even
enter number;
- number is odd
-number is even
would u try again(back to menu)

[t] temperature
[1] farenheit to celsius
[2] celsius to farenheit
enter choice:

[1] farenheit to celsius
enter farenheit
- result
[2] celsius to farenheit
enter celsius
-result
would u try again(back to menu)

[p] Payroll
[1] higher position
[2] middle position
[3] lower position
name:
working hours:
hourly rate:
overtime: (overtime = working hours- 40hours)
undertime:
position:
gross income:
tax(12%)
sss(8%)
Philhealth(1.25%)
total deductions: (total=tax+grossincome+sss+philhealth)
net income: (=gross income - deduction)

...only this information will be given....
...thats the challenge .....
..good luck...

2. Nice homework, how about you give it a shot first.

3. hahaha...

4. You laugh, but Salem is spot on. This site has a homework policy, at this link.

The short summary of that policy .... Do your own homework.

The sort of "challenge" you gave is one of many approaches that lazy students use in an attempt to get people here to do homework.

If you make an honest effort at doing your homework (yes, people here are experienced enough to tell the difference) you will find people more helpful.

5. oh?! im sorry....
its my homework its my exam... last week that i didnt finish on sched..... and i just want to know what is the rights program.!!!
im so curios...

im sorry to all!!

6. The "right" answer is a program which behaves as you have documented in your original post.

The answer you come up with will be different from the answer I come up with, but neither would be more "right" so long as both behaved as desired.

You can only get so far by just looking at other peoples code. To make your own, you have to practice (and practice, and practice).
It's all very well understanding that code does what it does, but you won't be able to replicate the thought processes which go into making code unless you actually make code yourself.

7. You also might want to read the article in the link at the bottom of Salem's post "If at first you don't succeed, try writing your phone number on the exam paper", and then reconsider how much effort you have put into the subject.

8. Code:
```#include <stdio.h>
#include <conio.h>
int main ()

{

#define p printf
#define s scanf

char section,subject,ch6,ch7,ch8,ch9,ch10;
char choice3,higher,middle,lower;
float position,workinghours,hourlyrate,overtimepay,grossincome,netincome;
float tax,sss,philhealth,td;
float undertime,overtime;
float cel,fahr,temp1,temp2;
int age,choice2,celcius,fahrenheit,positive,odd;
int no=0;

clrscr();
do
{
p("Final Exam in IT 121\n");
p("Prepared By:\n");
p("Name: Michael Lano\n");
p("Name: Lenelyn Tud\n");

p("==========================================\n");

p("[A] Age\n");
p("[N] Number\n");
p("[T] Temperature\n");
p("[R] Remarks\n");
p("[P] Payroll\n");
p("[E] Exit\n");
s("%s",&choice);

ch1='a';
ch2='t';
ch3='n';
ch4='p';
ch5='r';
ch6='A';
ch7='T';
ch8='N';
ch9='P';
ch10='R';

clrscr();

if(choice==ch1 || choice==ch6)
{
p("Age\n");

s("%d",&age);

if(age>=18)
{
p("You Are Qualified");
}
else
{
p("You Are Not Qualified");
}
}

if(choice==ch2  || choice==ch7 )
{
p(" Temperature\n");

p("[1] Fahrenheit to Celcius\n");
p("[2] Celcius to Fahrenheit\n");
s("%d",&choice2);

fahrenheit=1;

celcius=2;

if(choice2==fahrenheit)
{
p(" Fahrenheit to Celcius\n\n");
p("Enter Temperature in Fahrenheit:");
s("%f",&temp1);
cel=((temp1-32)*5)/9;
p("\n\n");
p("Equivalent in Celcius:%.2f\n",cel);
}
else if(choice2==celcius)
{
p(" Celcius To Fahrenheit\n");
p("Enter Temperature in Celcius:");
s("%f",&temp2);
fahr=((temp2*9)/5)+32;
p("Equivalent in Fahrenheit:%.2f\n",fahr);
}
}

if(choice==ch3 || choice==ch8)
{
p("Numbers\n");
p("[1] Positive & Negative\n");
p("[2] Odd & Even\n");
s("%d", &choice2);

positive=1;
odd=2;

if(choice2==positive)
{
p("Positive & Negative\n");
p("Enter Number:");
s("%d", &no);
if(no>0)
{
p("Positive");
}
else if(no<0)
{
p("Negative");
}
else
{
p("Zero");
}
}

else if(choice2==odd)
{
p("ODD & EVEN\n");
p("Enter Number:");
s("%d",&no);

if ((no%2)==0)
{
p("Even");
}
else
{
p("ODD");
}
}
}

if(choice==ch4 || choice==ch9)
{

p("Positio\n");
p("[1]higher\n");
p("[2]Middle\n");
p("[3]lower\n");
s("%d", &choice3);
higher=1;
middle=2;
lower=3;

if(choice3==higher)
{
s("%s %s",&fname,lname);
s("%f", &workinghours);
p("Enter Hourly Rate:");
s("%f",&hourlyrate);

if(workinghours>40)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Higher\n");
p("Hourly Rate: %.0f\n",hourlyrate);
overtime=workinghours-40;
p("Overtime :%.0f\n",overtime);
p("Undertime : --zero--\n");
overtimepay=(workinghours-40)*(hourlyrate);
p("Overtime Pay:%.2f\n",overtimepay);
grossincome=(workinghours*hourlyrate)+overtimepay;
p("Gross Income:%.2f\n\n",grossincome);
tax=grossincome*.12;
p("Tax:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("Philhealth:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
p("Total Deduction:%.2f",td);
netincome=grossincome-td;
p("Net Income:%.2f\n\n",netincome);
}

else if (workinghours<=8)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Higher\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime :--zero--\n",overtime);
undertime=workinghours-8;
p("Undertime : %.0f\n",undertime);
p("Overtime Pay:--zero--\n",overtimepay);
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}

else
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Higher\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime:--zero--\n");
p("Undertime ::--zero--\n");
p("Overtime Pay:--zero--\n");
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}

}

if(choice3==middle)
{
s("%s %s",&fname,lname);
s("%f",&workinghours);
p("Enter Hourly Rate:");
s("%f",&hourlyrate);

if(workinghours>40)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
overtime=workinghours-40;
p("Overtime :%.0f\n",overtime);
p("Undertime : --zero--\n");
overtimepay=(workinghours-40)*(hourlyrate);
p("Overtime Pay:%.2f\n",overtimepay);
grossincome=(workinghours*hourlyrate)+overtimepay;
p("Gross Income:%.2f\n\n",grossincome);
tax=grossincome*.12;
p("Tax:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("Philhealth:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
p("Total Deduction:%.2f",td);
netincome=grossincome-td;
p("Net Income:%.2f\n\n",netincome);
}

else if (workinghours<=8)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime :--zero--\n",overtime);
undertime=workinghours-8;
p("Undertime : %.0f\n",undertime);
p("Overtime Pay:--zero--\n",overtimepay);
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}

else
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime:--zero--\n");
p("Undertime ::--zero--\n");
p("Overtime Pay:--zero--\n");
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}

}
if(choice3==lower)
{
s("%s %s",&fname,lname);
s("%f",&workinghours);
p("Enter Hourly Rate:");
s("%f",&hourlyrate);

if(workinghours>40)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
overtime=workinghours-40;
p("Overtime :%.0f\n",overtime);
p("Undertime : --zero--\n");
overtimepay=(workinghours-40)*(hourlyrate);
p("Overtime Pay:%.2f\n",overtimepay);
grossincome=(workinghours*hourlyrate)+overtimepay;
p("Gross Income:%.2f\n\n",grossincome);
tax=grossincome*.12;
p("Tax:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("Philhealth:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
p("Total Deduction:%.2f",td);
netincome=grossincome-td;
p("Net Income:%.2f\n\n",netincome);
}

else if (workinghours<=8)
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime :--zero--\n",overtime);
undertime=workinghours-8;
p("Undertime : %.0f\n",undertime);
p("Overtime Pay:--zero--\n",overtimepay);
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}

else
{
p("\n");
p("Name:%s %s\n",fname,lname);
p("Position:Middle\n");
p("Hourly Rate: %.0f\n",hourlyrate);
p("Overtime:--zero--\n");
p("Undertime ::--zero--\n");
p("Overtime Pay:--zero--\n");
grossincome=workinghours*hourlyrate;
tax=grossincome*.12;
p("TAX:%.2f\n\n",tax);
sss=grossincome*.08;
p("SSS:%.2f\n\n",sss);
philhealth=grossincome*.0125;
p("PHILHEALTH:%.2f\n\n",philhealth);
td=tax+sss+philhealth;
netincome=grossincome-td;
p("Total Deduction:%.2f\n\n",td);
p("Net Income:%.2f\n\n",netincome);
}
}

if(choice==ch5 || choice==ch10)
{
p("REMARKS\n");
s("%s %s\n",&fname,lname);
s("%s %s\n",&section);
s("%s",&subject);
s("%s %s\n", &tfname,tlname);
s("%f",&subject);

clrscr();
p("------------------------------------\n");
}
else
{
p("1");
}
}
else
{
p("2\n");
}
p("\nWould you like to try again?[Y/N]:");
clrscr();
}
exit();
getch();
}```
i did not finish on part of remarks
and i dont know how to an exit code

i just look it to my drafts...

9. i am amazed that this is a final exam, with the names for the grade being two
people, and between both of you, the program looks like that? as well as being lost how to exit?

not to mention the school still uses conio.h

actually after looking at it, the program has two names on it, which dont look like your name....

me thinks you are trying to cheat already....

so i must say, i am not going to be part of this one. to many things that dont seem right

10. I see line 462 needs either another string to put data into, or one less %s in the format specification:
Code:
` s("%s %s\n",&section);`
And "section" is a char, so it can't hold a string. Did you mean for this to have " %c", instead?

What errors or warnings are you receiving?

Can you #define s to be scanf, and then use sss in a variable name? I've no idea, if that will work OK, or not.

11. Originally Posted by Crossfire
not to mention the school still uses conio.h
sorry for interupting but was that conio.h meaning in c proggraming language?
my college use it to, and i didnt understand that
sorry if my questions arent fit on this thread but it bothers me when Cross file mention conio.h used for schools
thankss for respons,

12. Originally Posted by loserone+_+
sorry for interupting but was that conio.h meaning in c proggraming language?
my college use it to, and i didnt understand that
sorry if my questions arent fit on this thread but it bothers me when Cross file mention conio.h used for schools
<conio.h> and the functions declared in it are not part of standard C. They are extensions specific to a couple of compilers and operating systems. Those compilers and host operating systems became obsolete at least ten years ago.