Write a java program that accepts a given n, then create a 2D array with n rows and n columns. Then for each cell the value should be n+row to the power column. For example if we talk of n=5, then array[0][0] =(5+0)0 = 1. Print out all the values in the array created.
Write a Java program to simulate an online store. The program should begin by displaying a list of products and their prices. There should be a minimum of 4 products offered. The program should ask the user to choose a product and then ask the user to enter the quantity they require of that product. The program should then allow the user to keep choosing more products and quantities until they enter something to indicate they want to end the program (e.g. a given number or ‘q’ or ‘exit’). The program should then tell the user the total amount for the products they have selected. Students must use array or arraylist to store the products and their prices.
We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.
1. Exercise 2: Create a class building that has the public member floors,area, and occupants and a method areaperperson()respectively that display the area per person for building. In the main() method create two instance of building called house and office and display the area per person by division of area/occupants
1. Exercises: Write a class Book with three data members BookId, Pages and Price. It also contains the following member function: • The get() method is used to input values • The show() method is used to display values Object Oriented Programming using JAVA Lab Manual – Page 24|193 • The set() method is used to set the values of data members using parameters • The getPrice() method is used to return the value of price
A bagel shop charges 75 cents per bagel for orders of less than a half-dozen bagels and 50 cents per bagel for orders of a half-dozen or more. Write a program that requests the number of bagels ordered and displays the price for each bagel and the total cost. Format the output results with two decimal places
USING IF ELSE CONDITIONAL STATEMENT
Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked
and will compute the daily wage of an employee. If the number of hours worked exceeds
eight hours add 30% to each excess hour as overtime rate.
Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay
IF ELSE CONDITIONAL STATEMENT
Write a JAVA program that will input the following data: Student Name, Average, Tuition Fee
and output Total Tuition Fee.
Formula: Total Tuition Fee = Tuition Fee – Discount
If average is: 95 – 100 100% discount
90 – 94 25%
85 – 89 10%
84 and below no discount
Write a Program in Java to take a number as input then display the highest dighit it has...
Use following method prototype: int highest (int n)
Write a main program to:
Create two different appointment. The first appointment object is for patient “MayaMroueh” on “Thursday” at “13 pm”. The second appointment object is read from the user.
Write the code to check if the two appointments conflict in day and time. If so it prints a message “The two appointments are set for the same day and day”. And moves one of the appointments to the next day.
Write the code to display the appointments information using the method getApprointmentDetails