-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathTravelPackageCostCalculator.java
More file actions
28 lines (21 loc) · 995 Bytes
/
TravelPackageCostCalculator.java
File metadata and controls
28 lines (21 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
public class TravelPackageCostCalculator {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Define the base cost of the travel package
double baseCost = 1000.0; // You can adjust this value
// Define the additional cost per person
double costPerPerson = 200.0; // You can adjust this value
System.out.print("Enter the number of people: ");
int numberOfPeople = input.nextInt();
// Calculate the total cost
double totalCost = baseCost + (numberOfPeople * costPerPerson);
// Display the results
System.out.println("Travel Package Cost Calculation");
System.out.println("Base Cost: $" + baseCost);
System.out.println("Additional Cost Per Person: $" + costPerPerson);
System.out.println("Number of People: " + numberOfPeople);
System.out.println("Total Cost: $" + totalCost);
input.close();
}
}