Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

9. Write a program that uses while loops to perform the following steps:

a. Prompt the user to input two integers: firstNum and secondNum.

(firstNum must be less than secondNum.)

b. Output all the odd numbers between firstNum and secondNum

inclusive.

c. Output the sum of all the even numbers between firstNum and

secondNum inclusive.

d. Output all the numbers and their squares between 1 and 10.

e. Output the sum of the squares of all the odd numbers between

firstNum and secondNum inclusive.

f. Output all the uppercase letters.

10. Redo Exercise 9 using for loops.

11. Redo Exercise 9 using do...while loops.


Write the java program in the following features of OOP:

1,Encapsulation

2,Polymorphism

3,Inheritance

4,Abstraction 


Problem description Caf´e Wafflelicious, as its very name signifies, is a cafe that sells waffles. When customers arrive at this cafe, they design the waffle they want according to the kinds of waffles, their ingredients and their prices. The waitress delivers these orders to the cook from the customer. The cook is responsible for making the waffle. You will prepare an order system in which you will check the company’s waffle orders.For example, there is a waffle order from the customer. You need to expand the functionality of the class in a transparent and dynamic way.Waffle Types (Concrete component): Normal Waffle - $13.0 Belgian Waffle - $16.0 Wrap Waffle - $13.0 Wheat Waffle - $15.0 1 Free Gluten Waffle - $17.0 Toppings (Concrete decorator): chocolate - $2.0 for each (white, milky, dark, nutella and caramel) fruits - $0.5 for each (strawberry, kiwi, pineapple and banana) sauces - $1.0 for each (chocolate, caramel and raspberry) nuts - $1.0 for each (pistachio, almond, hazelnut and walnut)


the average age of obtaining a driver's licence is 18. Write a java program where the user enters his/her age. if the age is greater than or equal to 18, the program must display using JOptionPane the following message, "you are old enough to apply for driver's licence", else display the following message, "you are not old enough to apply for a driver's licence".

Using any loop of your choice create a program that will prompts the user for two numbers and do calculations as follows, starting from the smallest number add the next number if its even or subtract it if its odd, repeat this until you get to the last number. i.e. if you start at 2 to 4, then 2 – 3 + 4( - because 3 is odd and + because 4 is even)


Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence à ƒ ƒ ¢ € ˜Jà ƒ ƒ ¢ € ™%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because à ƒ ƒ ¢ € ˜Cà ƒ ƒ ¢ € ™%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]
An applicant will accepted to the Jedi Knight Military Academy if he is least 200 cm. tall; age is between 21 and 25, inclusive; and a citizen of the Planet Endor. However, if the applicant is a recommendee of Jedi Master Obi Wan, he is accepted automatically regardless of his height, age and citizenship. Write a program that would input the applicantà ƒ ƒ ¢ € ™s height, age, citizenship code(à ƒ ƒ ¢ € œCà ƒ ƒ ¢ €  for citizen of Endor, à ƒ ƒ ¢ € œNà ƒ ƒ ¢ €  for non-citizen), and recommendee code (à ƒ ƒ ¢ € œRà ƒ ƒ ¢ €  for recommendee, à ƒ ƒ ¢ € œNà ƒ ƒ ¢ €  for non-recommendee) and then output whether the applicant is accepted or rejected
Assuming each identified use case is to be model as a class, create the class diagram of the system and elaborate
each for implementation.
Write a Java program that prompts the user to enter the number they wish
to see the multiplication table of. In addition, the program should prompt
the user to enter the length of multiplication table (i.e. counter) and
displays the table on the screen.

. Write a Java program that calculates the multiplication table (up to 10) of the randomly generated number (between 1 and 100), and displays that on the screen.

Hint: Math function and For loop. 


LATEST TUTORIALS
APPROVED BY CLIENTS