Create a class named Blanket with fields for a Blanket’s size, color, material, and price. Include a constructor that sets default values for the fields as Twin, white, cotton, and $30.00. Include a set method for each of the first three fields. The method that sets size adds $10 to the base price for a double blanket, $25 for a queen blanket, and $40 for a king. The method that sets the material adds $20 to the price for wool and $45 to the price for cashmere. In other words, the price for a king-sized cashmere blanket is $115. Whenever the size or material is invalid, reset the blanket to the default values. Include a toString() method that returns a description of the blanket. Save the file as Blanket.java.
Create a child class named ElectricBlanket that extends Blanket and includes two additional fields: one for the number of heat settings and one for whether the ElectricBlanket has an automatic shutoff feature. Default values are one heat setting and no automatic shutoff. Include get and set methods for the fields. Do not allow the number of settings to be fewer than one or more than five; if it is, use the default setting of 1. Add a $5.75 premium to the price if the blanket has the automatic shutoff feature. Also include a toString() method that calls the parent class toString() method and combines the returned value with data about the new fields to return a complete description of features. Save the file as ElectricBlanket.java.
Create an application that creates a Blanket and displays the starting values. Then, continually prompt the user for a Blanket material. Display the values, prompt the user for a size, and display the values again. Continue to get new material and size values until a sentinel value is entered. Then do the same for an ElectricBlanket, including allowing the user to change the number of settings and whether the ElectricBlanket has the automatic shutoff feature. Save the file as DemoBlankets.java.
Create an interface called Runner. The interface has an abstract method called run(). Save the file as Runner.java.
Create classes called Machine, Athlete, and PoliticalCandidate that all implement Runner. The run() method displays a message describing the meaning of run to each class. Save the files as Machine.java, Athlete.java, and PoliticalCandidate.java.
Create an application that prompts the user for the type of object to create. Create it, and display the message that describes run for the class. Save the file as DemoRunners.java.
Create a program with an enumeration that contains the names of the eight planets in our solar system. Prompt the user for a planet name and use the ordinal() method to display the planet’s position. Save the file as Planets.java.
Write a program that inserts parentheses, a space, and a dash into a String of 10 user-entered numbers to format it as a phone number. For example, 5153458912 becomes (515)345-8912. If the user does not enter exactly 10 digits, display an error message. Continue to accept user input until the user enters 999. Save the file as PhoneNumberFormat.java.
Create a class named Blanket with fields for a Blanket’s size, color, material,
Struggling With a Similar Paper? Get Reliable Help Now.
Delivered on time. Plagiarism-free. Good Grades.
What is this?
It’s a homework service designed by a team of 23 writers based in Carlsbad, CA with one specific goal – to help students just like you complete their assignments on time and get good grades!
Why do you do it?
Because getting a degree is hard these days! With many students being forced to juggle between demanding careers, family life and a rigorous academic schedule. Having a helping hand from time to time goes a long way in making sure you get to the finish line with your sanity intact!
How does it work?
You have an assignment you need help with. Instead of struggling on this alone, you give us your assignment instructions, we select a team of 2 writers to work on your paper, after it’s done we send it to you via email.
What kind of writer will work on my paper?
Our support team will assign your paper to a team of 2 writers with a background in your degree – For example, if you have a nursing paper we will select a team with a nursing background. The main writer will handle the research and writing part while the second writer will proof the paper for grammar, formatting & referencing mistakes if any.
Our team is comprised of native English speakers working exclusively from the United States.
Will the paper be original?
Yes! It will be just as if you wrote the paper yourself! Completely original, written from your scratch following your specific instructions.
Is it free?
No, it’s a paid service. You pay for someone to work on your assignment for you.
Is it legit? Can I trust you?
Completely legit, backed by an iron-clad money back guarantee. We’ve been doing this since 2007 – helping students like you get through college.
Will you deliver it on time?
Absolutely! We understand you have a really tight deadline and you need this delivered a few hours before your deadline so you can look at it before turning it in.
Can you get me a good grade? It’s my final project and I need a good grade.
Yes! We only pick projects where we are sure we’ll deliver good grades.
What do you need to get started on my paper?
* The full assignment instructions as they appear on your school account.
* If a Grading Rubric is present, make sure to attach it.
* Include any special announcements or emails you might have gotten from your Professor pertaining to this assignment.
* Any templates or additional files required to complete the assignment.
How do I place an order?
You can do so through our custom order page here or you can talk to our live chat team and they’ll guide you on how to do this.
How will I receive my paper?
We will send it to your email. Please make sure to provide us with your best email – we’ll be using this to communicate to you throughout the whole process.
Getting Your Paper Today is as Simple as ABC
No more missed deadlines! No more late points deductions!
You give us your assignments instructions via email or through our order page.
Our support team selects a qualified writing team of 2 writers for you.
In under 5 minutes after you place your order, research & writing begins.
Complete paper is delivered to your email before your deadline is up.
Want A Good Grade?
Get a professional writer who has worked on a similar assignment to do this paper for you