//Dealership.java import java.util.Calendar; public class Dealership { // public
ID: 3653284 • Letter: #
Question
//Dealership.java import java.util.Calendar; public class Dealership { // public static final class variables public static final int YEAR_STARTED = 1995; public static final String COMPANY_NAME = "The Rusty Lemon"; public static final String COMPANY_URL = "www.TheRustyLemon.com"; public static final String COMPANY_ADDRESS = "123 Rustbelt Road, Somewhere, SomeState, 12345"; public static final String COMPANY_SLOGAN = "Many parts of our cars run great!"; public static final double STANDARD_MARKUP = 0.50; public static final String COMPANY_EMAIL = "contact@therustylemon.com"; // public static methods public static String getCompanyBanner() { return COMPANY_NAME + " (Selling rusty lemons since " + YEAR_STARTED + ") " + COMPANY_ADDRESS + " " + COMPANY_URL + " " + COMPANY_SLOGAN + " " +" yearsInBusiness"; } public static double getRetailPrice(double dealerCost, double cleaningCost) { double markup = dealerCost * STANDARD_MARKUP; return dealerCost + cleaningCost + markup; } public static int getYearsInBusiness() { Calendar today = Calendar.getInstance(); int curYear = today.get(Calendar.YEAR); int yearsInBusiness = curYear - YEAR_STARTED; return yearsInBusiness; } } ------------------------------------------------------------------------------------ ******* I think I have completed the Dealership class (above) correctly, if not please let me know Modify the Dealership class as follows: 1. Assign "contact@therustylemon.com" to a new class variable named COMPANY_EMAIL. 2. Create a new method named getYearsInBusiness() that does not receive any parameters. 3. The method should calculate and return the years in business by subtracting the YEAR_STARTED from the current year (for example 2012 if that is the current year). 1. Exercise 1: to create Rusty1, choose New File from the File menu in NetBeans. In the first window choose Category: Java and File Type: Java class. Click Next. For Class Name type Rusty1. (Note: since this class is executable be sure to define a main method for the class when you work through the exercise). Now create an application named Rusty1 that uses methods and class variables in the Dealership class to displays the company banner followed by a blank line followed by the following paragraph: We've been operating now for X years! To talk to one of our sales people, send an email to Y. where X is the number of years in business (call the method you add to the Dealership class) and Y is the email address (call the variable that you defined in the Dealership class). *********Here is my messed up code for Rusty1. I cannot get the syntax correct to bring back the information from Dealership.java to Rusty1.java. Perhaps if someone could point out my errors, I could use your examples to complete the rest of the exercises. Thank you for any help! //Rusty1.java /** * * @author */ public class Rusty1 { { public static void main (String [] args) } { public static String Dealership.getCompanyBanner(); } { public static int getYearsInBusiness(); { System.out.println(Dealership.getCompanyBanner() + System.out.println(Dealership.getYearsInBusiness(); } }Explanation / Answer
correct
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.