Write a class that contains variables to hold your tuition fee and your book fee. Display the sum of the variables. Save the class as Fees.java.
Create a project to model students with firstname, lastname, age, gender and student number. Create two constructors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given a list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method.
Sample Run1
2
John Doe 29 M
Kelly Daniela 40 F
Output1:
Full names : John Doe
Age : 29
Gender : M
Student Number : 22201001
Write a class that contains variables that hold your hourly rate of pay and the number of hours that you worked. Display your gross pay, your tax please refer in the table below and your net pay (gross pay – tax).
Gross pay Tax
----------------------------------------
Below 2000 | No tax
2001 - 3000 | 5%
Above 3000 | 10 %
Write a java program that can be used by a policeman to determine if a vehicle has exceeded the speed limit and to levy a fine. The policeman should enter the vehicles speed and the speed limit. If the speed limit is exceeded by less than 30kph a fine of Kshs. 2500 should be charged. Otherwise a fine of Kshs 4000 is charged. Your program should then output (in a suitable format) the vehicle speed, the speed limit, the excess speed and the fine levied.
Write a program that when run, produces a menu showing beer brands and their prices and then prompts the user enter his/her choice (1,2,3 or 4). The user is then asked how many bottles he/she wants. He is then given the total cost (depending on the cost of the beer chosen) as the output. See sample dialog below. If he/she enters an invalid choice e.g. 8, he/she should get an error message.
by CodeChum Admin
I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.
Input
1. Value of n1
Description
The first integer of the range
Constraints
The value of n1 is guaranteed to be lesser than or equal to n2.
Sample
3
2. Value of n2
Description
The second integer of the range
Constraints
The value of n2 is guaranteed to be greater than or equal to n1.
Sample
10
Output
The first line will contain a message prompt to input the value of n1.
The second line will contain a message prompt to input the value of n2.
The next line will contain all the even numbers from n2 down to n1.
Enter·value·of·n1:·3
Enter·value·of·n2:·10
10·8·6·4
Create a project to model students with firstname, lastname, age, gender and student number. Create two constructors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given a list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method.
Sample Run1
2
John Doe 29 M
Kelly Daniela 40 F
Output1:
Full names : John Doe
Age : 29
Gender : M
Student Number : 22201001
Full names : Kelly Daniela
Age : 40
Gender : F
Student Number : 22201002
In plane geometry, the x- and y axis of a 2D Cartesian system divide it into four infinite regions called quadrants. Your task is to model each point with an x-value and y-value. Apart from the constructors, getters and setters, implement a getQuadrant method to determine the region in which a given point falls. Sample Run1 Sample Run2 Enter the x and y value: 5 8 Enter the x and y value: 7 -3 Output1: Point (5,8) is in Quadrant I Output2: Point (7,-3) is in Quadrant IV
A number is said to be evenly divisible by 9 if it is divisible by 9 and at the same time it is even. For example 18 is evenly divisible by 9 but 27 is not. A program is required that accepts an integer and checks whether it is evenly divisible by 9 or not and then prints an appropriate message.
The value of y is calculated as follows:-
y = 4x3 + 2x 6 when x > 5
y = 3x2 4y + 12 when x < 5
y = 6x 5 when x = 5
Write a program that accepts the value x and then computes the value of y.