Write an application in which you assign data

Assignment Help JAVA Programming
Reference no: EM131182059

1. a. The Talk-A-Lot Cell Phone Company provides phone services for its customers. Create an abstract class named PhoneCall that includes a String field for a phone number and a double field for the price of the call. Also include a constructor that requires a phone number parameter and that sets the price to 0.0. Include a set method for the price. Also include three abstract get methods-one that returns the phone number, another that returns the price of the call, and a third that displays information about the call. Create two child classes of PhoneCall: IncomingPhoneCall and OutgoingPhoneCall. The IncomingPhoneCall constructor passes its phone number parameter to its parent's constructor and sets the price of the call to 0.02. The method that displays the phone call information displays the phone number, the rate, and thepriceofthecall(whichisthesameastherate). The OutgoingPhoneCall class includes an additional field that holds the time of the call in minutes. The constructor requires both a phone number and the time. The price is 0.04 per minute, and the display method shows the details of the call, including the phonenumber, the rate per minute, thenumber of minutes, and the total price. Write an application that demonstrates you can instantiate and display both IncomingPhoneCall and OutgoingPhoneCall objects. Save the files as PhoneCall.java, IncomingPhoneCall.java, OutgoingPhoneCall.java, and DemoPhoneCalls.java.

b. Write an application in which you assign data to a mix of 10 IncomingPhoneCall and OutgoingPhoneCall objects into an array. Use a for loop to display the data. Save the file as PhoneCallArray.java.

2. Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method. Use a constructor in the superclass that requires values for both fields. Create two subclasses named InternationalDivision and DomesticDivision. The InternationalDivision includes a field for the country in which the division is located and a field for the language spoken; its constructor requires both. The DomesticDivision includes a field for the state in which the division is located; a value for this field is required by the constructor. Write an application named UseDivision that creates InternationalDivision and DomesticDivision objects for two different companies and displays information about them. Save the files as Division.java, InternationalDivision.java, DomesticDivision.java, and UseDivision.java.

3. Create an abstract class named Element that holds properties of elements, including their symbol, atomic number, and atomic weight. Include a constructor that requires values for all three properties and a get method for each value. (For example, the symbol for carbon is C, its atomic number is 6, and its atomic weight is 12.01. You can find these values by reading a periodic table in a chemistry reference or by searching the Web.) Also include an abstract method named describeElement(). Create two extended classes named MetalElement and NonMetalElement. Each contains a describeElement() method that displays the details of the element and a brief explanation of the properties of the element type. For example, metals are good conductors of electricity, while nonmetals are poor conductors. Write an application named ElementArray that creates and displays an array that holds at least two elements of each type. Save the files as Element.java, MetalElement.java, NonMetalElement.java, and ElementArray.java.

Reference no: EM131182059

Questions Cloud

Defining properties of a standard brownian motion : 1. State five key defining properties of a standard Brownian motion. 2. Outline the advantages and disadvantages of using the continuous time lognormal model for stock prices by considering both the theoretical features of the model and its cons..
Assessment of validity or otherwise of efficient markets : Explain to what extent the results of such tests should affect the assessment of the validity or otherwise of the efficient markets hypothesis.
Target sales of the appliance control computer : RIC’s marketing department plans to target sales of the appliance control computer to the owners of larger homes - the computer is cost effective only on homes with 2,000 or more square feet of heated/air-conditioned space. The marketing vice-preside..
Explain the structure of current insurance regulation : Briefly explain the structure of current insurance regulation. Specifically, explain whether the federal government regulates insurance or whether each state has regulatory responsibilities. Describe the impact of the key law that determined how the ..
Write an application in which you assign data : Write an application in which you assign data to a mix of 10 IncomingPhoneCall and OutgoingPhoneCall objects into an array. Use a for loop to display the data. Save the file as PhoneCallArray.java.
To what extent cognitive biases may have contributed : To what extent do you think that cognitive biases may have contributed to the global financial crisis that gripped financial markets in 2008 - 2009?
Firm earnings per share after recapitalization : The Rivoli Company has no debt outstanding, and its financial position is given by the following data: Assets (Market value = book value) $3,000,000 EBIT $500,000 Cost of equity, rs 10% Stock price, Po $15 Shares outstanding, no 200,000 Tax rate, T (..
Costs and benefits of various policies can be quantified : Do you believe, in principle, that the costs and benefits of various policies can be quantified in monetary terms? Do you believe that some impacts cannot be fundamentally measured in dollars? How would you suggest that we evaluate these impacts?
Whether three payments are income from personal exertion : Discuss whether or not the three payments are income from personal exertion. - Would your answer differ if she wrote the story for her own satisfaction and only decided to sell it later?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write an application calccircumference

Write an application (CalcCircumference) that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference and area using the floating-point value 3.14159 for ?.

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Modify the inventory program by preparing a subclass of the

modify the inventory program by creating a subclass of the product class that uses one additional unique feature of the

  Which collection class allows you to access its elements

Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?

  Write an application that uses string method region

Write an application that uses String method region - Matches to compare two strings input by the user. The application should input the number of characters to be compared and the starting index of the comparison.

  C program in unix environment

This question deals with writing a C Program in UNIX environment (bash). You must rewrite the LS system call in C, but the output of files MUST be in decreasing order in the size of the file (bytes).

  Powerful pain reliever are consumers with headaches

Your target market for the most powerful pain reliever are consumers with HEADACHES. Start with goals and objectives. Do a SWOT. What information is most important for your market? Do some market research.

  Cloud computing outline

Cloud computing is one of the biggest catchphrases in the Information Technology world. Virtualization is the core technology behind cloud resource sharing. The deployment strategy involved in a cloud environment includes the components of grid co..

  Java code using jframe

Write a Java code using JFrame. This code needs to manipulate 4 shapes(2 rectangles and 2 squares) in a 400x400 JFrame. This needs to manipulate the shapes in 3 different ways, using 3 different methods. One for translating a shape, one for proportio..

  Build a very straightforward and fully functional machine

Build a very straightforward and fully functional machine learning classifier with the K-Nearest Neighbor (KNN) algorithm. The KNN model will read a set of data specified by the user, decide the appropriate class of the new instance, and finally o..

  Analyze a current event

Analyze a current event ( you may use an article from the Wall Street Journal, Financial Times, or New York Times, published this week) using any of the principles that you've learned in this class. 2 pages, double spaced, cite article.

  Java graphics-write an application that extends jframe and

java graphics-write an application that extends jframe and that displays a phrase in every font size from 6 through

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd