Del Mundo, Harvey Jay U. - Activity5.1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Harvey Jay U.

del Mundo
CE3-6

1. Write a program that will determine if a gross salary of an employee is taxable or


not. If the gross salary is above 20,000 then it is taxable. To get the gross salary,
it will accept the basic pay of an employee including their O.T pay and holiday
pay (Gross Pay = Basic Pay + O.T + Holiday pay). If it is taxable, deduct 5% from
the Gross Salary.

CODE:
#include<stdio.h>
#include<conio.h>
main()
{
int BP, OT, HP, tax, GP;

clrscr();

printf("Basic Pay: ");


scanf("%d", &BP);

printf("O.T Pay: ");


scanf("%d", &OT);

printf("Holiday Pay: ");


scanf("%d", &HP);

GP = (BP+OT+HP);
tax = GP*0.05;

printf("Gross Pay: %d", GP);

if (GP >= 20000)

{
printf("\n\t The Gross Salary of an Employee is taxable of 5% and with the worth
of %d", tax);
}
else
{
printf("\n\t The Goss Salary of an Employee is NOT taxable");
}

getch (); //this code will PAUSE the screen


return 0; // this code will terminate the program

}
OUTPUT:
Not Taxable:

Taxable:

2. Write a program that will send notification to Warehouse Manager when the
inventory of an item become less than 2. If the quantity of the item is greater than
2 then it will display a message of "It's sufficient! Number of items is <number>",
if not, it will send a notification "Need to purchase <name of the item>, quantity is
low!".

CODE:
#include<stdio.h>
#include<conio.h>
main()
{
int q;
char c[50];

clrscr();

printf("Enter the Product Name: ");


scanf("%s", &c);

printf("No. of Items in Inventory: ");


scanf("%d",&q);

if (q >=2 )
{
printf("\n\t Message: It's sufficient! Number of items is %d",
q);
}
else
{
printf("\n\t Need to purchase %s, quantity is low!", c);
}

getch(); //this code will PAUSE the screen


return 0; //this code will terminate the program
}

OUTPUT:
Sufficient Quantity:
Need to purchase Quantity:

You might also like