Java class called Customer to store their name and date_of_birth. The date_of_birth format should be dd/mm/yyyy. Write methods to read customer data as and display as using StringTokenizer class considering the delimiter character as “/”.

import java.util.Scanner; import java.util.StringTokenizer; class customer { String name; String date; public void read() { Scanner input =new Scanner(System.in); name=input.next(); date=input.next(); } public void display() { System.out.print(name+","); String delims="/"; StringTokenizer…

Continue ReadingJava class called Customer to store their name and date_of_birth. The date_of_birth format should be dd/mm/yyyy. Write methods to read customer data as and display as using StringTokenizer class considering the delimiter character as “/”.

Design a super class called Staff with details as StaffId, Name, Phone, Salary. Extend this class by writing three subclasses namely Teaching (domain, publications), Technical (skills), and Contract (period). Write a Java program to read and display at least 3 staff objects of all three categories.

class Staff { int staffid,phone,salary; String name; public Staff(int id , int no, int sal, String na){ staffid=id; phone=no; salary=sal; name=na; } void display(){ System.out.println("-------------------------------------"); System.out.println("Staff ID:"+ " "+ staffid);…

Continue ReadingDesign a super class called Staff with details as StaffId, Name, Phone, Salary. Extend this class by writing three subclasses namely Teaching (domain, publications), Technical (skills), and Contract (period). Write a Java program to read and display at least 3 staff objects of all three categories.

Program to Evaluate postfix expression using separate header file for operations

STEP 1: create a header file named stack. In this file we declare the class and all the stack operations. ******************************************** stack.h *********************************************/ #define Max 10 class stk_class { /*declaration…

Continue ReadingProgram to Evaluate postfix expression using separate header file for operations