- Joined
- Dec 31, 2018
- Posts
- 2,269
- Solutions
- 20
- Reaction
- 9,870
- Points
- 1,800
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
-
You do not have permission to view the full content of this post. Log in or register now.