🔒 Closed Pahel po sa java

Status
Not open for further replies.
Pahelp namn po, pahanap naman po kung san ako nag kulang huhu. Dapat po kasi 850 ung sagot, saan po kaya ung mali ko. ☹️☹️
Java:
import java.util.Scanner;
public class Task2 {
public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);

        double Amount;
        double charge = 0;
        boolean Error = false;
        int Expertise;
        int Capacity;
        int Projects;

        System.out.println("What is your desired amount? ");
        Amount = input.nextDouble();
        System.out.println("Type 1 to 3 (3 being the highest) on how expert you are regarding the job: ");
        Expertise = input.nextInt();

        if(Expertise == 1) {
            charge = Amount - (Amount * .3);
        } else if(Expertise == 2) {
            charge = Amount + (Amount * .1);
        } else if(Expertise == 3) {
            charge = Amount + (Amount * .5);
        } else { Error = true; }   

        System.out.println("Type 1 to 3 (3 being the highest) on how big the client is ");
        Capacity = input.nextInt();

        if(Capacity == 1) {
            charge = Amount + 1000;
        } else if(Capacity == 2) {
            charge = Amount + 10000;
        } else if(Capacity == 3) {
            charge = Amount + 100000;
        }
        else {
            Error = true;
        }


        System.out.println("How you done projects similar to this one? (1 for yes, 0 for no)");
        Projects = input.nextInt();
    
        if( Projects == 1) {
            charge = Amount * 2;
        } else if(Projects == 0) {
            charge = Amount / 2;
        }   else {
            Error = true;
        }

        if (Error) {
        System.out.println("Invalid input");
        } else {
        System.out.println("Charge the client " + charge + " php for the entire project");
        } input.close();
        

    }


}
 

Attachments

  • IMG_20211023_130305.webp
    IMG_20211023_130305.webp
    92.7 KB · Views: 23
  • IMG_20211023_130235.webp
    IMG_20211023_130235.webp
    165.2 KB · Views: 15
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 289
    Views
  • 1
    Participants
Last reply from:
Handnasomepa

Trending Topics

Online now

Members online
531
Guests online
1,075
Total visitors
1,606

Forum statistics

Threads
2,288,516
Posts
29,052,108
Members
1,215,132
Latest member
agkakanat
Back
Top