Sie sind auf Seite 1von 18

1 | Page

NAME: SOURODIP KUNDU CLASS: IX SECTION: A ROLL NUMBER: 37

CONTENTS
2 | Page

Topic of the Project:


Visit a hospital-Study various process. Design a project in Blue J to handle patients Admission and Discharge process

Signature:

BlueJ
BlueJ is an integrated development environment (IDE) for the BlueJ programming language, developed mainly for educational purposes, but also suitable for small-scale software development. BlueJ was developed
3 | Page

to support the learning and teaching of object-oriented programming, and its design differs from other development environments as a result. The main screen graphically shows the class structure of an application under development (in an UML-like diagram), and objects can be interactively created and tested. This interaction facility, combined with a clean, simple user interface, allows easy experimentation with objects under development. Object-oriented concepts (classes, objects, communication through method calls) are represented visually and in its interaction design in the interface.

History of BlueJ
The development of BlueJ was started in 1999 by Michael Klling and John Rosenberg at Monash University, as a successor to the Blue system. Blue was an integrated system with its own programming language and environment. BlueJ implements the Blue environment design for the BlueJ programming language. BlueJ is currently being maintained by a joint team at the University of Kent, Canterbury, England where Klling now lectures, and La Trobe University in Melbourne, Australia. Michael Klling In March 2009, the BlueJ project became free and open source software, and licensed under GNU GPL with the classpath exception.

John Rosenberg

Characteristics of BlueJ

4 | Page

The features of BlueJ are designed as an aid to learning object-oriented programming concepts, as well as an aid to program development itself. The features include: BlueJ is Easy to write and more readable and eye catching. BlueJ program cannot harm other system thus making it secure. BlueJ programs can execute in any environment for which there is a BlueJ run-time system. BlueJ programs can be run on any platform (Linux, Window, and Mac). Thus it is machine-independent. BlueJ encourages error-free programming by being strictly typed and performing run-time checks. BlueJ provides integrated support for multithreaded programming. Machine Independent i.e. BlueJ is independent of hardware. BlueJ supports cross-platform code through the use of BlueJ byte code. BlueJ programs carry with them substantial amounts of run-time type information that is used to verify and resolve accesses to objects at run time. Thus it is dynamic.

BlueJ is Easy to write and more readable and eye catching.

5 | Page

A. Steps to do the Project:


Steps to open a new project in BlueJ:
Step 1: Head to the left hand side of the screen and click Start on Start in the Charms bar. Step 2: When the Start opens up type BlueJ when the BlueJ icon appears

select it.

Step 3: When the BlueJ window opens up go to Project> New Project. Step 4: Choose the directory and give a name to your project and select Create. Hence the new project is created.

6 | Page

Steps to open a new class in BlueJ and the program


Step 1: In the BlueJ window click on New Class.

Step 2: In the New Class windows type the class name (say sdk_assignment1). Step 3: Click on Create. Step 4: Thus a new class is created with our desired name Step 5: A new class opens up. Step 6: It would show all the basic information about how to type the program we can follow it or here we delete it. Step 7: Then we have to type the program. Step 8: After typing the program, we have to see that we make no logical mistake BlueJ sees that there is no syntax error. Step 9: We must press the Compile button.

7 | Page

When the message appears that Class is compiled-No Syntax errors, we are sure that our program is correct.

The Program:
import java.io.*; public class Apollo { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("******************WELCOME TO BLUEJ DAIGONASTIC AND REASEARCH INSTITUTE*****************"); System.out.println("TODAY'S DATE: 10TH NOVEMBER[FRIDAY]2012 "); System.out.println("24 hours service"); System.out.println("For specially designed ambilance is call 100 "); System.out.println("PHONE NUMBER>> 9038124363"); System.out.println("______________________________________________________ ___________"); System.out.println("YOUR HEALTH IS OUR CONCERN"); System.out.println("Please enter 1 for admission: "); System.out.println("Please enter 2 for discharge: "); int n = Integer.parseInt(br.readLine()); char g; String a,b,d; int rn,age,f,ward,e,o,r,u; int v=0; if(n==1) { System.out.println("You have choosen to admit a patient.Please enter the patient's following details:" );
8 | Page

rn= 145248; System.out.println("The Registration number of the patient: 145248"); System.out.println("Please enter the name of the patient:"); a = br.readLine(); System.out.println("Please enter the age of the patient:"); age = Integer.parseInt(br.readLine()); System.out.println("Please enter the GENDER of the patient: "); g = (char)(br.read()); System.out.println("______________________________________________________ ___________"); System.out.println("Please enter the disease of the patient:"); b = br.readLine(); System.out.println("Please enter the condition of the patient(critical=1/mild=2):"); int p = Integer.parseInt(br.readLine()); System.out.println("Please enter what type of category of rooms u want(General=1/Cabin=2/ICU=3):"); e = Integer.parseInt(br.readLine()); if(e==1) { int t=5000; System.out.println("The cost is Rs 5000"); System.out.println("The room number of the patient is: 12 "); f = 12; System.out.println("The ward number of the patient is: 45120"); ward = 45120; } else if(e==2) {
9 | Page

int t=7000; System.out.println("The cost is Rs 7000"); System.out.println("The room number of the patient is: 25 "); f = 25; System.out.println("The ward number of the patient is: 65841"); ward = 65841;

} else if(e==3) { System.out.println("The cost is Rs 12000"); System.out.println("The room number of the patient is: 4506 "); f = 4506; System.out.println("The ward number of the patient is: 48526"); ward = 48526; } if(e==1) o=5000; else if(e==2) o=7000; else o=1200;

System.out.println("______________________________________________________ ___________"); System.out.println("The doctors available are as follows.Please enter their names correctly:"); System.out.println("Enter 1 for Mr. Santanu Roy");
10 | P a g e

System.out.println("Enter 2 for Mr. Arindam Basu"); System.out.println("Enter 3 for Mr. Arik Chatterjee"); System.out.println("Enter 4 for Mr. Avishek Bhattacharya"); System.out.println("Enter 5 for Mr. Indranil Bose"); System.out.println("Enter 6 for Mrs. Rita Paul"); System.out.println("Enter 7 for Mrs. Sundeshna Biswas"); d = br.readLine(); int q=1200; System.out.println("The visiting charge of " +d+ " is " +q); int l = q+o; System.out.println("______________________________________________________ ___________"); System.out.println("The admission form is being computed.Please Wait........."); System.out.println(); System.out.println("The registration number is: " +rn); System.out.println("The age of the patient is: " +age); System.out.println("The gender of the patient is: " +g); System.out.println("The disease of the patient is: " +b); System.out.println("The admission amount is : " l ); System.out.println("Thank You." ); System.out.println("Please go to the Administrative Department to pay the asmission charge money. "); } else { System.out.println("You have choosen to discharge a patient.Please enter the patient's following details:" );
11 | P a g e

System.out.println("Please enter the name of the patient:"); a = br.readLine(); System.out.println("Please enter the age of the patient:"); age = Integer.parseInt(br.readLine()); System.out.println("Please enter the GENDER of the patient: "); g = (char)(br.read()); System.out.println("______________________________________________________ ___________"); System.out.println("Please enter what type of category of rooms u want(General=1/Cabin=2/ICU=3):"); e = Integer.parseInt(br.readLine());; if(e==1) { System.out.println("The cost is Rs 5000 per day"); } else if(e==2) { System.out.println("The cost is Rs 7000 per day"); } else if(e==3) { System.out.println("The cost is Rs 12000 per day"); }

if(e==1) o=5000; else if(e==2) o=7000; else o=1200;


12 | P a g e

r=850; System.out.println("Nurse Charge = "+r); System.out.println("Pathalogical treatment press :(X Ray=1/ECG=2/Ultrasonography=3/CT Scan=4/MRI=5/Physiotherapy=6/EMG=7/PFT=8/OPG=9/Laparoscopic Surgey=10"); u=Integer.parseInt(br.readLine());; { if(u==1) v=250; else if(e==2) v=1800; else if(e==3) v=2500; else if(e==3) v=2500; else if(e==4) v=5500; else if(e==5) v=850; else if(e==6) v=850; else if(e==7) v=500; else if(e==8) v=6500; else if(e==9) v=4500; else if(e==10) v=2500; }
13 | P a g e

int q=1200; System.out.println("The visiting charge of the doctor is Rs." +q); int l= q+v+r+o; System.out.println("The total cost for the patient's treatment is Rs. " +l); System.out.println("GET WELL SOON!"); } } }

The Screenshots of the Program:

14 | P a g e

15 | P a g e

The Result:
16 | P a g e

a)Admission:

b) For discharge:

17 | P a g e

18 | P a g e

Das könnte Ihnen auch gefallen