Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Writing a program that will determine the best Second year student.

Write the class definition for a Student class that contains four private data members: 

-An int studNum to store the student number.

-A string studFirstName to store the student’s first name.

-A string studSurname to store the student’s surname.

-A one dimensional array subjectCode of type string that hold the five subjects that the student is registered for.

-A parallel array to the subject code array called finalMark that holds the final mark that the student obtained for the subject stored in the subject code array.

-A double overallAverage that will hold the overall average that the student has obtained

The class has the following methods:

-A default constructor that sets the data members to appropriate default values for all data members, including the arrays.

-A setStudent method that receives parameters for the student number and name, as well as an array of type string and an array of type double for the subjects code and final mark respectively.


Write a java program to work like a calculator. The calculator should include +, -, *, / and %. The



calculator should not stop working unless the user asks it to exit. You should use Switch case

Create an account by entering username, password, first name and last name.

a. The system needs to check that the following conditions are met, and reply with the

appropriate output message.


Create a ticketing system code using the following:


If else statement


User type


Switch statement


String


Looping (if possible)

Create EmployeeSalary as parent interface to store basic_sal, housing_all and transport_all. The values for these three items are fixed for all Employee and has abstract function calculateSalary


Create three objects: prog, adm and lib, for programmer, admin and librarian respectively to access the properties in Employee class.


Rob is fond of collecting coins but unfortunately,sometimes he has to sell a coin to get other coins.he puts all his coins one over the other in a column.

(0,i):Add coin with value i to the collection.

(1,0):sell a coin.

Selling a coin:For selling a coin ,he picks up the top coin in the coloumn if he constraint A is satisfied.Constraint A:Rob can only sell the coin if the coin collection value is more than Y.

Upon removal ,the coin collection value goes to the previous value.Initially,with 0 coins ,coin collection value is 0.

Adding a Coin:on adding a coin of value i to the collection the coin collection value increments via the following prodcedure.

If the coin collection had>=X value then current total value is X+i else X+2*i.

Rob needs to find and return the final value of coin collection after Q operations.

Note:Initially,the value X is 0 and not X.

Ex1:

i/p1:10(deciding increment)

i/p2:0(selling coins)

i/p3:1(no of operations)

i/p4:{{0,5}}

o/p:10




While using a computer a user the ALT-TAB key to switch between applications. The ALT-TAB window works on the principle of holding the ALT key for MRU listening. Hence the applications arrange themselves in such a way that the most recently used application will be the first them in the ALT TAB window and so forth.


You are the list of opened applications and the number of times that the user presses the ‘Tab key’ to switch between applications. Find the final arrangements of applications in the ALT-TAB window.


Example 1:


Input1:4


Input1:3


Input1: {1,2,3,4}


Output: {3,1,2,4}


Explanations are open .Holding the ALT key the user presses TAB key3 times. This pops up application number 3.hence 3 is the most active application in the ALT-TAB panel.


Example 2:


Input1:10


Input1:7


Input1:{4,1,3,7,6,8,5,2,10,9}


Output:{5,4,1,3,7,6,8,2,10,9}



All the banks operating in India are controlled by RBI. RBI has set well-defined guidelines (e.g. minimum interest rate, minimum balance allowed, maximum withdrawal limit, etc) which all banks must follow. For example, suppose RBI has set the minimum interest rate applicable to a saving bank account to be 4% annually; however, banks are free to use a 4% interest rate or set any rates above it.


Using three dimensional array, create a program that will enter table, row, and column together with the total number of Elements then display the Biggest number, Smallest number, and Second to the biggest number.



Sample input and output:



Input:


Enter number of Tables: 2


Enter number of Rows: 2


Enter number of Columns: 2



Enter 8 number of Elements


2


6


34


76


34


90


56


45



The biggest number among them is: 98


The smallest number among them is: 2


The second to the biggest number is: 76

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS