🔒 Closed Pahel po sa java

Status
Not open for further replies.

Handnasomepa

Forum Expert
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: 24
  • IMG_20211023_130235.webp
    IMG_20211023_130235.webp
    165.2 KB · Views: 16
Status
Not open for further replies.

About this Thread

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

Trending Topics

Online now

Members online
972
Guests online
9,279
Total visitors
10,251

Forum statistics

Threads
2,354,361
Posts
29,383,384
Members
1,079,426
Latest member
losN0stras
Back
Top