Hello,
I've done a program to calcute employee's salary for an assignment and it's doing everything we were asked for, but I would like it to look a bit nicer. Is there some way to customize the window or add buttons or whatever ?
Hope it's the right place to post this.
Here is the code:
insert
Code:
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(void) {
   int n;
   int hoursw;
   double hourr;
   double salary;
   double itemr;
   int itemn;
   double grosss;
   system ( "color A" );
   do {
   printf("Please select one of the following options:\n \n1 Managers \n2 Hourly Worker \n3 Comission Worker \n4 Piece Worker \n0 Exit\n\nYour choice: ");
   scanf_s("%d", &n);
   switch (n) {
      case 1: {
         printf("\nThe employee's pay is 2000 S$\n");
		 system("PAUSE");
		 system ("cls");
		 break;
      }
	  case 2: {
		  printf("\nPlease enter hourly worker's fixed hourly wage: \n");
		  cin >> hourr;
		  printf("\nPlease enter number of hours worked: \n");
		  cin >> hoursw;
		  if (hoursw<=40) {
				salary = hourr*hoursw;
				cout << "\nThe employee's salary is " << salary << " S$" << endl;
		  }
		  else {
			  salary = hourr*40+(hoursw-40)*(1.5*hourr);
			  cout << "\nThe employee's salary is " << salary << " S$" << endl;
		  }
		 system("PAUSE");
		 system ("cls");
		 break;
	  }
      case 4: {
		  printf("\nPlease enter number of items produced: \n");
		  cin>>itemn;
		  printf("\nPlease enter the fixed amount of money per item produced: \n");
		  cin>>itemr;
		  salary = itemn*itemr;
			  cout << "\nThe employee's salary is " << salary << " S$" << endl;
			  system("PAUSE");
			  system ("cls");
			  break;
	  }
      case 3: {
         printf("\nPlease enter employee's gross weekly sales: \n");
		 cin>>grosss;
		 salary = grosss*5.7/100+250;
			 cout << "\nThe employee's salary is " << salary << " S$" << endl;
			 system("PAUSE");
			 system ("cls");
			 break;
			 
      }
	  case 0: {
		  return 0;
		  break;
	  }
      default: {
         printf("\nPlease enter 1, 2, 3 or 4.\n");
		 system("PAUSE");
		 system ("cls");
         break;
	  }
	}
}
while ( "n!=0" );
}