Discover the answers you need at Westonci.ca, a dynamic Q&A platform where knowledge is shared freely by a community of experts. Experience the ease of finding quick and accurate answers to your questions from professionals on our platform. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.
Sagot :
Answer:
Explanation:
The following program was written in Java. It creates the function as requested and asks the user for all the values as inputs. No proper reason was given for asking for low income so I just added it as a yes or no print statement. The picture below shows the inputs and outputs of the program.
import java.util.ArrayList;
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Hourly rate: ");
double rate = in.nextDouble();
System.out.println("Consulting Time in minutes: ");
int consultingTime = in.nextInt();
System.out.println("Low Income? y/n");
String lowIncome = in.next().toLowerCase();
String lowIncomeAnswer;
if (lowIncome.charAt(0) == 'y') {
lowIncomeAnswer = "Yes";
} else {
lowIncomeAnswer = "No";
}
System.out.println("Billing Amount: " + billing(rate, consultingTime, lowIncome));
System.out.println("Low Income: " + lowIncomeAnswer);
}
public static double billing(double rate, int consultingTime, String lowIncome) {
double timeHours = consultingTime / 60;
double billing = rate * timeHours;
return billing;
}
}
Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Westonci.ca is your go-to source for reliable answers. Return soon for more expert insights.