Assignment
Assignment
Assignment 1
Output:
Output:
Output:
Output:
The Cost Price is INR 129 and Selling Price is INR 191
The Profit is INR 62 and the Profit Percentage is 48.06%
Output:
The Pen Per Student is 4 and the remaining pen not distributed is 2
6. Calculate Discounted University Fee
public class UniversityFeeCalculator {
public static void main(String[] args) {
double fee = 125000;
double discountPercent = 10;
double discountAmount = (discountPercent / 100) * fee;
double finalFee = fee - discountAmount;
Output:
The discount amount is INR 12500.0 and final discounted fee is INR 112500.0
Output:
Output Example:
Enter distance in km: 10
The total miles is 16.0 mile for the given 10.0 km
Output Example:
Output:
Assignment 2
1. Basic Calculator
import java.util.Scanner;
Output:
Output:
Enter base: 10
Enter height: 5
The area of the triangle is 25.0 square units
Output:
Enter perimeter: 16
The length of the side is 4.0 whose perimeter is 16.0
Output:
Output:
int result1 = a + b * c;
int result2 = a * b + c;
int result3 = c + a / b;
int result4 = a % b + c;
Output:
8. Double Operations
import java.util.Scanner;
double result1 = a + b * c;
double result2 = a * b + c;
double result3 = c + a / b;
double result4 = a % b + c;
Output: