Reference no: EM131114109
1: Cylinder (In this lab you will create programs that use classes and methods.)
Create a class called Cylinder.java that contains two double-precision instance variables named radius and height. The class should include a constructor that initializes the radius and height variables. Also, you need a class method named volume() that returns the volume of a Cylinder object. The volume of a cylinder is given by its radius squared times its height times Pi (radius * radius * height * Math.PI). You can either use the value 3.1416 for Pi or use the Java provided value named Math.PI.
Write a class called CylinderTest.java and declare an array of three Cylinder objects to call the methods you declared in the Cylinder class. Make sure that all class methods are called from main(). Have main() display the value returned by volume() and verify the returned value by hand calculations (paper/pencil). Prompt the user to enter the values for the radius and height of each Cylinder object in the array.
2: Date (In this lab you will create programs that use classes and methods.)
Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.
Write a program called DateTest.java that prompts the user to enter the month, day, and year as numeric values. This program then creates a Date object using the Date class you just created and tests the nextDay() method. This can be done in a loop of 40 iterations: the Date object calls the nextDay() method and prints the date during each iteration of the loop. This loop is to illustrate that the nextDay() method works correctly. Test the following cases:
1. Incrementing into the next month, for example, use date: 02/28/2011
2. Incrementing into the next year, for example, use date: 11/27/2011
3. Incrementing into the next month in a leap year, for example, use date: 02/28/2012
Analyze the future of criminal justice policy
: Describe your thesis regarding the future of criminal justice policy making. Analyze the future of criminal justice policy. Describe the limitations associated with criminal justice policy making
|
Explain the cause of any difference in katharines selves
: How did Katharine's self-concept differ from her ideal self before her expe- rience with her support group? What does this imply about her mental health, according to Rogers' theory?
|
Produce the pseudocode logic for an algorithm
: Produce the pseudocode logic for an algorithm that will compute the discount for each customer. The information is given as follows: The output will consist of a screen display showing the customer's discount received.
|
Describe the significant manner court rulings in juvenile
: Describe the significant manner in which the court rulings in juvenile delinquency cases have altered the judicial system's treatment of juveniles as compared to the treatment of adults
|
Create program perform error-checking on the initial values
: Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one.
|
Explain advantages of promoting social tolerance
: Using a child development theory of your choice, explain the advantages and disadvantages of promoting social tolerance among children under the age of 10.
|
Determining the company stock today
: Schiiller Corp will pay a $2.94 per share dividend next year, The company pledges to increase its dividend by 4.5 percent per year, indefinitely, If you require a return of 12 percent on your investment, how much will you pay for the company's sto..
|
Question regarding the value of the bond today
: Two years ago, you bought a fifteen year bond at its face value of $1,000. The coupon rate on this bond is 9%, payable annually. Today (just after receiving the second annual coupon payment), the current yield on the bond is 7.5%. What is the valu..
|
What is the npv of the project
: What is the NPV of the project? Round your answer to the nearest cent. What is the NPV of the project? Round your answer to the nearest cent.
|