1 write an application class that contains several

Assignment Help JAVA Programming
Reference no: EM13380362

1) Write an application class that contains several methods. 

The first method should be named greeting () and should display a JOptionPane that is customized in the following ways (Figure 1):

  1. There should be no icon on this message box.
  2. The title bar on this message box should read "Welcome!"
  3. The message box should display "Welcome to my program!"

1429_Write an application.png

Figure 1

The second method should be named getName() and should display a JOptionPane that is customized in the following ways (Figure 2):

  1. There should be a question mark icon on this message box.
  2. The title bar on this message box should read "Name?"
  3. The message box should allow the user to input his or her name.

1898_Write an application1.png

Figure 2

The third method should be named getAge() and should display a JOptionPane that is customized in the following ways (Figure 3):

  1. There should be a question mark icon on this message box.
  2. The title bar on this message box should read "Age?"
  3. The message box should allow the user to input his or her age.

1570_Write an application2.png

Figure 3

The fourth method should be named displayMessages() and should display JOptionPanes as follows (Figure 4, Figure 5):

  1. The method should first display a JOptionPane with an information icon that has "Summary" as the title bar text.
  2. This message box should display the user's name (X) and age (Y) in the format "X, you are Y years old!"

494_Write an application3.png

Figure 4

  1. After the user closes the first message box, a second one should display that does the following:
    1. Displays a warning icon.
    2. Has "Guess What?" as the title bar text.
    3. Displays the message "In 10 years, you will be (correct age) years old!"

1085_Write an application4.png

Figure 5

  1. In order to accomplish this task, you will need to discover how to convert a String to an integer to perform the calculation.

Write a driver class. This class should use the main method to call four methods in the application class that will display our JOptionPanes.

Remember to write the source code for each class in a separate file which must have the same name as the class name with the extension '.java'.  Remember also that by convention, class names commence with a capital letter.

As with all programs you write, you should provide a well-structured solution that is easy to read.  You should use meaningful identifier names and should provide useful comments.  A large portion of the marks for this assignment will be for the structure of the classes, not whether they work correctly or not.

The focus of the assignment is for you to familiarise yourself with the Java concepts introduced in this seminar (classes, instances, instance methods, constructors, method calls, JOptionPanes, etc).

It is a good idea to work in a step by step top-down manner.  First define the general structure of a class with empty methods and compile the class.  Once it compiles successfully, then add further detail, recompiling after every few lines.  This way, the risk of getting several error messages at once is reduced.

Reference no: EM13380362

Questions Cloud

When organizations develop risk management plans they need : when organizations develop risk management plans they need to consider the value of the assets being protected and the
A security policy is a statement that partitions the states : a security policy is a statement that partitions the states of the system into a set of authorized or secure states and
Primary task responsenbspwithin the discussion board area : primary task responsenbspwithin the discussion board area write 400-600 words that respond to the following questions
As the lead software engineer for a medium-sized hospital : as the lead software engineer for a medium-sized hospital you have been asked to spearhead an effort to improve the
1 write an application class that contains several : 1 write an application class that contains several methods.nbspthe first method should be named greeting and should
1 the appropriate sql statements for each query which : 1. the appropriate sql statements for each query which should be copied from your sql code in mysql and pasted into
Option 1 you can are required to research into one of the : option 1 you can are required to research into one of the following topics on data security or computer-network
You will need to design an interface to a systemyou will : you will need to design an interface to a system.you will need to justify every item that you choose to put into this
Assessment taskyour task is to develop a java application : assessment taskyour task is to develop a java application that allows the user to read travel booking data from a text

Reviews

Write a Review

JAVA Programming Questions & Answers

  Use inheritance to read, store, and print questions for test

use inheritance to read, store, and print questions for a test. First, write an abstract class

  Object from question 1 manage its display

Write a Java statement to have the object from question 1 manage its display area by dividing it into 3 rows which have 4 columns each.

  Graphicsframe class

This program makes use of the GraphicsFrame class and the Drawable interface. Your missions is to create the class Airplane. Each Airplane object should store the following information (fields): manufacturer modelNumber maximumSpeed // in knots maxim..

  Instance methods

instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5  * all variables are private and methods public.

  Write java program to store values retrieved from user-array

Write a Java program named Arrays6_2GF.java Use an array to store values retrieved from user input. The number of integers to be entered (the length of the array )should also be retrieved through user input.

  Write a program that prompts the user for a start date

write a program that prompts the user for a start date and an end date and then prints all of the dates between them (inclusive), with seven tab-separated dates on each line.

  Driveway is a "last-in, first-out" stack. of course

Driveway is a "last-in, first-out" stack. Of course, when a car owner retrieves a vehicle that wasn't the last one in, the cars blocking it must temporarily move to the street so that the requested vehicle can leave. Write a program in Java that m..

  Develop a complex web site

Develop a complex web site or piece of multimedia from scratch, using information gathering and design techniques;

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  1design an abstract data type in java that represents a

1.design an abstract data type in java that represents a musical pitch noteadt.java. the adt should store the note or

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  Create an array of integers at random

create an array of integers at random with a range of 0 through 1000 in Java... any hints?

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