Java Language Please help me fix all the error. I very appreciate it   Coding: import java.util.Scanner; public class Main {        /*static displayline();       char line;       {         for (int i = 1; i < line; i++ )         {           System.out.println ("_");         }       }       */          public static void main(String[] args) {          System.out.println("Clinic Management\n");          int PatAge, Pnumber,age;     int cmedicine, cost, Pcost, total, newTotal;     String PatName, Pgender, Pdisease, Pmedicine;     char typeofmedicine;          Scanner scan = new Scanner(System.in);          System.out.println("Patient Name :");     String name = scan.next();     name = name + scan.nextLine();          System.out.println("Patient Age :");      age = scan.nextInt();          System.out.println("Patient Gender :");     String gender = scan.next();          System.out.println("Patient Phone Number :");      Pnumber = scan.nextInt();          System.out.println("Patient Disease :" );     String disease = scan.next();          System.out.println("Patient Type of Medicine :");     String Medicine = scan.next();          System.out.println("Cost of The Medicine :");      cmedicine = scan.nextInt();          System.out.println("Patient Payment :");      cmedicine = scan.nextInt();         /* if (typeofmedicine == 'x')       {         int TypeMedic = Cost;         total = Cost + Payment;       } */     System.out.println ("PATIENT NAME : " + PatName);     System.out.println ("PATIENT AGE : " + PatAge);     System.out.println ("PATIENT GENDER : " + Pgender);     System.out.println ("PHONE NUMBER : " + Pnumber);     System.out.println ("DISEASE : " + Pdisease);     System.out.println ("MEDICINE : " + Pmedicine);     System.out.println ("COST : " + Pcost);     System.out.println ("PAYMENT : " + total);     //displayline ();     System.out.println ("The patient cost is RM " + newTotal);           }             }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Java Language

Please help me fix all the error. I very appreciate it

 

Coding:

import java.util.Scanner;
public class Main {
  
    /*static displayline();
      char line;
      {
        for (int i = 1; i < line; i++ )
        {
          System.out.println ("_");
        }
      }
      */
      
  public static void main(String[] args) {
    
    System.out.println("Clinic Management\n");
    
    int PatAge, Pnumber,age;
    int cmedicine, cost, Pcost, total, newTotal;
    String PatName, Pgender, Pdisease, Pmedicine;
    char typeofmedicine;
    
    Scanner scan = new Scanner(System.in);
    
    System.out.println("Patient Name :");
    String name = scan.next();
    name = name + scan.nextLine();
    
    System.out.println("Patient Age :");
     age = scan.nextInt();
    
    System.out.println("Patient Gender :");
    String gender = scan.next();
    
    System.out.println("Patient Phone Number :");
     Pnumber = scan.nextInt();
    
    System.out.println("Patient Disease :" );
    String disease = scan.next();
    
    System.out.println("Patient Type of Medicine :");
    String Medicine = scan.next();
    
    System.out.println("Cost of The Medicine :");
     cmedicine = scan.nextInt();
    
    System.out.println("Patient Payment :");
     cmedicine = scan.nextInt();
    
   /* if (typeofmedicine == 'x')
      {
        int TypeMedic = Cost;
        total = Cost + Payment;
      }
*/

    System.out.println ("PATIENT NAME : " + PatName);
    System.out.println ("PATIENT AGE : " + PatAge);
    System.out.println ("PATIENT GENDER : " + Pgender);
    System.out.println ("PHONE NUMBER : " + Pnumber);
    System.out.println ("DISEASE : " + Pdisease);
    System.out.println ("MEDICINE : " + Pmedicine);
    System.out.println ("COST : " + Pcost);
    System.out.println ("PAYMENT : " + total);
    //displayline ();
    System.out.println ("The patient cost is RM " + newTotal);
       
  }
           
}

Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY