I need a Raptor Flowchart and a Java Source code for the following problem statement. Please help!
Problem specifications:
You are tasked with developing an application that calculates the cost of a trip by a company salespeople consisting of the following type of expenses:
-lodging.
-meals.
-gas.
-tolls
The salesperson will be refunded the total cost minus the cost of meals.
Your application must prompt the user to enter all expenses, tally all expenses, and calculate how much, the company refund.
You need to display all expenses properly labeled (i.e. Gas, Lodging, …etc), total of all expenses, amount to be refunded.
You must use friendly variables (i.e. Lodging_Cost, CostofMeal, …etc and NOT a, b, c, d…)
You must print a ‘$’ sign next to all dollars’ figures.
You must set the precision for all amount to exactly two decimals
Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions. Thank You! =========================================================================== import java.util.Scanner; public class RefundCalculator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double lodgingExpenses, mealExpenses, gasExpenses, tollsExpenses; System.out.print("Enter expenses in lodging: "); lodgingExpenses = scanner.nextDouble(); System.out.print("Enter expenses in meals: "); mealExpenses = scanner.nextDouble(); System.out.print("Enter expenses in gas: "); gasExpenses = scanner.nextDouble(); System.out.print("Enter expenses in tolls: "); tollsExpenses = scanner.nextDouble(); double totalExpenses = lodgingExpenses + mealExpenses + gasExpenses + tollsExpenses; double refundAmount = totalExpenses - mealExpenses; System.out.printf("\nTotal Expense: $%10.2f\n", totalExpenses); System.out.printf("Refund Amount: $%10.2f\n", refundAmount); } }
===========================================================
FLOWCHART IN RAPTOR
Thanks : )
Get Answers For Free
Most questions answered within 1 hours.