Answer to Question #272709 in Java | JSP | JSF for asa

Question #272709

Provide a method getTotalCost() that calculates the total cost of the project by summing

the budget and the salary of each member of the project. The salary of each m ember

can be found by calculating an appropriate method of the Worker class


1
Expert's answer
2021-11-28T11:44:51-0500
import java.util.Scanner;
public class Main
{
    static void getTotalCost(){
        Scanner input=new Scanner(System.in);
        System.out.println("Enter the number of employees: ");
        int n=input.nextInt();
        System.out.println("Enter the price of each employee: ");
        int price=input.nextInt();
        System.out.println("Total cost of project "+price*n);
    }
	public static void main(String[] args) {
	   
		getTotalCost();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS