a. Write a complete Java program that prints digits of a given number separately. [2 mark]...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a. Write a complete Java program that prints digits of a given number separately. [2 mark] For example, if the given input 329, the output would be: 3 2 9 b. You must Show the details of Tracing the code above that you followed to get the answer [1 marks] 2. Wrapper Class: Write a complete Java program as follows: a. Create two boolean variables (a and b) and give them values. [1 mark] b. Compare the two variables created above using compare() method that takes two boolean values in the parameter which are to be compared. [1 mark] c. What are possible outputs emerged from the compare() method above? Explain all the cases [1 mark] 3. Write a Java program the design the following calss: Build a class GymMember that has the following: a. Attributes: name (String), ID(int), JoiningDate (Date class). Use this for date type: Date JoiningDate = new Date(int year, int month, int date) [4 marks] b. Build a constructor that accepts three parameter name, ID, and Joining date. Then initialize the objects' attributes. c. Build a default constructor with empty body and no parameters d. In the main method, create two GymMember objects gland g2 using value constructor with arguments (parameters), and print their ids. e. Also, in the main method, create a third Gym Member object g3 using the default constructor f. Call a method Check JoiningDate() on this object g3. g. Print the result of CheckJoiningDate() method. h. In the GymMember class, build a method named CheckJoiningDate() that has no parameters. The method checks the joining date of this object g3, and if the joining year 2019 or before; prints the following: "Congratulations, you've earned a free membership next month" a. Write a complete Java program that prints digits of a given number separately. [2 mark] For example, if the given input 329, the output would be: 3 2 9 b. You must Show the details of Tracing the code above that you followed to get the answer [1 marks] 2. Wrapper Class: Write a complete Java program as follows: a. Create two boolean variables (a and b) and give them values. [1 mark] b. Compare the two variables created above using compare() method that takes two boolean values in the parameter which are to be compared. [1 mark] c. What are possible outputs emerged from the compare() method above? Explain all the cases [1 mark] 3. Write a Java program the design the following calss: Build a class GymMember that has the following: a. Attributes: name (String), ID(int), JoiningDate (Date class). Use this for date type: Date JoiningDate = new Date(int year, int month, int date) [4 marks] b. Build a constructor that accepts three parameter name, ID, and Joining date. Then initialize the objects' attributes. c. Build a default constructor with empty body and no parameters d. In the main method, create two GymMember objects gland g2 using value constructor with arguments (parameters), and print their ids. e. Also, in the main method, create a third Gym Member object g3 using the default constructor f. Call a method Check JoiningDate() on this object g3. g. Print the result of CheckJoiningDate() method. h. In the GymMember class, build a method named CheckJoiningDate() that has no parameters. The method checks the joining date of this object g3, and if the joining year 2019 or before; prints the following: "Congratulations, you've earned a free membership next month"
Expert Answer:
Answer rating: 100% (QA)
1 b Now lets go through the code tracing process Import Statements import javautilScanner Here we im... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
What is chosen by the landlord? Call your answer L, express it in terms of H, c, w.
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Find the compound interest and future value. Round your answers to the nearest cent. Do not round intermediate steps. Principal Rate Compounded $760 5% Daily Time 1 year The future value is and the...
-
Neer Department Store uses the retail inventory method to estimate its monthly ending inventories. The following information is available for two of its departments at August 31, 2011. Sporting Goods...
-
1. If the elevation of Lake Superior is 600 feet above sea level and the elevation of the Caspian Sea is 92 feet below sea level, find the difference of the elevations. 2. Josh Weidner has $142 in...
-
At December 31, 2014, House Co. reported the following information on its balance sheet. Accounts receivable .............$960,000 Less: Allowance for doubtful accounts ..... 80,000 During 2015, the...
-
How is proving manhood related to gender ideology, and how is it expressed in society?
-
Lindon Company is the exclusive distributor for an automotive product that sells for $40 per unit and has a CM ratio of 30%. The companys fixed expenses are $180,000 per year. The company plans to...
-
(6.1) 10110 XOR 11011 Perform the following BITWISE logic operations. (6.2) 1110110 NAND 101101
-
Consolidation related simulation example: Millennium Capital Management, Inc., (MCM) acquired a 90% interest in NextGen, Inc. MCM's Financial Manager, Matthew Steven, has prepared a draft memo to the...
-
Given that human power consumption is 15 Terawatts, what area (in km2) would be required to be covered with solar panels? Assume that these solar panels are able to convert 40 Watts per square meter...
-
Define the reduced form of a simultaneous equations model and explain its usefulness.
-
Explain the VAR model.
-
Explain the concept of cointegration and test whether two series are cointegrated.
-
Explain the meaning of a "spurious regression."
-
Define the "identification" problem in simultaneous equations models.
-
Sketch and compute the volume of the parallelepiped spanned by u = (1, 0, 0), v = (0,2,0), w = (1, 1, 2)
-
Given the table below, about how much force does the rocket engine exert on the 4.0 kg payload? Distance traveled with rocket engine firing (m) Payload final velocity (m/s) 500 320 490 310 1020 450...
-
Russell (age 50) and Linda (age 45) Long have brought you the following information regarding their income and expenses for the current year. Russell owns and operates a landscaping business called...
-
In 2012, Gale and Cathy Alexander hosted an exchange student, Axel Muller, for 9 months. Axel was part of International Student Exchange Programs (a qualified organization). Axel attended tenth grade...
-
During the 2012 tax year, Irma incurred the following expenses: Union dues..............................................................$275 Tax return preparation...
-
Located in Tokyo, Japan, Sony Mobile Communications is a prominent competitor in the worldwide electronics equipment market. Because of stagnant sales in its ultra HD TVs, that division has decided...
-
Cory Rogers of CMG Research was happy to call Nick Thomas to inform him that Auto Concepts survey data were collected and ready for analysis. Of course, Cory had other marketing research projects and...
-
What must be determined before using correlation? Why is it essential?
Study smarter with the SolutionInn App