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

5.1 Methods have a unique name and follow the same naming rules as variables; explain the rules for
naming methods. (5 marks)
5.2 Write a program called Addition with a method called addNums() which takes in two parameters of
type int, and adds them up and displays total.
4.1 Using a for loop, write a method called lines() to output the following statement to the screen 100
times: ‘I must practise my programming’. (10 marks)
4.2 Using a nested loop structure, write java statements to produce the following output: (10 marks)
####
####
####
####
3.1 Java is a language which was developed in 1991 by a company called Sun Microsystems. Briefly
explain how Java works. (10 marks)
3.2 Provide five examples of high-level languages. (5 marks)
3.3 Identify and correct the errors in the following statements:
3.3.1 String n = 10; (1 mark)
3.3.2 int radius = 24.5; (1 mark)
3.3.3 num1 + num2 = total; (1 mark)
3.3.4 JOption.showMessageDialog(null,Hello!) (1 mark)
3.3.5 char symbol = “Tom”; (1 mark)
3.1 Explain what is meant by:
3.1.1 Identifier (2 marks)
3.1.2 Boolean expression (2 marks)
3.1.3 If-else statement (2 marks)
3.2 ‘Indentation improves programs’. Discuss the truth of this statement. (4 marks)
3.3 A relational operator is a programming language construct or operator that tests or defines some
kind of relation between two entities. List FIVE (5) relational operators used in Java. (5 marks)
3.4 Describe the Java API. (5 marks)
4.1 How should one dry run a program, and what are the advantages of dry running? (5 marks)
4.2 Write a Java program called Conversion that accepts as input an amount in millimetres and converts
it to centimetres and meters. The program should produce the following output using println statements: Your answer in centimetres =
Your answer in meters = (15 marks)
5.1 A method in Java is a block of statements that has a name and can be executed by calling (also called
invoking) it from some other place in your program. Explain two types of methods. (6 marks)
5.2 Methods have a unique name and follow the same naming rules as variables; explain the rules for
naming methods. (4 marks)
5.3 Write a complete Java program called Display that has a void method called ShowMessage() that accepts a string
parameter msg. The method call in the main program should produce the following output:
It’s a nice day! (10 marks)
The purpose of this project is to acquire better understandings of the runtime stack mechanism by emulating it inside the source program. This project does not depend on Project 2 (but Project 4 will build on Project 2 and this one). We begin by describing the idea of the project with help of the factorial function.
Design, code and test a program that will read in the PPS number of an employee. A PPS number consists of 7 digits, followed by a letter, and must be validated. If an invalid PPS number is read in, the program should ask for it again. Once a valid PPS number is entered, the user will be asked if they are calculating the pay details for a principal or a teacher. The program should then read in the required details, and output the employee’s PPS number, their gross pay, their tax, their PRSI and their take-home pay.
The program should loop until the user does not want to calculate any further wages.
You are required to use inheritance as effectively as possible.
This week we will be working with throwing our exceptions and using try and catch blocks.

-----------------------------------

Throwing the Exceptions:


LotFullException: Adjust both of ParkingLot's park() methods to throw this exception instead of returning false if the ParkingLot is full and your Auto/Bicycle cannot be parked.

VehicleMissingException: Adjust ParkingLot's find() method to throw this exception instead of return null if the target vehicle is unable to be found inside the ParkingLot
Create an application that displays each record in the two files created in the StudentStanding application. Display a heading to introduce the list produced from each file. For each record, display the ID number, first name, last name, grade point average, and the amount by which the grade point average exceeds or falls short of the 2.0 cutoff. Save the program as StudentStanding2.java.
LATEST TUTORIALS
APPROVED BY CLIENTS