Paayos naman po nung gawa ko oh hindi ko po talaga maayos eh, bakamasilip nyo san ung mali, invalid input po kasi lumalabas eh
Salamat po
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 = charge + 1000;}
else if(Capacity == 2) {charge = charge + 10000;}
else if(Capacity == 3) {charge = charge + 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 == 2) {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");}
}
}
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.