Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java You goal in this project is to create a simple Java project using the NetBe

ID: 3883624 • Letter: J

Question

Java

You goal in this project is to create a simple Java project using the NetBeans IDE. The project should create a simple information page (not complete in any away) about the diabetes patient. The output should be something like this To create the project in an OOP manner, create two classes, one called Person and the other is called profile. The first class should have the top part of the form as its members, and the second class should have the bottom part. Your main class should instantiate two objects and fill in the information for one patient.

Explanation / Answer

import java.io.*;

class Address {
   public String street;
   public String City;
   public String country;
   public Address( String st, String ct, String c){
         street = st;
         City = ct;
         country = c;
   }

}

class Profile {
   private double weight;
   private double height;
   private double temp;
   private int high_presure;
   private int low_presure;
   private String smoke;
   private String drink;
   private int exercise_per_week;
   public Profile(double w, double h, double t, int hp, int lp, String s, String d, int e){
        weight = w;
        height = h;
        temp = t;
        high_presure = hp;
        low_presure = lp;
        smoke = s;
        drink = d;
        exercise_per_week = e;
   }
   public double getWeight(){
         return weight;
   }
   public double getHeight(){
         return height;
   }
   public double getTemp(){
         return temp;
   }
   public int getHighPresure(){
         return high_presure;
   }
   public int getLowPresure(){
         return low_presure;
   }
   public String getSmoke(){
         return smoke;
   }
   public String getDrink(){
         return drink;
   }
   public int getExercise(){
         return exercise_per_week;
   }

  
}

class Person {
   private int id;
   private String name;
   private Address addr;
   private Profile pr;

   public Person(int a, String nm, Address ad, Profile p){
        id = a;
        name = nm;
        addr = ad;
        pr = p;
   }
   public void disp(){
       System.out.println("Patient ID: " + id);
       System.out.println("Name:        " + id);
       System.out.println("Address:     " + addr.street);
       System.out.println("             " + addr.City);
       System.out.println("             " + addr.country);
       System.out.println("--------------------------------");
       System.out.println("Patient Mwedical Profile:");
       System.out.println("Weight:"+ pr.getWeight());
       System.out.println("Height:"+ pr.getHeight());
       System.out.println("Temperature:"+ pr.getTemp());
       System.out.println("Presure:"+ pr.getHighPresure()+"/" + pr.getLowPresure());
       System.out.println("Smoking:"+ pr.getSmoke());
       System.out.println("Drinking:"+ pr.getDrink());
       System.out.println("Exercise:"+ pr.getExercise() + " times a week");
   }  
}


public class DemoPerson {
   public static void main(String[] args){
        Profile p = new Profile(200,6.1, 97.5,120,80,"None","Social Drinker", 3);
        Address addr = new Address("123 University Avenue", "Brownsville, TX 78526","USA");
        Person pr = new Person(123456, "Dr MK Quweider",addr,p);
        pr.disp();
       
   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote