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); } }
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);
}
}
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)