It has been decided that transfers less than $100 should not attract any charges. However, transfers from $100 should attract a 17.5% charge on the amount being transferred. However, all road tolls has been abolished. The table below show the amount paid by drivers of the various vehicles.
VEHICLE TYPE....NAME....AMOUNT PAID ($)
1. saloon cars......Saloon_cars.....0.50
2. mummy wagons.....Trotro.....1.00
3. heavy buses.....Buses2Axles......1.50
You are to write a Java program that takes three mobile money transfers of various amounts and compute the various charges and the sum of these charges should be the total change. Your program should take toll booth levy for the three vehicles, sum them and multiply the total levy by 5.
Find the difference between the total mobile money transfer and the total toll booth levy.
You have been tasked to create a class called Abaaneke, your class should contain four private variables (customerName , deposit, oldBalance, newBalace) using the appropriate data types.
Your class should also have a method that takes three arguments – name of account holder, amount deposited and old balance. The method should add the deposit to the oldBalance and call it new balance.
Using the right setters and getters, initialize the private variables and call the method to display the following
a. Account holders name
b. Amount deposited
c. Old balance
d. And new balance
The user should be able to repeat the running of the program as many as he/she wishes
Create an EMPLOYEE class having First Name, Last Name, socialSecurityNumber(SSN). Class SalariedEmployee extends class Employee having weeklySalary as a member. An overloaded method CalculateEarnings to calculate a SalariedEmployee’s earnings. Class HourlyEmployee also extends Employee and have hourlyWage and hoursWorked as data members with overloaded method CalculateEarnings. Class CommissionEmployee having commissionRate and grossSales as data members extends class Employee with overloaded method CalculateEarnings. In main make ArrayList of Employees to display:
1)Employee with highest Earning.2)Employee with Lowest Earning.3)Average Earnings of all employees.4)Earning of employees on odd positions.5)Display Earning according to alphabetical order.
Create a java desktop application with CRUD functionality using Java Fx Api or Scanner Class. You should create an application for a Realtor Brokerage. You have to maintain the record of homes sold using this application. You will be using a Property class With the fields like Propertyid,AgentName,AskingPrice,Region,Type,ClosingDate .You have to follow these steps for this application.
Create a database named Brokerage.
Create table named Properties for homes in the database.
Insert 5 or 6 Home Records in the database.
Add Jar file for your database to the lib Folder.
Create one Java class as a Model class.
Create a separate DAO class for database connectivity.
Create separate methods for connection and all crud operations.
Create a third separate java class and call these methods in this class to display data on console or Display using Java Fx API.
Given the definition of Laptop class as follows:
public class Laptop
{
private String brand; //HP, Acer, ASUS
private double price; //price per unit
private int RAM; // memory space in GigaByte(GB),e.g:2,4
private int USBport; //number of USB port e.g:2, 3, 4
//normal constructor: public Laptop (String, double, int, int)
//processor method: upradeRAM(int)
//accessors: getBrand (), getPrice(), getRAM(), getUSB()
}
A processor method named upragedRAM(int) that receive the size of RAM to be upgraded as its parameter. This method will determine and return the price of RAM based on the following table:
RAM Size Price(RM)
8GB 98.00
16GB 299.00
3. Write main program :
a. Declare an array of objects named Laptops that store 10 laptop objects.
b. Ask user to enter all information required and store the data in the array above.
c. Calculate and display the total price of all Acer laptops
d. Display the brand of laptop thatt provides 4 USB ports
Enter the subtotal and gratuity rate: 10 12 The gratuity is $1.2 and total is $11.2
3. A new taxi service based on electric vehicles is offering
services within a metro city. Following is the fare chart
including the type of taxi used to commute and price per
kilometer. Write a java program to calculate total fare
depending on the distance travelled in kilometers.
Note: Use if Control statement
Type Fare
Micro Php15.00/Km
Macro Php35.50/Km
Shared Php8.50/Km
All years that are evenly divisible by 400 or are evenly
divisible by four and not evenly divisible by 100 are
leap years. For example, since 1600 is evenly divisible
by 400, the year is was a leap year. Similarly, since
1988 is evenly divisible by four but not by 100, the year
1988 was also a leap year. Using this information write
a Java method that accepts the year as user input,determines if the year is a leap year, and displays an
appropriate message that tells the user if the entered
year is or is not a leap year.
note: use if control statement
Write a java program to convert car consumption from one
unit to another. Offer the user the choice of either
conversion, kpl to mpg or mpg to kpl. The interface
should be:
PREFERRED CONVERSION:
1. kpl to mpg
2. mpg to kpl
Enter your choice: 2
Enter miles per gallon value: mpg_value
The equivalent kilometers per liter is: kpl_value
Use the constants 1 mile = 1609 meters and 1 gallon = 3.785
liters.
Useful formula:
mpg = (kpl / 1.609) * 3.785
kpl = (mpg * 1.609) / 3.785
note: use switch control statement
A complex number is a number in the form a+bi, where a and b are real numbers and i is
(square root of -1).
The numbers a and b are known as the real part and imaginary part of the complex number, respectively. You can perform addition, subtraction, multiplication, and division for complex numbers using the following formulas:
a+bi+c+di = (a + c) + (b+d)i
a+bi (c+di) = (ac) + (b-d)i
(a + bi)*(c+di) = (ac-bd) + (bc + ad)i (a + bi)/(c+di) = (ac+bd)/(c² +d²) + (bc-ad)i/(c² +d²)
You can also obtain the absolute value for a complex number using the following formula:
|a + bil= √a² + b²
(A complex number can be interpreted as a point on a plane by identifying the (a,b) values as the coordinates of the point. The absolute value of the complex number corresponds to the distance of the point to the origin)
Design a class named Complex for representing complex numbers and the methods add, subtract,
multiply, divide, and abs for performing complex-number operations, and override toStrin